Revision 12a605bc
Added by Patrick Plitzner over 7 years ago
eu.etaxonomy.taxeditor.bulkeditor/plugin.xml | ||
---|---|---|
99 | 99 |
</visibleWhen> |
100 | 100 |
</menu> |
101 | 101 |
<separator |
102 |
name="taxeditor-bulkeditor.separator4"
|
|
103 |
visible="true">
|
|
102 |
name="taxeditor-bulkeditor.separator4" |
|
103 |
visible="true"> |
|
104 | 104 |
</separator> |
105 | 105 |
<command |
106 | 106 |
commandId="bulkeditor.commands.setmergetarget" |
... | ... | |
145 | 145 |
</reference> |
146 | 146 |
</visibleWhen> |
147 | 147 |
</command> |
148 |
<separator
|
|
149 |
name="eu.etaxonomy.taxeditor.bulkeditor.separator1"
|
|
150 |
visible="true">
|
|
151 |
</separator>
|
|
148 |
<separator |
|
149 |
name="eu.etaxonomy.taxeditor.bulkeditor.separator1" |
|
150 |
visible="true"> |
|
151 |
</separator> |
|
152 | 152 |
<command |
153 | 153 |
commandId="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person" |
154 | 154 |
label="%command.label.5" |
... | ... | |
304 | 304 |
id="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForTaxonNode" |
305 | 305 |
name="%command.name.OPEN_BULK_EDITOR_FOR_TAXON_NODE"> |
306 | 306 |
</command> |
307 |
<command |
|
308 |
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler.OpenBulkEditorForIdentifiableEntity" |
|
309 |
id="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity" |
|
310 |
name="Open bulk editor for identifiable entity"> |
|
311 |
<commandParameter |
|
312 |
id="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity.uuid" |
|
313 |
name="Identifiable Entity UUID" |
|
314 |
optional="true" |
|
315 |
typeId="eu.etaxonomy.taxeditor.uuidParameterType"> |
|
316 |
</commandParameter> |
|
317 |
</command> |
|
307 | 318 |
<!--command |
308 | 319 |
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.NewEntityHandler" |
309 | 320 |
id="eu.etaxonomy.taxeditor.bulkeditor.command.new" |
... | ... | |
519 | 530 |
selection="eu.etaxonomy.cdm.model.taxon.TaxonNode" |
520 | 531 |
viewerName="%viewCommandMapping.viewerName.BULK_EDITOR"> |
521 | 532 |
</viewCommandMapping> |
533 |
<viewCommandMapping |
|
534 |
commandId="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity" |
|
535 |
selection="eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache" |
|
536 |
viewerName="%viewCommandMapping.viewerName.BULK_EDITOR"> |
|
537 |
</viewCommandMapping> |
|
538 |
<viewCommandMapping |
|
539 |
commandId="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity" |
|
540 |
selection="eu.etaxonomy.cdm.model.common.IdentifiableEntity" |
|
541 |
viewerName="%viewCommandMapping.viewerName.BULK_EDITOR"> |
|
542 |
</viewCommandMapping> |
|
522 | 543 |
</extension> |
523 | 544 |
<!-- start set marker --> |
524 | 545 |
|
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/defaultHandler/OpenBulkEditorForIdentifiableEntity.java | ||
---|---|---|
1 |
package eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler; |
|
2 |
|
|
3 |
import java.util.UUID; |
|
4 |
|
|
5 |
import org.eclipse.core.commands.ExecutionEvent; |
|
6 |
import org.eclipse.ui.PartInitException; |
|
7 |
|
|
8 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
|
9 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil; |
|
10 |
import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase; |
|
11 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
12 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
13 |
|
|
14 |
public class OpenBulkEditorForIdentifiableEntity extends DefaultOpenHandlerBase<IdentifiableEntity> { |
|
15 |
|
|
16 |
@Override |
|
17 |
protected IdentifiableEntity getEntity(UUID uuid) { |
|
18 |
return CdmStore.getCommonService().find(IdentifiableEntity.class, uuid); |
|
19 |
} |
|
20 |
|
|
21 |
@Override |
|
22 |
protected void open(ExecutionEvent event, IdentifiableEntity entity) { |
|
23 |
try { |
|
24 |
BulkEditorUtil.openEditor(entity); |
|
25 |
} catch (PartInitException e) { |
|
26 |
MessagingUtils.error(this.getClass(), "Bulk Editor could not be opened for "+entity, e); |
|
27 |
} |
|
28 |
} |
|
29 |
|
|
30 |
|
|
31 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenu.java | ||
---|---|---|
22 | 22 |
import org.eclipse.ui.actions.CompoundContributionItem; |
23 | 23 |
import org.eclipse.ui.handlers.IHandlerService; |
24 | 24 |
|
25 |
import eu.etaxonomy.cdm.api.service.IOccurrenceService; |
|
26 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
|
25 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
27 | 26 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
28 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
29 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
|
30 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
31 | 27 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
32 | 28 |
import eu.etaxonomy.taxeditor.Messages; |
33 | 29 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
... | ... | |
98 | 94 |
Map<String, UUID> params = new HashMap<String, UUID>(); |
99 | 95 |
//for generic UuidAndTitleCache objects try to load the object |
100 | 96 |
if (selectedObject instanceof UuidAndTitleCache){ |
101 |
UuidAndTitleCache uuidAndTitleCache = (UuidAndTitleCache)selectedObject; |
|
102 |
Class type = uuidAndTitleCache.getType(); |
|
103 |
if(type == Taxon.class || type == Synonym.class){ |
|
104 |
selectedObject = CdmStore.getService(ITaxonService.class).load(uuidAndTitleCache.getUuid()); |
|
105 |
} |
|
106 |
else if(SpecimenOrObservationBase.class.isAssignableFrom(type)){ |
|
107 |
selectedObject = CdmStore.getService(IOccurrenceService.class).load(uuidAndTitleCache.getUuid()); |
|
108 |
} |
|
97 |
selectedObject = CdmStore.getCommonService().find(CdmBase.class, ((UuidAndTitleCache)selectedObject).getUuid()); |
|
109 | 98 |
} |
110 | 99 |
if(selectedObject instanceof ICdmBase){ |
111 | 100 |
params.put(command.getId()+".uuid", ((ICdmBase) selectedObject).getUuid()); //$NON-NLS-1$ |
Also available in: Unified diff
ref #5616 "Open in bulke editor" for taxa in taxon search view