</menuContribution>
<menuContribution
locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?before=eu.etaxonomy.taxeditor.store.showViewMenu.details">
- <separator
- name="eu.etaxonomy.taxeditor.editor.showViewMenu"
- visible="true">
- </separator>
<command
commandId="org.eclipse.ui.views.showView"
label="%command.label.4"
</reference>
</visibleWhen>
</command>
- <command
- commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditor"
- label="Derivative Editor"
- style="push">
- <visibleWhen
- checkEnabled="true">
- <reference
- definitionId="isCdmStoreConnected">
- </reference>
- </visibleWhen>
- </command>
<command
commandId="org.eclipse.ui.views.showView"
label="%command.label.6"
</visibleWhen>
</command>
</menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?before=org.eclipse.ui.views.showView.occurenceView">
+ <separator
+ name="eu.etaxonomy.taxeditor.store.separator_derivative_start"
+ visible="true">
+ </separator>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditor"
+ label="Derivative Editor"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <reference
+ definitionId="isCdmStoreConnected">
+ </reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?after=org.eclipse.ui.views.showView.supplemental">
+ <separator
+ name="eu.etaxonomy.taxeditor.store.showViewMenu.validation.separator"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.ui.views.showView"
+ label="%command.name.40"
+ style="push">
+ <parameter
+ name="org.eclipse.ui.views.showView.viewId"
+ value="eu.etaxonomy.taxeditor.editor.view.validation.problems">
+ </parameter>
+ <visibleWhen
+ checkEnabled="true">
+ <reference
+ definitionId="isCdmStoreConnected">
+ </reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu.navigate">
<command
</visibleWhen>
</command>
</menuContribution>
- <menuContribution
- allPopups="false"
- locationURI="toolbar:eu.etaxonomy.taxeditor.editor.view.descriptive">
- <command
- commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations"
- icon="icons/link_obj.gif"
- style="toggle"
- tooltip="%command.tooltip">
- </command>
- </menuContribution>
<menuContribution
allPopups="false"
locationURI="popup:eu.etaxonomy.taxeditor.navigation.navigatorpopup?after=taxeditor-navigation.separator2">
</separator>
</menuContribution>
<menuContribution
- locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?after=org.eclipse.ui.views.showView.supplemental">
- <separator
- name="eu.etaxonomy.taxeditor.store.showViewMenu.validation.separator"
- visible="true">
- </separator>
+ allPopups="false"
+ locationURI="toolbar:eu.etaxonomy.taxeditor.editor.view.descriptive">
<command
- commandId="org.eclipse.ui.views.showView"
- label="%command.name.40"
- style="push">
- <parameter
- name="org.eclipse.ui.views.showView.viewId"
- value="eu.etaxonomy.taxeditor.editor.view.validation.problems">
- </parameter>
- <visibleWhen
- checkEnabled="true">
- <reference
- definitionId="isCdmStoreConnected">
- </reference>
- </visibleWhen>
+ commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations"
+ icon="icons/link_obj.gif"
+ style="toggle"
+ tooltip="%command.tooltip">
</command>
</menuContribution>
</extension>
id="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"
name="Sessions"
restorable="false">
+ </view>
+ <view
+ class="eu.etaxonomy.taxeditor.view.derivative.OccurenceView"
+ id="eu.etaxonomy.taxeditor.view.derivative.OccurenceView"
+ name="name"
+ restorable="true">
</view>
</extension>
<extension
<menu
id="eu.etaxonomy.taxeditor.menu.showView"
label="%menu.label">
+ <separator
+ name="eu.etaxonomy.taxeditor.store.showViewMenu.details"
+ visible="true">
+ </separator>
<command
commandId="org.eclipse.ui.views.showView"
- label="%command.label"
+ id="org.eclipse.ui.views.showView.occurenceView"
+ label="OccurenceView"
style="push">
<parameter
name="org.eclipse.ui.views.showView.viewId"
- value="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView">
+ value="eu.etaxonomy.taxeditor.view.derivative.OccurenceView">
</parameter>
<visibleWhen
checkEnabled="true">
</visibleWhen>
</command>
<separator
- name="eu.etaxonomy.taxeditor.store.showViewMenu.details"
+ name="eu.etaxonomy.taxeditor.store.separator_derivative_end"
visible="true">
</separator>
<command
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.view.derivative;
+
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.part.ViewPart;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateContentProvider;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
+
+/**
+ * @author pplitzner
+ * @date Oct 7, 2015
+ *
+ */
+public class OccurenceView extends ViewPart implements IConversationEnabled, ISelectionChangedListener{
+
+ private TreeViewer viewer;
+ private DerivateContentProvider contentProvider;
+ private DerivateLabelProvider labelProvider;
+ private ConversationHolder conversation;
+
+ public OccurenceView() {
+ conversation = CdmStore.createConversation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ //---tree viewer---
+ viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
+ GridData gridDataTree = new GridData();
+ gridDataTree.horizontalAlignment = GridData.FILL;
+ gridDataTree.verticalAlignment = GridData.FILL;
+ gridDataTree.grabExcessVerticalSpace = true;
+ gridDataTree.grabExcessHorizontalSpace = true;
+ viewer.getTree().setLayoutData(gridDataTree);
+ contentProvider = new DerivateContentProvider();
+ viewer.setContentProvider(contentProvider);
+ labelProvider = new DerivateLabelProvider();
+ labelProvider.setConversation(conversation);
+ viewer.setLabelProvider(labelProvider);
+ viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
+ // Propagate selection from viewer
+ getSite().setSelectionProvider(viewer);
+ //listen to selection changes
+ viewer.addSelectionChangedListener(this);
+
+ //create context menu
+ MenuManager menuManager = new MenuManager();
+ getSite().registerContextMenu(menuManager, viewer);
+ Control control = viewer.getControl();
+ Menu menu = menuManager.createContextMenu(control);
+ control.setMenu(menu);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setFocus() {
+ if(!conversation.isClosed()){
+ conversation.bind();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void update(CdmDataChangeMap arg0) {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ConversationHolder getConversationHolder() {
+ return conversation;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ if(conversation.isBound() && !conversation.isClosed()){
+ conversation.close();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+
+ }
+
+}