Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[riena-dev] On disabling standard commands

I've been asked to post how I "disable" some standard commands that do
not make sense for Riena. This are commands such as nextView,
previousView, nextPerspective, previousPerspective (bound to Ctrl+F7,
Ctrl+F8 and other keys).

My solution was to install a 'Nop-Handler' for this commands, i.e.
this handler does nothing:

IHandler handler = new AbstractHandler() {
  public Object execute(ExecutionEvent event) throws ExecutionException {
    // Do nothing by design
  return null;
  }
};

The handler is associated with problematic commands via java-API. This
happens in ApplicationAdvisor#overwriteStandardHandlers(). You'll find
the details here.

I would not call this a best practice but it works well for my
purposes (unfortunately the whole extension point system is designed
primarily about the notion of adding stuff - not removing).

Hope this helps,
Elias.

-- 
Elias Volanakis | Technical Lead | EclipseSource Portland
elias@xxxxxxxxxxxxxxxxx | +1 503 929 5537 | http://eclipsesource.com


Back to the top