+++ /dev/null
-/**
-* Copyright (C) 2007 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.editor.view.descriptive;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.ImageData;
-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.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.internal.E4PartWrapper;
-
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.cdm.model.description.IDescribable;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
-import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
-import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4;
-import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
-import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;
-import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
-import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
-import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
-import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
-import eu.etaxonomy.taxeditor.model.ImageResources;
-import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
-import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
-
-/**
- * @author n.hoffmann
- * @created Jun 9, 2010
- * @version 1.0
- */
-public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData {
-
- /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.desc"{trunked}</code> */
- public static final String ID = "eu.etaxonomy.taxeditor.editor.view.descriptive"; //$NON-NLS-1$
-
- protected TreeViewer viewer;
-
- /**
- * Maps {@link FeatureNodeContainerTree} to their corresponding {@link TaxonDescritpion}.<br>
- * This serves as input for the {@link ITreeContentProvider} of the {@link TreeViewer}
- */
- protected Map<DescriptionBase<?>, FeatureNodeContainerTree> featureNodeContainerCache = new HashMap<DescriptionBase<?>, FeatureNodeContainerTree>();
-
- protected ToggleDescriptionAction showAllElementsAction;
-
- protected ToggleDescriptionAction hideAllElementsAction;
-
- protected int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
-
- private DescriptiveContentProvider provider;
-
- /** {@inheritDoc} */
- @Override
- public void createViewer(Composite parent) {
- viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL
- | SWT.V_SCROLL | SWT.FULL_SELECTION));
- provider = new DescriptiveContentProvider(featureNodeContainerCache);
- viewer.setContentProvider(provider);
- viewer.setLabelProvider(new DescriptiveLabelProvider());
- viewer.setSorter(new DescriptiveViewerSorter());
- viewer.setAutoExpandLevel(2);
- Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() };
-// viewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(
-// this));
-// viewer.addDropSupport(dndOperations, transfers,
-// new DescriptionElementDropAdapter(viewer));
-
- // Propagate selection from viewer
- getSite().setSelectionProvider(viewer);
-
- showAllElementsAction = new ToggleDescriptionAction(false);
- hideAllElementsAction = new ToggleDescriptionAction(true);
-
- // Add context menu to tree
- createMenu();
-
- createToolbar();
-
- }
-
- /** {@inheritDoc} */
- @Override
- protected ISelection getInitialSelection() {
-// if(getEditor() != null){
-// return new StructuredSelection(getEditor().getEditorInput());
-// }
-
- return super.getInitialSelection();
- }
-
- protected void createToolbar() {
- IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
- toolBarManager.add(showAllElementsAction);
- toolBarManager.add(hideAllElementsAction);
- }
-
- /*
- * TODO add to the views menu
- */
- protected void createMenu(){
- MenuManager menuManager = new MenuManager();
- menuManager.setRemoveAllWhenShown(true);
- menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
- getSite().registerContextMenu(menuManager, viewer);
-
- // FIXME for some reason this is not working
- menuManager.add(showAllElementsAction);
- menuManager.add(hideAllElementsAction);
-
- Control control = viewer.getControl();
- Menu menu = menuManager.createContextMenu(control);
-
- control.setMenu(menu);
- }
-
- /** {@inheritDoc} */
- @Override
- protected void selectionChanged_internal(IWorkbenchPart workbenchPart, ISelection selection) {
- Object partObject = workbenchPart;
-// if(AbstractUtility.getActiveE4Editor() == null){
-// showEmptyPage();
-// return;
-// }
-
-
- if(partObject == this){
- return;
- }
-
- Object wrappedPart = WorkbenchUtility.getE4WrappedPart(partObject);
-
- if(wrappedPart!=null){
- partObject = wrappedPart;
- }
- if(part == this){
- return;
- }
-
- if (partObject instanceof MediaViewPartE4) {
- // do not show empty page as these views are also used to edit the
- // description selected in this view
- return;
- }
- else if(partObject instanceof ChecklistEditor){
- if(selection instanceof StructuredSelection && ((IStructuredSelection) selection).getFirstElement() instanceof Taxon){
- Taxon taxon = (Taxon)((IStructuredSelection) selection).getFirstElement();
- selection = new StructuredSelection(taxon);
- }
- }
- //check if it is a tree node selection
- TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(selection);
- if(treeNodeOfSelection!=null){
- selection = new StructuredSelection(treeNodeOfSelection.getValue());
- }
- if(selection instanceof IStructuredSelection){
- Object firstElement = ((IStructuredSelection) selection).getFirstElement();
- if (partObject instanceof TaxonNameEditorE4){
- if (firstElement != ((TaxonNameEditorE4)partObject).getTaxon()){
- showEmptyPage();
- return;
- }
- }
-
- if(firstElement instanceof IDescribable<?>
- && partObject instanceof IPartContentHasFactualData
- && !(firstElement instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
-
- featureNodeContainerCache.clear();
- showViewer(partObject, (IStructuredSelection) selection);
- return;
- }
- }
- showEmptyPage();
- }
-
- @Override
- protected String getViewName(){
- return Messages.DescriptiveViewPart_FACTUAL_DATA;
- }
-
- /**
- *
- * @author n.hoffmann
- * @created May 28, 2010
- * @version 1.0
- */
- protected class ToggleDescriptionAction extends Action{
- private final boolean expanded;
-
- public ToggleDescriptionAction(boolean expand){
- super(null, IAction.AS_PUSH_BUTTON);
- expanded = expand;
- setImageAndTooltip();
- }
-
- private void setImageAndTooltip(){
- setImageDescriptor(new ImageDescriptor() {
- @Override
- public ImageData getImageData() {
- setText(expanded ? Messages.DescriptiveViewPart_COLLAPSE_ALL : Messages.DescriptiveViewPart_EXPAND_ALL);
- String resource = expanded ? ImageResources.COLLAPSE_ALL : ImageResources.EXPAND_ALL;
- return ImageResources.getImage(resource).getImageData();
- }
- });
-
- String toolTipText = expanded ? Messages.DescriptiveViewPart_COLLAPSE_ALL : Messages.DescriptiveViewPart_SHOW_ALL_DATA;
- setToolTipText(toolTipText);
- }
-
- @Override
- public void run() {
- if(expanded){
- viewer.collapseAll();
- }else{
- viewer.expandAll();
- }
- setImageAndTooltip();
- }
- }
-
- /** {@inheritDoc} */
- @Override
- public boolean postOperation(CdmBase objectAffectedByOperation) {
- return super.postOperation(objectAffectedByOperation);
- }
-
- /** {@inheritDoc} */
- @Override
- public void changed(Object object) {
- for(FeatureNodeContainerTree containerTree : featureNodeContainerCache.values()){
- containerTree.buildTree();
- }
- viewer.expandToLevel(2);
- viewer.refresh();
-
- if(object instanceof DescriptionElementBase){
- DescriptionElementBase descriptionElement = (DescriptionElementBase) object;
- DescriptionBase description = descriptionElement.getInDescription();
- FeatureNodeContainerTree containerTree = featureNodeContainerCache.get(description);
-
- FeatureNodeContainer featureNodeContainer = containerTree.getFeatureNodeContainerForDescriptionElement(descriptionElement);
- viewer.expandToLevel(featureNodeContainer, 1);
-
- }
-
- if(object != null){
- StructuredSelection selection = new StructuredSelection(object);
- viewer.setSelection(selection, true);
- }
- if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
- ((BulkEditor) part).forceDirty();
- IStructuredSelection selection = (IStructuredSelection) ((BulkEditor) part).getSelectionProvider().getSelection();
- ((BulkEditor) part).changed(selection.getFirstElement());
-
- }
-
- if (part instanceof E4PartWrapper){
- part = WorkbenchUtility.getE4WrappedPart(part);
- if (part instanceof IDirtyMarkable){
- StructuredSelection selection = new StructuredSelection(object);
- ((IDirtyMarkable)part).changed(selection.getFirstElement());
- }
- }
-
-
- super.changed(object);
- }
-
- /** {@inheritDoc} */
- @Override
- public Viewer getViewer() {
- return viewer;
- }
-
- @Override
- public boolean onComplete() {
- return false;
- }
-
- public void toggleShowOnlyIndividualAssociations(){
- provider.toggleShowOnlyIndividualAssociations();
- viewer.refresh();
- }
-
-
-
-}
+++ /dev/null
-/**
- * Copyright (C) 2007 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.editor.view.descriptive.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-
-/**
- * <p>CreateDescriptionElementHandler class.</p>
- *
- * @author n.hoffmann
- * @created 16.04.2009
- * @version 1.0
- */
-public class CreateDescriptionElementHandler extends AbstractHandler {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
- * ExecutionEvent)
- */
- /** {@inheritDoc} */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchPart part = HandlerUtil.getActivePart(event);
- IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part
- : null;
-
-
- DescriptionBase<?> description = null;
-
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- Object selectedElement = null;
- if (selection instanceof ITreeSelection) {
- TreePath[] paths = ((ITreeSelection) selection).getPaths();
- selectedElement = paths[0].getFirstSegment();
- }
- else if (selection instanceof IStructuredSelection) {
- selectedElement = ((IStructuredSelection) selection).getFirstElement();
- }
- if (selectedElement instanceof DescriptionBase<?>) {
- description = (DescriptionBase<?>) selectedElement;
- }
-
- if (description != null) {
- AbstractPostOperation operation = null;
- try {
- // TODO use undo context specific to editor
- operation = operationCreationInstance(event.getCommand().getName(), event, description, postOperationEnabled);
- } catch (NotDefinedException e) {
- MessagingUtils.warn(getClass(), "Command name not set"); //$NON-NLS-1$
- }
- } else {
- MessagingUtils.error(getClass(), new IllegalArgumentException("Could not determine the taxon description")); //$NON-NLS-1$
- return null;
- }
- return null;
-
- }
-
- /**
- * Added to make the Class more generic and limit the amount of code changes required
- * @param label
- * @param event
- * @param taxon
- * @param description
- * @param postOperationEnabled
- * @return
- */
- protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {
- Feature feature = (Feature) ((Event) event.getTrigger()).data;
- return new CreateDescriptionElementOperation(label, EditorUtil.getUndoContext(), description, feature, postOperationEnabled);
- }
-
-}
+++ /dev/null
-/**
-* Copyright (C) 2011 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.editor.view.descriptive.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateSpecimenDescriptionOperation;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-
-/**
- * <p>AddDescriptionHandler class.</p>
- *
- * @author p.ciardelli
- * @created 11.08.2009
- * @version 1.0
- */
-public class CreateDescriptionHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- /** {@inheritDoc} */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchPart part = HandlerUtil.getActivePart(event);
- IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
-
- AbstractPostOperation<?> operation;
- if(part instanceof DescriptiveViewPart){
-
- Object viewerInput = ((DescriptiveViewPart)part).getViewer().getInput();
- if(viewerInput instanceof SpecimenOrObservationBase<?>){
- try {
- operation = new CreateSpecimenDescriptionOperation(event.getCommand().getName(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, postOperationEnabled);
- } catch (NotDefinedException e) {
- MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$
- }
- }
- if(viewerInput instanceof TaxonBase){
- try{
- operation = createTaxonOperation(event.getCommand().getName(), (Taxon) viewerInput, postOperationEnabled);
- } catch (NotDefinedException e) {
- MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$
- }
-
- }
- }
- return null;
- }
-
- /** {@inheritDoc} */
- protected CreateTaxonDescriptionOperation createTaxonOperation(String eventLabel, Taxon taxon, IPostOperationEnabled postOperationEnabled) {
- return new CreateTaxonDescriptionOperation(eventLabel, EditorUtil.getUndoContext(), taxon, postOperationEnabled);
- }
-
-}
+++ /dev/null
-/**
- * Copyright (C) 2011 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.editor.view.uses;
-
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementTransfer;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
-
-
-/**
- * The Class create a specific Use View to keep the taxonomic view clean
- * @author a.theys
- * @created mar 13, 2012
- * @version 1.0
- */
-public class UsesViewPart extends DescriptiveViewPart {
-
- public UsesViewPart() {
- super();
- }
-
- /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.uses"</code> */
- public static final String ID = "eu.etaxonomy.taxeditor.editor.view.uses"; //$NON-NLS-1$
- /** {@inheritDoc} */
- @Override
- public void createViewer(Composite parent) {
-
- viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL
- | SWT.V_SCROLL | SWT.FULL_SELECTION));
- viewer.setContentProvider(new UsesContentProvider(featureNodeContainerCache));
- viewer.setLabelProvider(new UsesLabelProvider());
- viewer.setAutoExpandLevel(2);
-
-
-
- Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() };
-// viewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(
-// this));
-// viewer.addDropSupport(dndOperations, transfers,
-// new DescriptionElementDropAdapter(viewer));
-
- // Propagate selection from viewer
- getSite().setSelectionProvider(viewer);
-
- showAllElementsAction = new ToggleDescriptionAction(false);
- hideAllElementsAction = new ToggleDescriptionAction(true);
-
- // Add context menu to tree
- createMenu();
-
- createToolbar();
-
- }
-
- @Override
- protected String getViewName(){
- return Messages.UsesViewPart_VIEWER_NAME;
- }
-
- /** {@inheritDoc} */
- @Override
- public boolean postOperation(CdmBase objectAffectedByOperation) {
- viewer.refresh();
- return super.postOperation(objectAffectedByOperation);
- }
-
-
-
-}
+++ /dev/null
-/**\r
-* Copyright (C) 2011 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.view.uses.handler;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
-import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionHandler;\r
-import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;\r
-import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateTaxonUseOperation;\r
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
-\r
-/**\r
- * CreateUseHandler Class\r
- * @author a.theys\r
- * @created mar 13, 2012\r
- * @version 1.0\r
- */\r
-public class CreateUseHandler extends CreateDescriptionHandler {\r
-\r
-\r
- /** {@inheritDoc} */\r
- @Override\r
- protected CreateTaxonDescriptionOperation createTaxonOperation(String eventLabel, Taxon taxon, IPostOperationEnabled postOperationEnabled) {\r
- return new CreateTaxonUseOperation(eventLabel, EditorUtil.getUndoContext(), taxon, postOperationEnabled);\r
- }\r
-}\r
+++ /dev/null
-/**
- * Copyright (C) 2011 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.editor.view.uses.handler;
-
-import org.eclipse.core.commands.ExecutionEvent;
-
-import eu.etaxonomy.cdm.api.service.ITermService;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;
-import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseRecordOperation;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.UsageTermCollection;
-import eu.etaxonomy.taxeditor.store.UseObjectStore;
-
-/**
- * CreateUseRecordHandler Class
- * @author a.theys
- * @created mar 13, 2012
- * @version 1.0
- */
-public class CreateUseRecordHandler extends CreateDescriptionElementHandler {
- /** {@inheritDoc} */
- @Override
- protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {
- //Use Record Feature retrieval below
- Feature feature = UseObjectStore.getUseRecordFeature();
- feature.setSupportsCategoricalData(true);
- return new CreateUseRecordOperation(label,
- EditorUtil.getUndoContext(),
- description, feature, postOperationEnabled);
- }
-
-
-
-}
+++ /dev/null
-/**\r
-* Copyright (C) 2011 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.view.uses.handler;\r
-\r
-\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-\r
-import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
-import eu.etaxonomy.cdm.model.description.Feature;\r
-import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
-import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;\r
-import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseSummaryOperation;\r
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
-import eu.etaxonomy.taxeditor.store.UseObjectStore;\r
-\r
-/**\r
- * CreateUseSummaryHandler Class\r
- * @author a.theys\r
- * @created mar 13, 2012\r
- * @version 1.0\r
- */\r
-public class CreateUseSummaryHandler extends CreateDescriptionElementHandler {\r
- /** {@inheritDoc} */\r
- @Override\r
- protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {\r
- //Use Record Feature retrieval below\r
- Feature feature = UseObjectStore.getUseSummaryFeature();\r
- \r
- feature.setSupportsTextData(true);\r
- return new CreateUseSummaryOperation(label, EditorUtil.getUndoContext(), description, feature, postOperationEnabled);\r
- }\r
-\r
-}\r