Skip to content

Commit

Permalink
Show popupmenu when control-click is pressed on mac.
Browse files Browse the repository at this point in the history
Solves bug 3096
  • Loading branch information
goglepox committed Mar 29, 2012
1 parent c949471 commit 84467af
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -47,8 +47,19 @@ public void widgetDisposed(DisposeEvent e) {
}

public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
PopupMenuAction popupAction = new PopupMenuAction(colHeaderMenu);
uiBindingRegistry.registerMouseDownBinding(
new MouseEventMatcher(SWT.NONE, GridRegion.BODY, 3),
new PopupMenuAction(colHeaderMenu));
popupAction);
if(isMac()) {
uiBindingRegistry.registerMouseDownBinding(
new MouseEventMatcher(SWT.CTRL, GridRegion.BODY, 1),
popupAction);
}
}

private static boolean isMac() {
String vers = System.getProperty( "os.name" ).toLowerCase();
return vers.indexOf( "mac" )!=-1;
}
}

0 comments on commit 84467af

Please sign in to comment.