Revision b5fcddad
Added by Andreas Müller almost 3 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java | ||
---|---|---|
176 | 176 |
@Optional |
177 | 177 |
@Inject |
178 | 178 |
private void updateAfterSearch(@UIEventTopic(WorkbenchEventConstants.BULK_EDITOR_SEARCH_FINISHED)IStructuredSelection selection){ |
179 |
|
|
180 |
|
|
181 | 179 |
if(selection!=null){ |
182 | 180 |
setSelection(selection); |
183 | 181 |
} |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/e4/ReferencingObjectsViewE4.java | ||
---|---|---|
229 | 229 |
} |
230 | 230 |
if (actualMonitor != null){ |
231 | 231 |
actualMonitor.setCanceled(true); |
232 |
|
|
233 | 232 |
} |
234 | 233 |
actualMonitor = monitor; |
235 | 234 |
if (entityUUID != null){ |
... | ... | |
271 | 270 |
return Status.CANCEL_STATUS; |
272 | 271 |
} |
273 | 272 |
|
274 |
//not necessary anymore, we sort by type and |
|
275 |
//id as this can be done immediately |
|
276 |
// monitor.subTask("Sort"); |
|
277 |
// referencingObjects = sortReferencing(); |
|
278 |
// monitor.worked(5); |
|
279 |
// if (referencingObjects == null){ |
|
280 |
// if (monitor.isCanceled()){ |
|
281 |
//// actualUuid = null; |
|
282 |
// return Status.CANCEL_STATUS; |
|
283 |
// } |
|
284 |
// } |
|
285 |
|
|
286 | 273 |
if(monitor.isCanceled()) { |
287 | 274 |
return Status.CANCEL_STATUS; |
288 | 275 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/handler/OpenDescriptiveDataSetEditorHandler.java | ||
---|---|---|
1 |
|
|
1 |
/** |
|
2 |
* Copyright (C) 2014 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
2 | 9 |
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.handler; |
3 | 10 |
|
4 | 11 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
... | ... | |
24 | 31 |
EditorUtil.openDescriptiveDataSetEditor(entity.getUuid(), modelService, partService, application); |
25 | 32 |
} |
26 | 33 |
|
27 |
/** |
|
28 |
* {@inheritDoc} |
|
29 |
*/ |
|
30 | 34 |
@Override |
31 | 35 |
protected boolean canExecute(Object entity) { |
32 | 36 |
return true; |
... | ... | |
36 | 40 |
protected String getPartId() { |
37 | 41 |
return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DESCRIPTIVEDATASET_DESCRIPTIVEDATASETEDITOR; |
38 | 42 |
} |
39 |
|
|
40 |
|
|
41 | 43 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInputE4.java | ||
---|---|---|
345 | 345 |
} |
346 | 346 |
public void addToSaveConcept(Taxon toSaveNew) { |
347 | 347 |
this.toSaveConcepts.add(toSaveNew); |
348 |
|
|
349 | 348 |
} |
350 | 349 |
|
351 | 350 |
@Override |
... | ... | |
406 | 405 |
toSaveNewNames.clear(); |
407 | 406 |
toSaveConcepts.clear(); |
408 | 407 |
|
409 |
|
|
410 |
|
|
411 |
|
|
412 | 408 |
for(AbstractPostOperation<?> entry:operations){ |
413 | 409 |
IStatus status = Status.CANCEL_STATUS; |
414 | 410 |
final IAdaptable uiInfoAdapter = WorkspaceUndoUtil |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonNodeHandler.java | ||
---|---|---|
27 | 27 |
try { |
28 | 28 |
EditorUtil.openTaxonNodeE4(entity.getUuid(), modelService, partService, application); |
29 | 29 |
} catch (Exception e) { |
30 |
MessagingUtils.error(DefaultOpenTaxonEditorForTaxonNodeHandler.class, Messages.DefaultOpenTaxonEditorForTaxonNodeHandler_COULD_NOT_OPEN+entity.getTaxonTitleCache(), e);
|
|
30 |
MessagingUtils.error(DefaultOpenTaxonEditorForTaxonNodeHandler.class, Messages.DefaultOpenTaxonEditorForTaxonNodeHandler_COULD_NOT_OPEN + entity.getTaxonTitleCache(), e);
|
|
31 | 31 |
} |
32 | 32 |
} |
33 | 33 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java | ||
---|---|---|
233 | 233 |
public static String NameEditorDropTargetListener_CHANGE_SYNONYM_TO_MISAPP; |
234 | 234 |
public static String NameEditorDropTargetListener_UNSUCCESSFULL_DROP; |
235 | 235 |
public static String OpenChecklistEditorHandler_CHOOSE_AREA; |
236 |
public static String OpenChecklistEditorHandler_COULD_NOT_OPEN_MESSAGE; |
|
237 |
public static String OpenChecklistEditorHandler_COULD_NOT_OPEN_TITLE; |
|
238 | 236 |
public static String OpenChecklistEditorHandler_GOTO_PREFERENCES; |
239 | 237 |
public static String OpenChecklistEditorHandler_NO_AREAS; |
240 | 238 |
public static String OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties | ||
---|---|---|
64 | 64 |
DefaultOpenSpecimenEditorForTypeSpecimenHandler_COULD_NOT_OPEN=Specimen tree editor could not be opened |
65 | 65 |
DefaultOpenTaxonEditorForTaxonBaseHandler_COULD_NOT_OPEN=Could not open taxon editor for taxon/synonym |
66 | 66 |
DefaultOpenTaxonEditorForTaxonNodeHandler_COULD_NOT_OPEN=Could not open taxon editor for taxon node |
67 |
OpenChecklistEditorHandler_CHOOSE_AREA=Please choose the areas you want to display. |
|
68 |
OpenChecklistEditorHandler_COULD_NOT_OPEN_MESSAGE=Could not open Distribution Editor. |
|
69 |
OpenChecklistEditorHandler_COULD_NOT_OPEN_TITLE=Could not open Distribution Editor |
|
67 |
OpenChecklistEditorHandler_CHOOSE_AREA=Please choose the areas you want to display. |
|
70 | 68 |
OpenChecklistEditorHandler_GOTO_PREFERENCES=For this go to the preferences, choose the Checklist Editor and choose the areas in the Distribution Selection Wizard. |
71 | 69 |
OpenChecklistEditorHandler_NO_AREAS=No Areas to display |
72 | 70 |
OpenDerivateViewHandler_COULD_NOT_OPEN=Specimen tree editor could not be opened |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties | ||
---|---|---|
64 | 64 |
DefaultOpenTaxonEditorForTaxonBaseHandler_COULD_NOT_OPEN=Taxon-Editor f?r Taxon/Synonym konnte nicht ge?ffnet werden |
65 | 65 |
DefaultOpenTaxonEditorForTaxonNodeHandler_COULD_NOT_OPEN=Taxon-Editor f?r Taxonknoten konnte nicht ge?ffnet werden |
66 | 66 |
OpenChecklistEditorHandler_CHOOSE_AREA=Bitte w?hlen Sie das Gebiet aus, das dargestellt werden soll |
67 |
OpenChecklistEditorHandler_COULD_NOT_OPEN_MESSAGE=Der Verbreitungs-Editor konnte nicht ge?ffnet werden |
|
68 |
OpenChecklistEditorHandler_COULD_NOT_OPEN_TITLE=Der Verbreitungs-Editor konnte nicht ge?ffnet werden |
|
69 | 67 |
OpenChecklistEditorHandler_GOTO_PREFERENCES=Hierf?r gehen Sie zu den Preferences, w?hlen Sie Checklist Editor und dann die Gebiete in dem Verbreitungs-Wizard. |
70 | 68 |
OpenChecklistEditorHandler_NO_AREAS=Keine Gebiete, die angezeigt werden k?nnen |
71 | 69 |
OpenDerivateViewHandler_COULD_NOT_OPEN=Specimen-Baum-Editor konnte nicht ge?ffnet werden. |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/handler/OpenChecklistEditorHandlerE4.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2014 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
1 | 9 |
package eu.etaxonomy.taxeditor.editor.view.checklist.e4.handler; |
2 | 10 |
|
3 | 11 |
import java.util.List; |
4 | 12 |
|
5 |
import javax.inject.Inject; |
|
6 | 13 |
import javax.inject.Named; |
7 | 14 |
|
8 | 15 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
9 |
import org.eclipse.e4.core.services.log.Logger; |
|
10 | 16 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
11 | 17 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
12 | 18 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
20 | 26 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
21 | 27 |
import eu.etaxonomy.taxeditor.editor.AppModelId; |
22 | 28 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
23 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
|
24 | 29 |
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenSetBaseHandler; |
25 | 30 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
26 | 31 |
import eu.etaxonomy.taxeditor.security.RequiredPermissions; |
... | ... | |
40 | 45 |
EditorUtil.openDistributionEditor(entities, modelService, partService, application); |
41 | 46 |
} |
42 | 47 |
|
43 |
|
|
44 |
|
|
45 |
/** |
|
46 |
* {@inheritDoc} |
|
47 |
*/ |
|
48 | 48 |
@CanExecute |
49 | 49 |
@Override |
50 | 50 |
public boolean canExecute(MHandledMenuItem menuItem, |
... | ... | |
82 | 82 |
return result; |
83 | 83 |
} |
84 | 84 |
|
85 |
|
|
86 |
|
|
87 | 85 |
@Override |
88 | 86 |
protected boolean canExecute(Object entity) { |
89 | 87 |
// TODO Auto-generated method stub |
90 | 88 |
return true; |
91 | 89 |
} |
92 |
|
|
93 |
|
|
94 |
} |
|
90 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/OpenReferencingObjectsViewHandler.java | ||
---|---|---|
23 | 23 |
Object selectedObject; |
24 | 24 |
@Execute |
25 | 25 |
public void execute(EPartService partService) { |
26 |
|
|
26 | 27 |
MPart part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_BULKEDITOR_REFERENCINGOBJECTS_E4_REFERENCINGOBJECTSVIEWE4); |
27 | 28 |
part = partService.showPart(part, PartState.ACTIVATE); |
28 | 29 |
IReferencingObjectsView view = (IReferencingObjectsView)part.getObject(); |
... | ... | |
63 | 64 |
menuItem.setVisible(canExecute); |
64 | 65 |
return canExecute; |
65 | 66 |
} |
66 |
|
|
67 |
} |
|
67 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/e4/DefaultOpenTaxonNodeWizardHandlerE4.java | ||
---|---|---|
30 | 30 |
import eu.etaxonomy.taxeditor.ui.section.classification.EditTaxonNodeWizard; |
31 | 31 |
|
32 | 32 |
/** |
33 |
* Open the taxon node wizard via e.g. navigator context menu. |
|
34 |
* |
|
33 | 35 |
* @author k.luther |
34 | 36 |
* @date 22.03.2016 |
35 | 37 |
*/ |
... | ... | |
39 | 41 |
protected void open(TaxonNodeDto entity, Shell shell, EPartService partService) { |
40 | 42 |
Collection<MPart> dirtyParts = partService.getDirtyParts(); |
41 | 43 |
if (!dirtyParts.isEmpty()){ |
42 |
|
|
43 | 44 |
for (MPart dirtyPart: dirtyParts){ |
44 | 45 |
if (dirtyPart.getElementId().equals("eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4") && ((ITaxonEditor)dirtyPart.getObject()).getTaxonNode().getUuid().equals(entity.getUuid())){ |
45 | 46 |
boolean doSave = MessageDialog |
46 | 47 |
.openConfirm(shell, "The taxonnode is in an unsaved mode", |
47 | 48 |
"Do you want to save?"); |
48 |
|
|
49 | 49 |
if (!doSave) { |
50 | 50 |
return ; |
51 | 51 |
} |
52 | 52 |
|
53 | 53 |
partService.savePart(dirtyPart, false); |
54 | 54 |
} |
55 |
|
|
56 | 55 |
} |
57 | 56 |
} |
58 | 57 |
EditTaxonNodeWizard taxonNodeWizard = ContextInjectionFactory.make(EditTaxonNodeWizard.class, context); |
... | ... | |
61 | 60 |
WizardDialog dialog = new WizardDialog(shell, taxonNodeWizard); |
62 | 61 |
int result = dialog.open(); |
63 | 62 |
if (result == Window.OK){ |
64 |
// entity = CdmStore.getService(ITaxonNodeService.class).dto(entity.getUuid()); |
|
65 | 63 |
entity = new TaxonNodeDto(taxonNodeWizard.getEntity()); |
66 | 64 |
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, taxonNodeWizard.getEntity().getParent()); |
67 | 65 |
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, entity.getTaxonUuid()); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/LineSelection.java | ||
---|---|---|
25 | 25 |
* |
26 | 26 |
* @author p.ciardelli |
27 | 27 |
* @created 03.07.2009 |
28 |
* @version 1.0 |
|
29 | 28 |
*/ |
30 | 29 |
public class LineSelection extends TextSelection implements IStructuredSelection { |
31 | 30 |
|
32 | 31 |
private StructuredSelection structuredSelection; |
33 | 32 |
|
34 |
/** |
|
35 |
* <p>Constructor for LineSelection.</p> |
|
36 |
* |
|
37 |
* @param selection a {@link org.eclipse.jface.text.ITextSelection} object. |
|
38 |
* @param document a {@link org.eclipse.jface.text.IDocument} object. |
|
39 |
* @param selectedObject a {@link java.lang.Object} object. |
|
40 |
*/ |
|
41 | 33 |
public LineSelection(ITextSelection selection, IDocument document, Object selectedObject) { |
42 | 34 |
super(document, selection.getOffset(), selection.getLength()); |
43 | 35 |
if (selectedObject != null) { |
... | ... | |
47 | 39 |
} |
48 | 40 |
} |
49 | 41 |
|
50 |
/* (non-Javadoc) |
|
51 |
* @see org.eclipse.jface.viewers.IStructuredSelection#getFirstElement() |
|
52 |
*/ |
|
53 |
/** |
|
54 |
* <p>getFirstElement</p> |
|
55 |
* |
|
56 |
* @return a {@link java.lang.Object} object. |
|
57 |
*/ |
|
58 | 42 |
@Override |
59 | 43 |
public Object getFirstElement() { |
60 | 44 |
return structuredSelection.getFirstElement(); |
61 | 45 |
} |
62 | 46 |
|
63 |
/* (non-Javadoc) |
|
64 |
* @see org.eclipse.jface.viewers.IStructuredSelection#iterator() |
|
65 |
*/ |
|
66 |
/** |
|
67 |
* <p>iterator</p> |
|
68 |
* |
|
69 |
* @return a {@link java.util.Iterator} object. |
|
70 |
*/ |
|
71 | 47 |
@Override |
72 | 48 |
public Iterator<?> iterator() { |
73 | 49 |
return structuredSelection.iterator(); |
74 | 50 |
} |
75 | 51 |
|
76 |
/* (non-Javadoc) |
|
77 |
* @see org.eclipse.jface.viewers.IStructuredSelection#size() |
|
78 |
*/ |
|
79 |
/** |
|
80 |
* <p>size</p> |
|
81 |
* |
|
82 |
* @return a int. |
|
83 |
*/ |
|
84 | 52 |
@Override |
85 | 53 |
public int size() { |
86 | 54 |
return structuredSelection.size(); |
87 | 55 |
} |
88 | 56 |
|
89 |
/* (non-Javadoc) |
|
90 |
* @see org.eclipse.jface.viewers.IStructuredSelection#toArray() |
|
91 |
*/ |
|
92 |
/** |
|
93 |
* <p>toArray</p> |
|
94 |
* |
|
95 |
* @return an array of {@link java.lang.Object} objects. |
|
96 |
*/ |
|
97 | 57 |
@Override |
98 | 58 |
public Object[] toArray() { |
99 | 59 |
return structuredSelection.toArray(); |
100 | 60 |
} |
101 | 61 |
|
102 |
/* (non-Javadoc) |
|
103 |
* @see org.eclipse.jface.viewers.IStructuredSelection#toList() |
|
104 |
*/ |
|
105 |
/** |
|
106 |
* <p>toList</p> |
|
107 |
* |
|
108 |
* @return a {@link java.util.List} object. |
|
109 |
*/ |
|
110 | 62 |
@Override |
111 | 63 |
public List<?> toList() { |
112 | 64 |
return structuredSelection.toList(); |
Also available in: Unified diff
cleanup