Revision 0fb37c99
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java | ||
---|---|---|
273 | 273 |
dataLayer.setColumnPercentageSizing(true); |
274 | 274 |
natTable = new NatTable(bottomComposite, gridLayer, false); |
275 | 275 |
|
276 |
//create context menu
|
|
276 |
//+++CONTEXT MENU+++
|
|
277 | 277 |
menuService.registerContextMenu(natTable, "eu.etaxonomy.taxeditor.bulkeditor.popupmenu.bulkeditor"); //$NON-NLS-1$ |
278 | 278 |
// get the menu registered by EMenuService |
279 | 279 |
final Menu e4Menu = natTable.getMenu(); |
... | ... | |
281 | 281 |
natTable.setMenu(null); |
282 | 282 |
natTable.addConfiguration( |
283 | 283 |
new AbstractUiBindingConfiguration() { |
284 |
|
|
285 | 284 |
@Override |
286 | 285 |
public void configureUiBindings( |
287 | 286 |
UiBindingRegistry uiBindingRegistry) { |
288 |
// add NatTable menu items |
|
289 |
// and register the DisposeListener |
|
287 |
// add e4 menu to NatTable |
|
290 | 288 |
new PopupMenuBuilder(natTable, e4Menu) |
291 | 289 |
.build(); |
292 | 290 |
|
293 |
// register the UI binding |
|
291 |
// register the UI binding for header, corner and body region
|
|
294 | 292 |
uiBindingRegistry.registerMouseDownBinding( |
295 | 293 |
new MouseEventMatcher( |
296 | 294 |
SWT.NONE, |
297 | 295 |
GridRegion.BODY, |
298 | 296 |
MouseEventMatcher.RIGHT_BUTTON), |
299 | 297 |
new PopupMenuAction(e4Menu)); |
300 |
// register the UI binding |
|
301 | 298 |
uiBindingRegistry.registerMouseDownBinding( |
302 | 299 |
new MouseEventMatcher( |
303 | 300 |
SWT.NONE, |
304 | 301 |
GridRegion.COLUMN_HEADER, |
305 | 302 |
MouseEventMatcher.RIGHT_BUTTON), |
306 | 303 |
new PopupMenuAction(e4Menu)); |
304 |
uiBindingRegistry.registerMouseDownBinding( |
|
305 |
new MouseEventMatcher( |
|
306 |
SWT.NONE, |
|
307 |
GridRegion.CORNER, |
|
308 |
MouseEventMatcher.RIGHT_BUTTON), |
|
309 |
new PopupMenuAction(e4Menu)); |
|
307 | 310 |
} |
308 | 311 |
}); |
309 | 312 |
|
Also available in: Unified diff
ref #7439 Show context menu for empty editor when clicking on corner