2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.editor
.handler
.defaultHandler
;
11 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
;
12 import org
.eclipse
.swt
.widgets
.Shell
;
14 import eu
.etaxonomy
.cdm
.model
.taxon
.ITaxonTreeNode
;
15 import eu
.etaxonomy
.cdm
.persistence
.dto
.TaxonNodeDto
;
16 import eu
.etaxonomy
.taxeditor
.editor
.AppModelId
;
17 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
18 import eu
.etaxonomy
.taxeditor
.editor
.l10n
.Messages
;
19 import eu
.etaxonomy
.taxeditor
.handler
.defaultHandler
.e4
.DefaultOpenHandlerBaseE4
;
20 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
22 public class DefaultOpenTaxonEditorForTaxonNodeHandler
23 extends DefaultOpenHandlerBaseE4
<ITaxonTreeNode
, TaxonNodeDto
> {
26 protected void open(TaxonNodeDto entity
, Shell shell
, EPartService partService
) {
28 EditorUtil
.openTaxonNodeE4(entity
.getUuid(), modelService
, partService
, application
);
29 } catch (Exception e
) {
30 MessagingUtils
.error(DefaultOpenTaxonEditorForTaxonNodeHandler
.class, Messages
.DefaultOpenTaxonEditorForTaxonNodeHandler_COULD_NOT_OPEN
+ entity
.getTaxonTitleCache(), e
);
35 protected boolean canExecute(TaxonNodeDto selection
) {
36 return selection
.getTaxonUuid() != null;
37 // boolean hasPermission = CdmStore.currentAuthentiationHasPermission(entity, Operation.UPDATE);
38 // return hasPermission && entity.getTaxon()!=null ;
42 protected String
getPartId() {
43 return AppModelId
.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_TAXONEDITOR
;