<handlers xmi:id="_d_HUYOPBEeeIH8IplZ0cuA" elementId="eu.etaxonomy.taxeditor.editor.handler.2" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.charactermatrix.handler.ExportCharacterMatrixHandler" command="_YeWagOPBEeeIH8IplZ0cuA"/>
<handlers xmi:id="_mUM1cLKVEeikjKoOnLFm2w" elementId="eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler.CreateDefaultTaxonDescriptionHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler.CreateDefaultTaxonDescriptionHandler" command="_ZHC3oLKVEeikjKoOnLFm2w"/>
<handlers xmi:id="_t8dAQLKVEeikjKoOnLFm2w" elementId="eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler.CreateLiteratureTaxonDescriptionHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler.CreateLiteratureTaxonDescriptionHandler" command="_fkPkkLKVEeikjKoOnLFm2w"/>
+ <handlers xmi:id="_EbmggKAFEeqsyb5erE_VKQ" elementId="eu.etaxonomy.taxeditor.editor.handler.4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler.AddDescriptionHandler" command="_zCGQ8JN1EeqyUKRuXQ8miw"/>
<menus xmi:id="_PLw00OPBEeeIH8IplZ0cuA" elementId="eu.etaxonomy.taxeditor.editor.menu.characterMatrix" label="%menu.label.7">
<children xsi:type="menu:HandledMenuItem" xmi:id="_TGK04OPBEeeIH8IplZ0cuA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.characterMatrix.export" label="%handledmenuitem.label.12" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif" command="_YeWagOPBEeeIH8IplZ0cuA"/>
</menus>
<children xsi:type="menu:HandledMenuItem" xmi:id="_AyHbgLKSEeikjKoOnLFm2w" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.createdefaultdescription" label="%handledmenuitem.label.19" command="_ZHC3oLKVEeikjKoOnLFm2w"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_DYlHcLKSEeikjKoOnLFm2w" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.createliteraturedescription" label="%handledmenuitem.label.20" command="_fkPkkLKVEeikjKoOnLFm2w"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="__SlnwI97EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.deletedescription" label="%handledmenuitem.label.28" command="_MYd44I98EeqyUKRuXQ8miw"/>
- <children xsi:type="menu:HandledMenuItem" xmi:id="_oyS1EJN1EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.adddescription" label="Add description" command="_gE3lwIGyEeehlNPrK_b5JA"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_ARo78KSvEeq8Gc-K2nsNRg" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.adddescription" label="Add description" command="_zCGQ8JN1EeqyUKRuXQ8miw"/>
</menus>
</elements>
<elements xsi:type="basic:PartDescriptor" xmi:id="_XcQMEN8mEee9zP45RW4C3A" elementId="eu.etaxonomy.taxeditor.editor.descriptiveDataSet.DescriptiveDataSetNavigator" label="%partdescriptor.label.5" closeable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.descriptiveDataSet.DescriptiveDataSetNavigator">
<elements xsi:type="commands:Command" xmi:id="_yknsIL9NEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.MoveDescriptionToOtherTaxonHandlerSetNameInSource" commandName="%command.name.131"/>
<elements xsi:type="commands:Command" xmi:id="__8WFwL9OEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionElementsSetNameInSource" commandName="%command.name.132"/>
<elements xsi:type="commands:Command" xmi:id="_MYd44I98EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.command.deletedescription" commandName="%command.commandname.24"/>
- <elements xsi:type="commands:Command" xmi:id="_zCGQ8JN1EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.handler.addDescription" commandName="Add description"/>
+ <elements xsi:type="commands:Command" xmi:id="_zCGQ8JN1EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.charactermatrix.command.addDescription" commandName="%command.commandname.25"/>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_pZmusEalEeeXMc6kSYO7Xg" featurename="children" parentElementId="eu.etaxonomy.taxeditor.menu.showView" positionInList="after:eu.etaxonomy.taxeditor.workbench.menuseparator.navigation">
<elements xsi:type="menu:HandledMenuItem" xmi:id="_FPIHQKNwEeebGZ23ERGMGw" elementId="eu.etaxonomy.taxeditor.editor.showViewMenu.conceptGraph" label="%view.name.3" iconURI="" tooltip="%view.name.3" command="_WPjpoDSnEeek0dKsFNy--Q">
private List<SpecimenNodeWrapper> specimenToAdd;
+ private MouseEventMatcher mouseEventMatcher = null;
+
public CharacterMatrix(Composite parent, CharacterMatrixPart part) {
super(parent, SWT.NONE);
this.part = part;
/**
* configuration
*/
+
configureNatTable(treeView, configRegistry, topMostLayer);
/**
categoricalFeatureToStateMap.put(feature, supportedStates);
}
+
+
private void createLayers(boolean treeView) {
+
SortedList<Object> sortedList = new SortedList<>(descriptions, new MatrixRowComparator());
// wrap the SortedList with the TreeList
treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
TreeList<Object> treeList = new TreeList(sortedList, treeFormat, TreeList.NODES_START_COLLAPSED);
+ // wrap the SortedList with the TreeList
+ treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
+
/**
* data provider
*/
SpecimenColumnPropertyAccessor columnPropertyAccessor = new SpecimenColumnPropertyAccessor(this);
bodyDataProvider = treeView?new ListDataProvider<>(treeList, columnPropertyAccessor):new ListDataProvider<>(sortedList, columnPropertyAccessor);
- configRegistry = new ConfigRegistry();
+ DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
+ bodyDataLayer.registerCommandHandler(new CopyPasteUpdateDataCommandHandler(bodyDataLayer));
/**
*
*/
- DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
- bodyDataLayer.registerCommandHandler(new CopyPasteUpdateDataCommandHandler(bodyDataLayer));
+ configRegistry = new ConfigRegistry();
//register labels
CharacterMatrixConfigLabelAccumulator labelAccumulator = new CharacterMatrixConfigLabelAccumulator(this);
bodyDataLayer.setConfigLabelAccumulator(labelAccumulator);
freezeLayer = new FreezeLayer(selectionLayer);
final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(
freezeLayer, bodyLayer.getViewportLayer(), selectionLayer);
- TreeLayer treeLayer = new TreeLayer(compositeFreezeLayer, treeRowModel);
+ TreeLayer treeLayer = null;
+ if (treeView){
+ treeLayer = new TreeLayer(compositeFreezeLayer, treeRowModel);
+ }
topMostLayer = treeView?treeLayer:compositeFreezeLayer;
/**
* CONFIGURATION
*/
+ //+++CONTEXT MENU+++
+ menuService.registerContextMenu(natTable, "eu.etaxonomy.taxeditor.editor.popupmenu.charactermatrix"); //$NON-NLS-1$
+ // get the menu registered by EMenuService
+ final Menu e4Menu = natTable.getMenu();
+
natTable.setConfigRegistry(configRegistry);
applyStyles();
// add the header menu configuration for adding the column header menu
// with hide/show actions
- natTable.addConfiguration(new CharacterMatrixHeaderMenuConfiguration(natTable));
+// natTable.addConfiguration(new CharacterMatrixHeaderMenuConfiguration(natTable));
// add custom configuration for data conversion and add column labels to viewport layer
topMostLayer.addConfiguration(new CellEditorDataConversionConfiguration(this));
//copy&paste configuration
natTable.addConfiguration(new CopyPasteEditBindings(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard()));
- //+++CONTEXT MENU+++
- menuService.registerContextMenu(natTable, "eu.etaxonomy.taxeditor.editor.popupmenu.charactermatrix"); //$NON-NLS-1$
- // get the menu registered by EMenuService
- final Menu e4Menu = natTable.getMenu();
+
// remove the menu reference from NatTable instance
natTable.setMenu(null);
+
+
+// natTable.addConfiguration(new CharacterMatrixHeaderMenuConfiguration(natTable));
+
+
+ natTable.configure();
+
+
natTable.addConfiguration(
- new AbstractUiBindingConfiguration() {
- @Override
- public void configureUiBindings(
- UiBindingRegistry uiBindingRegistry) {
- // add e4 menu to NatTable
- new PopupMenuBuilder(natTable, e4Menu)
+ new AbstractUiBindingConfiguration() {
+ @Override
+ public void configureUiBindings(
+ UiBindingRegistry uiBindingRegistry) {
+ // add e4 menu to NatTable
+
+
+ uiBindingRegistry.unregisterMouseDownBinding(mouseEventMatcher);
+ new PopupMenuBuilder(natTable, e4Menu)
+ .withHideColumnMenuItem()
+ .withShowAllColumnsMenuItem()
.build();
- // register the UI binding for header, corner and body region
- uiBindingRegistry.registerMouseDownBinding(
- new MouseEventMatcher(
- SWT.NONE,
- null,
- MouseEventMatcher.RIGHT_BUTTON),
- new PopupMenuAction(e4Menu));
- }
- });
+ // register the UI binding for header, corner and body region
+ mouseEventMatcher = new MouseEventMatcher(
+ SWT.NONE,
+ null,
+ MouseEventMatcher.RIGHT_BUTTON);
+ uiBindingRegistry.registerMouseDownBinding(mouseEventMatcher,
+ new PopupMenuAction(e4Menu));
+ }
+ });
- natTable.configure();
}
void freezeSupplementalColumns(boolean freeze){
// SpecimenRowWrapperDTO rowWrapper = new SpecimenRowWrapperDTO(wrapper.getUuidAndTitleCache(), wrapper.getType(), wrapper.getTaxonNode(), specimenMap.get(wrapper.getUuidAndTitleCache().getUuid()), null, null);
descriptions.add(rowWrapper);
}
- loadingDone(false);
+
setDirty();
}