--- /dev/null
+CreateDerivateContextMenu_ADD=Add...
+CreateDerivateContextMenu_DNA_SAMPLE=DNA Sample
+CreateDerivateContextMenu_MEDIA=Media...
+CreateDerivateContextMenu_MEDIA_EXISTING=Media Specimen with existing media
+CreateDerivateContextMenu_MEDIA_SPECIMEN=Media Specimen
+CreateDerivateContextMenu_NO_CHILD_DERIVATE=No child derivatives
+CreateDerivateContextMenu_SEQUENCE=Consensus Sequence
+CreateDerivateContextMenu_SINGLE_READ=Single Read
+CreateDerivateContextMenu_SPECIMEN=Specimen
+CreateDerivateContextMenu_TISSUE_SAMPLE=Tissue Sample
+
+SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Remove from this Sequence
+SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Reuse for other Sequence
+SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE=Reuse SingleRead here
+
+DerivateView_DERIVATIVE_EDITOR=Derivative Editor
+DerivateView_SAVING_HIERARCHY=Saving hierarchy
+DerivateView_UNSAVED_CHANGES=View has unsaved changes
+DerivateView_YOU_NEED_TO_SAVE=You need to save before performing this action
+
+DeleteDerivateOperation_AND_CHILDREN= and its children
+DeleteDerivateOperation_CONFIRM=Confirm Deletion
+DeleteDerivateOperation_DELETE_FAILED=Deletion failed
+DeleteDerivateOperation_REALLY_DELETE=Do you really want to delete the selected element
+
+DerivateDropListener_MOVE_TO=Moving "%s" to "%s"
+
+DerivateViewEditorInput_FAIL_INIT=Failed initializing editor
+DerivateViewEditorInput_NO_ROOT=No root element found\!
+
+MoveDerivateOperation_MOVE_NOT_POSSIBLE=Moving derivatives not possible\!
+MoveDerivateOperation_MOVE_TO_NOT_POSSIBLE=Moving "%s" to "%s" is not possible\!
+
+OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR=Could not open Derivative Editor
+OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN=Failed to open Editor
+OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED=The derivative hierarchy is corrupted\!
+OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=No Derivatives found
--- /dev/null
+CreateDerivateContextMenu_ADD=Hinzufügen...
+CreateDerivateContextMenu_DNA_SAMPLE=DNA Sample
+CreateDerivateContextMenu_MEDIA=Media...
+CreateDerivateContextMenu_MEDIA_EXISTING=Media Specimen mit vorhandender Mediadatei
+CreateDerivateContextMenu_MEDIA_SPECIMEN=Media Specimen
+CreateDerivateContextMenu_NO_CHILD_DERIVATE=Keine Kind-Derivate
+CreateDerivateContextMenu_SEQUENCE=Konsensussequenz
+CreateDerivateContextMenu_SINGLE_READ=Single Read
+CreateDerivateContextMenu_SPECIMEN=Beleg
+CreateDerivateContextMenu_TISSUE_SAMPLE=Gewebeprobe
+
+SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Von Sequenz entfernen
+SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Für andere Sequenz verwenden
+SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE=SingleRead hier verwenden
+
+DerivateView_DERIVATIVE_EDITOR=Derivat-Editor
+DerivateView_SAVING_HIERARCHY=Speichere Hierarchie
+DerivateView_UNSAVED_CHANGES=Ungepeicherte Änderungen
+DerivateView_YOU_NEED_TO_SAVE=Sie müssen speichern, um diese Aktion auszuführen
+
+DeleteDerivateOperation_CONFIRM=Löschen bestätigen
+DeleteDerivateOperation_DELETE_FAILED=Löschen fehlgeschlagen
+DeleteDerivateOperation_REALLY_DELETE=Wollen Sie wirklich das ausgewählte Element löschen
+DeleteDerivateOperation_AND_CHILDREN= (mit Kind-Elementen)
+
+DerivateDropListener_MOVE_TO=Verschiebe "%s" nach "%s"
+
+DerivateViewEditorInput_FAIL_INIT=Initialisierung des Editor fehlgeschlagen
+DerivateViewEditorInput_NO_ROOT=Kein Root-Element gefunden\!
+
+MoveDerivateOperation_MOVE_NOT_POSSIBLE=Verschieben von Derivaten nicht möglich\!
+MoveDerivateOperation_MOVE_TO_NOT_POSSIBLE=Verschieben von "%s" nach "%s" nicht möglich\!
+
+OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR=Konnte Derivat-Editor nicht öffnen
+OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN=Öffnen des Editors fehlgeschlagen
+OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED=Die Derivathierarchie ist korrumpiert\!
+OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=Keine Derivate gefunden
--- /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.editor;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author pplitzner
+ * @date 09.09.2015
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$
+ public static String CreateDerivateContextMenu_ADD;
+ public static String CreateDerivateContextMenu_DNA_SAMPLE;
+ public static String CreateDerivateContextMenu_MEDIA;
+ public static String CreateDerivateContextMenu_MEDIA_EXISTING;
+ public static String CreateDerivateContextMenu_MEDIA_SPECIMEN;
+ public static String CreateDerivateContextMenu_NO_CHILD_DERIVATE;
+ public static String CreateDerivateContextMenu_SEQUENCE;
+ public static String CreateDerivateContextMenu_SINGLE_READ;
+ public static String CreateDerivateContextMenu_SPECIMEN;
+ public static String CreateDerivateContextMenu_TISSUE_SAMPLE;
+ public static String DeleteDerivateOperation_AND_CHILDREN;
+ public static String DeleteDerivateOperation_CONFIRM;
+ public static String DeleteDerivateOperation_DELETE_FAILED;
+ public static String DeleteDerivateOperation_REALLY_DELETE;
+ public static String DerivateDropListener_MOVE_TO;
+ public static String DerivateView_DERIVATIVE_EDITOR;
+ public static String DerivateView_SAVING_HIERARCHY;
+ public static String DerivateView_UNSAVED_CHANGES;
+ public static String DerivateView_YOU_NEED_TO_SAVE;
+ public static String DerivateViewEditorInput_FAIL_INIT;
+ public static String DerivateViewEditorInput_NO_ROOT;
+ public static String MoveDerivateOperation_MOVE_NOT_POSSIBLE;
+ public static String MoveDerivateOperation_MOVE_TO_NOT_POSSIBLE;
+ public static String OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR;
+ public static String OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN;
+ public static String OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED;
+ public static String OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND;
+ public static String SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE;
+ public static String SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE;
+ public static String SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
public UpdateResult changeRelatedTaxonToSynonym(UUID arg0, UUID arg1, TaxonRelationshipType arg2,
SynonymRelationshipType arg3) throws DataChangeNoRollbackException {
return defaultService.changeRelatedTaxonToSynonym(arg0, arg1, arg2, arg3);
+
}
/* (non-Javadoc)
this.derivateView = derivateView;
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.dnd.DragSourceAdapter#dragSetData(org.eclipse.swt.dnd.DragSourceEvent)
- */
@Override
public void dragSetData(DragSourceEvent event) {
if (LocalSelectionTransfer.getTransfer().isSupportedType(event.dataType)) {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.dnd.DragSourceAdapter#dragStart(org.eclipse.swt.dnd.DragSourceEvent)
- */
@Override
public void dragStart(DragSourceEvent event) {
if(derivateView.isDirty()){
event.doit = false;
- MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
return;
}
ISelection selection = derivateView.getViewer().getSelection();
import org.eclipse.swt.dnd.TransferData;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.editor.view.derivate.operation.MoveDerivateOperation;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
this.derivateView = derivateView;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
- */
@Override
public boolean performDrop(Object data) {
if(derivateView.isDirty()){
- MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
return false;
}
Object target = getCurrentTarget();
TreeNode targetNode = (TreeNode) target;
TreeNode draggedNode = EditorUtil.getTreeNodeOfSelection(derivateViewSelection.getSelection());
if(draggedNode!=null){
- MoveDerivateOperation moveDerivateOperation = new MoveDerivateOperation("Moving \""+derivateView.getLabelProvider().getDerivateText(draggedNode)+"\" to \""+derivateView.getLabelProvider().getDerivateText(targetNode)+"\"", EditorUtil.getUndoContext(), derivateView, draggedNode, targetNode);
+ MoveDerivateOperation moveDerivateOperation = new MoveDerivateOperation(String.format(Messages.DerivateDropListener_MOVE_TO, derivateView.getLabelProvider().getDerivateText(draggedNode), derivateView.getLabelProvider().getDerivateText(targetNode)), EditorUtil.getUndoContext(), derivateView, draggedNode, targetNode);
return AbstractUtility.executeOperation(moveDerivateOperation).equals(Status.OK_STATUS)?true:false;
}
}
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
- */
@Override
public boolean validateDrop(Object target, int operation, TransferData transferType) {
return LocalSelectionTransfer.getTransfer().isSupportedType(transferType) && target instanceof TreeNode;
import eu.etaxonomy.cdm.model.molecular.SingleRead;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia,
ISelectionChangedListener, IPostOperationEnabled , ICdmEntitySessionEnabled {
- public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView";
+ public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"; //$NON-NLS-1$
+
+ public static final String YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION = Messages.DerivateView_YOU_NEED_TO_SAVE;
+ public static final String VIEW_HAS_UNSAVED_CHANGES = Messages.DerivateView_UNSAVED_CHANGES;
private ConversationHolder conversation;
@Override
public void doSave(IProgressMonitor monitor) {
- String taskName = "Saving hierarchy";
+ String taskName = Messages.DerivateView_SAVING_HIERARCHY;
if(getEditorInput() instanceof DerivateViewEditorInput){
DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
- taskName += " "+derivateViewEditorInput.getName();
+ taskName += " "+derivateViewEditorInput.getName(); //$NON-NLS-1$
}
monitor.beginTask(taskName, 3);
if (!conversation.isBound()) {
DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
return derivateViewEditorInput.getName();
}
- return "Derivative Editor";
+ return Messages.DerivateView_DERIVATIVE_EDITOR;
}
@Override
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
rootUUIDs = derivateUUIDs;
}
if(rootUUIDs.isEmpty()){
- MessagingUtils.messageDialog("Failed initializing editor", DerivateViewEditorInput.class, "No root element found!");
+ MessagingUtils.messageDialog(Messages.DerivateViewEditorInput_FAIL_INIT, DerivateViewEditorInput.class, Messages.DerivateViewEditorInput_NO_ROOT);
}
}
name = DerivateLabelProvider.getDerivateText(specimen, conversationHolder);
}
else{
- name += " + "+DerivateLabelProvider.getDerivateText(specimen, conversationHolder);
+ name += " + "+DerivateLabelProvider.getDerivateText(specimen, conversationHolder); //$NON-NLS-1$
}
}
}
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
*/
public class CreateDerivateContextMenu extends CompoundContributionItem {
+ private static final String SINGLE_READ = Messages.CreateDerivateContextMenu_SINGLE_READ;
+ private static final String CONSENSUS_SEQUENCE = Messages.CreateDerivateContextMenu_SEQUENCE;
+ private static final String MEDIA_SPECIMEN = Messages.CreateDerivateContextMenu_MEDIA_SPECIMEN;
+ private static final String DNA_SAMPLE = Messages.CreateDerivateContextMenu_DNA_SAMPLE;
+ private static final String TISSUE_SAMPLE = Messages.CreateDerivateContextMenu_TISSUE_SAMPLE;
+ private static final String SPECIMEN = Messages.CreateDerivateContextMenu_SPECIMEN;
+
@Override
protected IContributionItem[] getContributionItems() {
IContributionItem[] contributionItems = new IContributionItem[] {
@Override
public void fill(Menu menu, int index) {
MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
- addItem.setText("Add...");
+ addItem.setText(Messages.CreateDerivateContextMenu_ADD);
Menu addMenu = new Menu(menu);
addItem.setMenu(addMenu);
final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if(selectedTreeNode!=null){
//context menu for FieldUnit
if(selectedTreeNode.getValue() instanceof FieldUnit){
- createMenuItem(addMenu, "Specimen", selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen, DerivationEventType.GATHERING_IN_SITU());
+ createMenuItem(addMenu, SPECIMEN, selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen, DerivationEventType.GATHERING_IN_SITU());
new MenuItem(addMenu, SWT.SEPARATOR);
- createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
- createMenuItem(addMenu, "DNA Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
- createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+ createMenuItem(addMenu, TISSUE_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
+ createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+ createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
}
//context menu for Specimen
else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
- createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
- createMenuItem(addMenu, "DNA Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
- createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+ createMenuItem(addMenu, TISSUE_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
+ createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+ createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
}
//context menu for TissueSample
else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.TissueSample){
- createMenuItem(addMenu, "DnaSample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
- createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+ createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
+ createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
}
//context menu for DnaSample
else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.DnaSample){
- createMenuItem(addMenu, "Consensus Sequence", selectedTreeNode, Sequence.class, null, null);
- createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
+ createMenuItem(addMenu, CONSENSUS_SEQUENCE, selectedTreeNode, Sequence.class, null, null);
+ createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media, DerivationEventType.ACCESSIONING());
}
//context menu for Sequence
else if(selectedTreeNode.getValue() instanceof Sequence){
- createMenuItem(addMenu, "Single Read", selectedTreeNode, SingleRead.class, null, null);
+ createMenuItem(addMenu, SINGLE_READ, selectedTreeNode, SingleRead.class, null, null);
}
//default
else{
MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
- menuItem.setText("No child derivates");
+ menuItem.setText(Messages.CreateDerivateContextMenu_NO_CHILD_DERIVATE);
menuItem.setEnabled(false);
}
}
if(specimenType!=null && specimenType.equals(SpecimenOrObservationType.Media)){
//media submenu
MenuItem mediaItem = new MenuItem(menu, SWT.CASCADE);
- mediaItem.setText("Media...");
+ mediaItem.setText(Messages.CreateDerivateContextMenu_MEDIA);
Menu mediaMenu = new Menu(menu);
mediaItem.setMenu(mediaMenu);
//existing media menu
MenuItem existingMediaItem = new MenuItem(mediaMenu, SWT.NONE);
- existingMediaItem.setText("Media Specimen with existing media");
+ existingMediaItem.setText(Messages.CreateDerivateContextMenu_MEDIA_EXISTING);
existingMediaItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if(derivateView!=null){
if(derivateView.isDirty()){
e.doit = false;
- MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
return;
}
}
if(selectedDerivate instanceof DnaSample && ((DnaSample) selectedDerivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
DnaSample dnaSample = (DnaSample)selectedDerivate;
if(childClass.equals(Sequence.class)){
- Sequence newInstance = Sequence.NewInstance(dnaSample, "", 0);
+ Sequence newInstance = Sequence.NewInstance(dnaSample, "", 0); //$NON-NLS-1$
createdElement = newInstance;
}
CdmStore.getService(IOccurrenceService.class).merge((SpecimenOrObservationBase) selectedDerivate);
import eu.etaxonomy.cdm.model.molecular.Sequence;
import eu.etaxonomy.cdm.model.molecular.SingleRead;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
ADD_TO_SEQUENCE
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
- */
@Override
protected IContributionItem[] getContributionItems() {
IContributionItem[] contributionItems = new IContributionItem[] {
if(selectedTreeNode.getValue() instanceof Sequence
&& clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead){
MenuItem item = new MenuItem(menu, SWT.NONE);
- item.setText("Reuse SingleRead here");
+ item.setText(Messages.SingleReadSequenceContextMenu_REUSE_SINGLE_READ_HERE);
item.addSelectionListener(new WidgetSelectionListener(CommandType.ADD_TO_SEQUENCE));
}
else if(selectedTreeNode.getValue() instanceof SingleRead){
MenuItem item = new MenuItem(menu, SWT.NONE);
- item.setText("Reuse for other Sequence");
+ item.setText(Messages.SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE);
item.addSelectionListener(new WidgetSelectionListener(CommandType.COPY_TO_CLIPBOARD));
if(activeEditor instanceof DerivateView
&& ((DerivateView) activeEditor).getMultiLinkSingleReads().contains(selectedTreeNode.getValue())){
MenuItem unlinkItem = new MenuItem(menu, SWT.NONE);
- unlinkItem.setText("Remove from this Sequence");
+ unlinkItem.setText(Messages.SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE);
unlinkItem.addSelectionListener(new WidgetSelectionListener(CommandType.REMOVE_FROM_SEQUENCE));
}
}
this.commandType = commandType;
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
@Override
public void widgetSelected(SelectionEvent e) {
IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
switch (commandType) {
case REMOVE_FROM_SEQUENCE:
if(activeEditor.isDirty()){
- MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
return;
}
if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
break;
case ADD_TO_SEQUENCE:
if(activeEditor.isDirty()){
- MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
return;
}
if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
if(AbstractUtility.getActivePart() instanceof DerivateView){
DerivateView derivateView = (DerivateView)AbstractUtility.getActivePart();
if(derivateView.isDirty()){
- MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
return null;
}
FieldUnit fieldUnit = FieldUnit.NewInstance();
*/
public class DeleteDerivateHandler 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 {
if(value instanceof SpecimenOrObservationBase<?> || value instanceof Sequence || value instanceof SingleRead){
if(postOperationEnabled instanceof IConversationEnabled){
ConversationHolder conversationHolder = ((IConversationEnabled) postOperationEnabled).getConversationHolder();
- label += " "+DerivateLabelProvider.getDerivateText(value, conversationHolder);
+ label += " "+DerivateLabelProvider.getDerivateText(value, conversationHolder); //$NON-NLS-1$
}
SpecimenDeleteConfigurator config = new SpecimenDeleteConfigurator();
- boolean deepDelete = event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivate.deepDelete");
+ boolean deepDelete = event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivate.deepDelete"); //$NON-NLS-1$
config.setDeleteChildren(deepDelete);
config.setDeleteMolecularData(deepDelete);
DeleteDerivateOperation deleteDerivateOperation = new DeleteDerivateOperation(label, undoContext, (CdmBase) value, (TreeNode) object, postOperationEnabled, config);
}
} catch (NotDefinedException e) {
- MessagingUtils.warn(getClass(), "Command name not set.");
+ MessagingUtils.warn(getClass(), "Command name not set");
}
return null;
}
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler;
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
*/
public class OpenDerivateEditorForTaxonHandler extends AbstractHandler {
+ private static final String COULD_NOT_OPEN_DERIVATIVE_EDITOR = Messages.OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR;
+
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
}
}
if(derivateUuids.isEmpty()){
- MessagingUtils.warningDialog("Could not open Derivative Editor", this, "No Derivatives found");
+ MessagingUtils.warningDialog(COULD_NOT_OPEN_DERIVATIVE_EDITOR, this, Messages.OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND);
return null;
}
DerivateViewEditorInput input = new DerivateViewEditorInput(derivateUuids);
try {
EditorUtil.open(input);
} catch (PartInitException e) {
- MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivative Editor", e);
+ MessagingUtils.error(OpenDerivateViewHandler.class, COULD_NOT_OPEN_DERIVATIVE_EDITOR, e);
} catch (NullPointerException npe){
- MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivative Editor. The derivative hierarchy is corrupted!", npe);
+ MessagingUtils.messageDialog(Messages.OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN, OpenDerivateViewHandler.class, Messages.OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED, npe);
}
}
return null;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.molecular.Sequence;
import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
if(getPostOperationEnabled() instanceof ISaveablePart){
- String confirmationQuestion = "Do you really want to delete the selected element";
+ String confirmationQuestion = Messages.DeleteDerivateOperation_REALLY_DELETE;
if(deleteConfigurator.isDeleteChildren()){
- confirmationQuestion += " and its children";
+ confirmationQuestion += Messages.DeleteDerivateOperation_AND_CHILDREN;
}
- confirmationQuestion += "?";
- if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(deleteConfigurator, null, "Confirm Deletion", confirmationQuestion)){
+ confirmationQuestion += "?"; //$NON-NLS-1$
+ if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(deleteConfigurator, null, Messages.DeleteDerivateOperation_CONFIRM, confirmationQuestion)){
return Status.CANCEL_STATUS;
}
if(((ISaveablePart) getPostOperationEnabled()).isDirty()){
- MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
return Status.CANCEL_STATUS;
}
}
}
}
else{
- MessagingUtils.warningDialog("Deletion failed", this, deleteResult.toString());
+ MessagingUtils.warningDialog(Messages.DeleteDerivateOperation_DELETE_FAILED, this, deleteResult.toString());
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
this.targetNode = targetNode;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
DerivateView derivateView = null;
derivateView = (DerivateView) getPostOperationEnabled();
}
if(derivateView==null){
- MessagingUtils.operationDialog(this, new NullPointerException("Derivative Editor was null"), TaxeditorEditorPlugin.PLUGIN_ID, this.getLabel(), getLabel());
+ MessagingUtils.operationDialog(this, new NullPointerException("Derivative Editor was null"), TaxeditorEditorPlugin.PLUGIN_ID, this.getLabel(), getLabel()); //$NON-NLS-1$
return Status.CANCEL_STATUS;
}
if(derivateView.isDirty()){
- MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+ MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
return Status.CANCEL_STATUS;
}
return postExecute(null);
}
else{
- MessagingUtils.warningDialog("Moving derivatives not possible!", derivateView, "Moving \""+derivateView.getLabelProvider().getDerivateText(draggedNode)+"\" to \""+derivateView.getLabelProvider().getDerivateText(targetNode)+"\" is not possible!");
+ MessagingUtils.warningDialog(Messages.MoveDerivateOperation_MOVE_NOT_POSSIBLE, derivateView, String.format(Messages.MoveDerivateOperation_MOVE_TO_NOT_POSSIBLE, derivateView.getLabelProvider().getDerivateText(draggedNode), derivateView.getLabelProvider().getDerivateText(targetNode)));
}
return Status.CANCEL_STATUS;
}
return false;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
//swap fromNode and targetNode
return execute(new NullProgressMonitor(), null);
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
//swap fromNode and targetNode
import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
/**
- * <p>MediaViewPart class.</p>
- *
* @author n.hoffmann
* @created Jun 15, 2010
* @version 1.0
*/
public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData {
- /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.medi"{trunked}</code> */
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.media";
private TreeViewer viewer;
- /*
- * (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
- */
/** {@inheritDoc} */
@Override
public void createViewer(Composite parent) {
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getInitialSelection()
- */
/** {@inheritDoc} */
@Override
protected ISelection getInitialSelection() {
if(part instanceof MultiPageTaxonEditor){
IEditorInput input = ((IEditorPart) part).getEditorInput();
showViewer(part, new StructuredSelection(input));
+ return;
}
else if(selection instanceof IStructuredSelection){
Object firstElement = ((IStructuredSelection) selection).getFirstElement();
if(firstElement instanceof TreeNode){
showViewer(part, new StructuredSelection(((TreeNode) firstElement).getValue()));
+ return;
}
- else{
+ else if(firstElement!=null){
showViewer(part, (IStructuredSelection) selection);
+ return;
}
- }else{
- showEmptyPage();
}
}
- else{
- showEmptyPage();
- }
+ showEmptyPage();
}
/** {@inheritDoc} */
return viewer;
}
- /**
- * <p>onComplete</p>
- *
- * @return a boolean.
- */
@Override
public boolean onComplete() {
return true;
OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required.\r
OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator.\r
UriWithLabelElement_URL_NOT_SAVED=URL won't be saved\! \r
-UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URL is invalid.\r
-UriWithLabelElement_INVALID_URL=Invalid URL\r
+UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid.\r
+UriWithLabelElement_INVALID_URL=Invalid URI\r
UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Open in external browser\r
LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich.
OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich.
UriWithLabelElement_URL_NOT_SAVED=URL wird nicht gespeichert\!
-UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnt nicht geöffnet werden. URL is ung\u00FCtlig.
-UriWithLabelElement_INVALID_URL=Ung\u00FCltiger URL
+UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnte nicht geöffnet werden. URI ist ung\u00FCtlig.
+UriWithLabelElement_INVALID_URL=Ung\u00FCltige URI
UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser öffnen
\ No newline at end of file
public List<TaxonNameBase> findNames(IIdentifiableEntityServiceConfigurator configurator){
if(checkLargeResult(CdmStore.getService(INameService.class).countByTitle(configurator))){
List<TaxonNameBase> records = CdmStore.getService(INameService.class).findByTitle(configurator).getRecords();
- TaxonNameBase uuidSearchResult = addUuidSearchResults(configurator, INameService.class);
- if(uuidSearchResult!=null){
- records.add(uuidSearchResult);
- }
+ addUuidSearchResults(records, configurator, INameService.class);
return records;
}
return NO_RESULTS;
public List<Reference> findReferences(IIdentifiableEntityServiceConfigurator configurator){
if(checkLargeResult(CdmStore.getService(IReferenceService.class).countByTitle(configurator))){
List<Reference> records = CdmStore.getService(IReferenceService.class).findByTitle(configurator).getRecords();
- Reference uuidSearchResult = addUuidSearchResults(configurator, IReferenceService.class);
- if(uuidSearchResult!=null){
- records.add(uuidSearchResult);
- }
+ addUuidSearchResults(records, configurator, IReferenceService.class);
return records;
}
return NO_RESULTS;
public List<AgentBase> findAgents(IIdentifiableEntityServiceConfigurator configurator){
if(checkLargeResult(CdmStore.getService(IAgentService.class).countByTitle(configurator))){
List<AgentBase> records = CdmStore.getService(IAgentService.class).findByTitle(configurator).getRecords();
- AgentBase uuidSearchResult = addUuidSearchResults(configurator, IAgentService.class);
- if(uuidSearchResult!=null){
- records.add(uuidSearchResult);
- }
+ addUuidSearchResults(records, configurator, IAgentService.class);
return records;
}
return NO_RESULTS;
/**
* Check search string if it is a {@link UUID} and, if <code>true</code>, search for the corresponding entity.
+ * @param records the list to which the search results are added
* @param configurator the configurator holding the search string
* @param service the service to use for searching
*/
- private <T extends ICdmBase> T addUuidSearchResults(IIdentifiableEntityServiceConfigurator configurator, Class<? extends IService<T>> service) {
+ private <T extends ICdmBase> void addUuidSearchResults(List<T> records, IIdentifiableEntityServiceConfigurator configurator, Class<? extends IService<T>> service) {
String titleSearchString = configurator.getTitleSearchString();
try {
UUID uuid = UUID.fromString(titleSearchString);
- return CdmStore.getService(service).find(uuid);
+ T foundRecord = CdmStore.getService(service).find(uuid);
+ if(foundRecord!=null){
+ records.add(foundRecord);
+ }
} catch (IllegalArgumentException e) {
//search string was no UUID
}
- return null;
}
@SuppressWarnings("unchecked")
else if(checkLargeResult(CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator))){
records = CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords();
}
- SpecimenOrObservationBase uuidSearchResult = addUuidSearchResults(configurator, IOccurrenceService.class);
- if(uuidSearchResult!=null){
- records.add(uuidSearchResult);
- }
+ addUuidSearchResults(records, configurator, IOccurrenceService.class);
return records;
}
String userNameSearchString = sqlizeTitleSearchString(configurator);
// TODO why are users not identifiable entities?
List<User> records = CdmStore.getService(IUserService.class).listByUsername(userNameSearchString, null, null, null, null, null, null);
- User uuidSearchResult = addUuidSearchResults(configurator, IUserService.class);
- if(uuidSearchResult!=null){
- records.add(uuidSearchResult);
- }
+ addUuidSearchResults(records, configurator, IUserService.class);
return records;
}
String groupNameSearchString = sqlizeTitleSearchString(configurator);
// TODO why are groups not identifiable entities?
List<Group> records = CdmStore.getService(IGroupService.class).listByName(groupNameSearchString, null, null, null, null, null, null);
- Group uuidSearchResult = addUuidSearchResults(configurator, IGroupService.class);
- if(uuidSearchResult!=null){
- records.add(uuidSearchResult);
- }
+ addUuidSearchResults(records, configurator, IGroupService.class);
return records;
}
public List findTaxa(IIdentifiableEntityServiceConfigurator configurator) {
if(checkLargeResult(CdmStore.getService(ITaxonService.class).countByTitle(configurator))){
List<TaxonBase> records = CdmStore.getService(ITaxonService.class).findByTitle(configurator).getRecords();
- TaxonBase uuidSearchResult = addUuidSearchResults(configurator, ITaxonService.class);
- if(uuidSearchResult!=null){
- records.add(uuidSearchResult);
- }
+ addUuidSearchResults(records, configurator, ITaxonService.class);
return records;
}
return NO_RESULTS;
} catch (Exception e) {
labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
- labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getMessage());
+ labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getLocalizedMessage());
return null;
}
}
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
- * <p>
- * DescriptionElementSourceElement class.
- * </p>
- *
+ *
* @author n.hoffmann
* @created Nov 16, 2009
* @version 1.0
- * @param <T>
*/
public class DescriptionElementSourceElement extends
AbstractOriginalSourceElement<DescriptionElementSource> implements
private EntitySelectionElement<TaxonNameBase> selection_name;
- /**
- * <p>
- * Constructor for DescriptionElementSourceElement.
- * </p>
- *
- * @param formElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- * @param element
- * a
- * {@link eu.etaxonomy.cdm.model.common.DescriptionElementSource}
- * object.
- * @param removeListener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style
- * a int.
- * @param cdmFormFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
- */
public DescriptionElementSourceElement(CdmFormFactory cdmFormFactory,
AbstractFormSection formElement, DescriptionElementSource element,
SelectionListener removeListener, int style) {
formFactory.createSelectionArbitrator(this);
}
- /*
- * (non-Javadoc)
- *
- * @see eu.etaxonomy.taxeditor.forms.entitysections.OriginalSourceComposite#
- * createControls(org.eclipse.swt.widgets.Composite, int)
- */
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement formElement, int style) {
null, EntitySelectionElement.ALL, SWT.NULL);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.forms.section.cdmdetail.AbstractOriginalSourceElement
- * #setElement(eu.etaxonomy.cdm.model.common.OriginalSourceBase)
- */
/** {@inheritDoc} */
@Override
public void setEntity(DescriptionElementSource entity) {
}
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
- * (java.lang.Object)
- */
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
- * <p>
- * NameTypeDesignationElement class.
- * </p>
*
* @author n.hoffmann
* @created May 17, 2010
private EntitySelectionElement<TaxonNameBase> selection_typeName;
private TermComboElement<NameTypeDesignationStatus> combo_typeStatus;
- /**
- * <p>
- * Constructor for NameTypeDesignationElement.
- * </p>
- *
- * @param formFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
- * @param section
- * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- * @param entity
- * a {@link eu.etaxonomy.cdm.model.name.NameTypeDesignation}
- * object.
- * @param removeListener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style
- * a int.
- */
public NameTypeDesignationElement(CdmFormFactory formFactory,
AbstractFormSection section, NameTypeDesignation entity,
SelectionListener removeListener, int style) {
} else if (eventSource == text_referenceDetail) {
getEntity().setCitationMicroReference(
text_referenceDetail.getText());
- } else if (eventSource == text_originaleNameString) {
- getEntity().setOriginalNameString(
- text_originaleNameString.getText());
}
}
}
import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractReferencedEntityElement;
/**
- * <p>NomenclaturalStatusElement class.</p>
- *
* @author n.hoffmann
* @created Nov 5, 2009
* @version 1.0
private final SelectionArbitrator selectionArbitrator;
- /**
- * <p>Constructor for NomenclaturalStatusElement.</p>
- *
- * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
- * @param element a {@link eu.etaxonomy.cdm.model.name.NomenclaturalStatus} object.
- * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style a int.
- * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- */
public NomenclaturalStatusElement(CdmFormFactory cdmFormFactory, AbstractFormSection formElement,
NomenclaturalStatus element, SelectionListener removeListener, int style) {
super(cdmFormFactory, formElement, element, removeListener, style);
selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#createControls(org.eclipse.swt.widgets.Composite, int)
- */
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
super.createControls(element, style);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#setElement(eu.etaxonomy.cdm.model.common.VersionableEntity)
- */
/** {@inheritDoc} */
@Override
public void setEntity(NomenclaturalStatus entity) {
return selectionArbitrator;
}
- /*
- * (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
- */
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
else if(eventSource == text_referenceDetail){
getEntity().setCitationMicroReference(text_referenceDetail.getText());
}
- else if(eventSource == text_originaleNameString){
- getEntity().setOriginalNameString(text_originaleNameString.getText());
- }
}
}
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
- * <p>
- * SpecimenTypeDesignationElement class.
- * </p>
- *
* @author n.hoffmann
* @created May 17, 2010
* @version 1.0
private EntitySelectionElement<DerivedUnit> selection_typeSpecimen;
private TextWithLabelElement text_specimenTypeText;
- /**
- * <p>
- * Constructor for SpecimenTypeDesignationElement.
- * </p>
- *
- * @param formFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
- * @param section
- * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- * @param entity
- * a {@link eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation}
- * object.
- * @param removeListener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style
- * a int.
- */
public SpecimenTypeDesignationElement(CdmFormFactory formFactory,
AbstractFormSection section, SpecimenTypeDesignation entity,
SelectionListener removeListener, int style) {
} else if (eventSource == text_referenceDetail) {
getEntity().setCitationMicroReference(
text_referenceDetail.getText());
- } else if (eventSource == text_originaleNameString) {
- getEntity().setOriginalNameString(
- text_originaleNameString.getText());
}
}
}
package eu.etaxonomy.taxeditor.ui.section.supplemental;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.common.OriginalSourceBase;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
/**
- * <p>Abstract AbstractOriginalSourceElement class.</p>
- *
* @author n.hoffmann
* @created Mar 16, 2010
* @version 1.0
protected EnumComboElement<OriginalSourceType> combo_origsourcetype;
protected TextWithLabelElement text_idInSource;
protected TextWithLabelElement text_idNamespace;
+ protected TextWithLabelElement text_originaleNameString;
- /**
- * <p>Constructor for AbstractOriginalSourceElement.</p>
- *
- * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- * @param section a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
- * @param element a T object.
- * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style a int.
- * @param <T> a T object.
- */
public AbstractOriginalSourceElement(CdmFormFactory formFactory,
AbstractFormSection section,
T element, SelectionListener removeListener,
super(formFactory, section, element, removeListener, style);
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void init() {
- super.init();
- setHasOriginalNameString(true);
+ public void setEntity(T entity) {
+ super.setEntity(entity);
+ text_originaleNameString.setText(entity.getOriginalNameString());
}
/** {@inheritDoc} */
super.createControls(formElement, style);
text_idInSource = formFactory.createTextWithLabelElement(formElement, "Id In Source", null, style);
text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", null, style);
+ text_originaleNameString = formFactory.createTextWithLabelElement(
+ formElement, "Original Name", null, SWT.NULL);
}
}
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * 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.
*/
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
- * <p>
- * Abstract AbstractReferencedEntityElement class.
- * </p>
- *
* @author n.hoffmann
* @created Mar 25, 2010
* @version 1.0
protected EntitySelectionElement<Reference> selection_reference;
protected TextWithLabelElement text_referenceDetail;
- protected TextWithLabelElement text_originaleNameString;
-
- private boolean hasOriginalNameString = false;
-
- /**
- * <p>
- * Constructor for AbstractReferencedEntityElement.
- * </p>
- *
- * @param formFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
- * @param section
- * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- * @param entity
- * a T object.
- * @param removeListener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style
- * a int.
- * @param <T>
- * a T object.
- */
public AbstractReferencedEntityElement(CdmFormFactory formFactory,
AbstractFormSection section, T entity,
SelectionListener removeListener, int style) {
super(formFactory, section, entity, removeListener, null, style);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.forms.section.AbstractEntityCollectionElement#
- * createControls(eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
- */
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement formElement, int style) {
null, EntitySelectionElement.ALL, style);
text_referenceDetail = formFactory.createTextWithLabelElement(
formElement, "Reference Detail", null, SWT.NULL);
- if (hasOriginalNameString)
- text_originaleNameString = formFactory.createTextWithLabelElement(
- formElement, "Original Name", null, SWT.NULL);
}
- /**
- * <p>
- * setEntity
- * </p>
- *
- * @param entity
- * a T object.
- */
@Override
public void setEntity(T entity) {
this.entity = entity;
selection_reference.setEntity(entity.getCitation());
text_referenceDetail.setText(entity.getCitationMicroReference());
- if (hasOriginalNameString)
- text_originaleNameString.setText(entity.getOriginalNameString());
- // // remove old listeners
- // clearEditButtonSelectionListener();
- //
- // addEditButtonSelectionListener(new
- // BulkEditorOpeningSelectionListener(entity.getCitation()));
- //
- };
-
- //
- // public void addEditButtonSelectionListener(SelectionListener listener){
- // selection_reference.addEditButtonSelectionListener(listener);
- // }
- //
- // public void removeEditButtonSelectionListener(SelectionListener
- // listener){
- // selection_reference.removeEditorButtonSelectionListener(listener);
- // }
- //
- // public void clearEditButtonSelectionListener(){
- // selection_reference.clearEditButtonSelectionListener();
- // }
-
- /**
- * <p>
- * Setter for the field <code>hasOriginalNameString</code>.
- * </p>
- *
- * @param hasOriginalNameString
- * a boolean.
- */
- public void setHasOriginalNameString(boolean hasOriginalNameString) {
- this.hasOriginalNameString = hasOriginalNameString;
}
- /**
- * <p>
- * hasOriginalNameString
- * </p>
- *
- * @return a boolean.
- */
- public boolean hasOriginalNameString() {
- return hasOriginalNameString;
- }
}
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.ui.section.supplemental;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
/**
- * <p>IdentifiableSourceElement class.</p>
- *
* @author n.hoffmann
* @created Nov 16, 2009
* @version 1.0
*/
public class IdentifiableSourceElement extends AbstractOriginalSourceElement<IdentifiableSource>{
-
- /**
- * <p>Constructor for IdentifiableSourceElement.</p>
- *
- * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
- * @param element a {@link eu.etaxonomy.cdm.model.common.IdentifiableSource} object.
- * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style a int.
- * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- */
+
public IdentifiableSourceElement(CdmFormFactory cdmFormFactory, AbstractFormSection formElement, IdentifiableSource element,
SelectionListener removeListener, int style) {
super(cdmFormFactory, formElement, element, removeListener, style);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#createControls(org.eclipse.swt.widgets.Composite, int)
- */
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement formElement, int style) {
super.createControls(formElement, style);
}
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#setElement(eu.etaxonomy.cdm.model.common.VersionableEntity)
- */
/** {@inheritDoc} */
@Override
public void setEntity(IdentifiableSource entity) {
selection_reference.setEntity(entity.getCitation());
text_referenceDetail.setText(entity.getCitationMicroReference());
combo_origsourcetype.setSelection(entity.getType());
- if(hasOriginalNameString()) text_originaleNameString.setText(entity.getOriginalNameString());
- }
-
+ text_originaleNameString.setText(entity.getOriginalNameString());
+ }
+
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {