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 java
.util
.UUID
;
13 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
;
14 import org
.eclipse
.swt
.widgets
.Shell
;
16 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
17 import eu
.etaxonomy
.cdm
.persistence
.dto
.UuidAndTitleCache
;
18 import eu
.etaxonomy
.taxeditor
.editor
.AppModelId
;
19 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
20 import eu
.etaxonomy
.taxeditor
.handler
.defaultHandler
.e4
.DefaultOpenHandlerBaseE4
;
22 public class DefaultOpenTaxonEditorForTaxonBaseHandler
23 extends DefaultOpenHandlerBaseE4
<TaxonBase
, UuidAndTitleCache
<TaxonBase
>> {
26 protected void open(UuidAndTitleCache
<TaxonBase
> entity
, Shell shell
, EPartService partService
) throws Exception
{
27 UUID uuid
= entity
.getUuid();
28 EditorUtil
.openTaxonBaseE4(uuid
, modelService
, partService
, application
);
32 protected boolean canExecute(UuidAndTitleCache
<TaxonBase
> entity
) {
33 if (TaxonBase
.class.isAssignableFrom(entity
.getType())) {
40 protected String
getPartId() {
41 return AppModelId
.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_TAXONEDITOR
;