Revision aa85a093
Added by Patrick Plitzner over 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrix.java | ||
---|---|---|
34 | 34 |
import org.eclipse.jface.viewers.IStructuredSelection; |
35 | 35 |
import org.eclipse.jface.viewers.StructuredSelection; |
36 | 36 |
import org.eclipse.nebula.widgets.nattable.NatTable; |
37 |
import org.eclipse.nebula.widgets.nattable.config.AbstractUiBindingConfiguration; |
|
38 | 37 |
import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry; |
39 | 38 |
import org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration; |
40 | 39 |
import org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate; |
... | ... | |
78 | 77 |
import org.eclipse.nebula.widgets.nattable.summaryrow.SummaryRowLayer; |
79 | 78 |
import org.eclipse.nebula.widgets.nattable.tree.ITreeRowModel; |
80 | 79 |
import org.eclipse.nebula.widgets.nattable.tree.TreeLayer; |
81 |
import org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry; |
|
82 |
import org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher; |
|
83 |
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuAction; |
|
84 |
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder; |
|
85 | 80 |
import org.eclipse.nebula.widgets.nattable.util.GUIHelper; |
86 | 81 |
import org.eclipse.swt.SWT; |
87 | 82 |
import org.eclipse.swt.layout.GridData; |
88 | 83 |
import org.eclipse.swt.layout.GridLayout; |
89 | 84 |
import org.eclipse.swt.widgets.Button; |
90 | 85 |
import org.eclipse.swt.widgets.Composite; |
91 |
import org.eclipse.swt.widgets.Menu; |
|
92 | 86 |
|
93 | 87 |
import ca.odell.glazedlists.BasicEventList; |
94 | 88 |
import ca.odell.glazedlists.EventList; |
... | ... | |
519 | 513 |
natTable.addConfiguration(new CopyPasteEditBindings(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard())); |
520 | 514 |
|
521 | 515 |
//+++CONTEXT MENU+++ |
522 |
menuService.registerContextMenu(natTable, "eu.etaxonomy.taxeditor.editor.popupmenu.charactermatrix"); //$NON-NLS-1$ |
|
523 |
// get the menu registered by EMenuService |
|
524 |
final Menu e4Menu = natTable.getMenu(); |
|
525 |
// remove the menu reference from NatTable instance |
|
526 |
natTable.setMenu(null); |
|
527 |
natTable.addConfiguration( |
|
528 |
new AbstractUiBindingConfiguration() { |
|
529 |
@Override |
|
530 |
public void configureUiBindings( |
|
531 |
UiBindingRegistry uiBindingRegistry) { |
|
532 |
// add e4 menu to NatTable |
|
533 |
new PopupMenuBuilder(natTable, e4Menu) |
|
534 |
.build(); |
|
535 |
|
|
536 |
// register the UI binding for header, corner and body region |
|
537 |
uiBindingRegistry.registerMouseDownBinding( |
|
538 |
new MouseEventMatcher( |
|
539 |
SWT.NONE, |
|
540 |
GridRegion.BODY, |
|
541 |
MouseEventMatcher.RIGHT_BUTTON), |
|
542 |
new PopupMenuAction(e4Menu)); |
|
543 |
} |
|
544 |
}); |
|
516 |
// menuService.registerContextMenu(natTable, "eu.etaxonomy.taxeditor.editor.popupmenu.charactermatrix"); //$NON-NLS-1$
|
|
517 |
// // get the menu registered by EMenuService
|
|
518 |
// final Menu e4Menu = natTable.getMenu();
|
|
519 |
// // remove the menu reference from NatTable instance
|
|
520 |
// natTable.setMenu(null);
|
|
521 |
// natTable.addConfiguration(
|
|
522 |
// new AbstractUiBindingConfiguration() {
|
|
523 |
// @Override
|
|
524 |
// public void configureUiBindings(
|
|
525 |
// UiBindingRegistry uiBindingRegistry) {
|
|
526 |
// // add e4 menu to NatTable
|
|
527 |
// new PopupMenuBuilder(natTable, e4Menu)
|
|
528 |
// .build();
|
|
529 |
// |
|
530 |
// // register the UI binding for header, corner and body region
|
|
531 |
// uiBindingRegistry.registerMouseDownBinding(
|
|
532 |
// new MouseEventMatcher(
|
|
533 |
// SWT.NONE,
|
|
534 |
// GridRegion.BODY,
|
|
535 |
// MouseEventMatcher.RIGHT_BUTTON),
|
|
536 |
// new PopupMenuAction(e4Menu));
|
|
537 |
// }
|
|
538 |
// });
|
|
545 | 539 |
|
546 | 540 |
natTable.configure(); |
547 | 541 |
} |
Also available in: Unified diff
Disable (unused) context menu