2 * Copyright (C) 2013 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
.view
.derivate
;
11 import java
.util
.Collection
;
12 import java
.util
.Collections
;
13 import java
.util
.UUID
;
15 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
16 import org
.eclipse
.ui
.IEditorInput
;
17 import org
.eclipse
.ui
.IPersistableElement
;
19 import eu
.etaxonomy
.taxeditor
.editor
.l10n
.Messages
;
22 * Editor input for the {@link DerivateView}
28 public class DerivateViewEditorInput
implements IEditorInput
{
30 private Collection
<UUID
> derivativeUuids
;
31 private UUID taxonUuid
;
33 public DerivateViewEditorInput() {
36 public DerivateViewEditorInput(UUID derivativeUuid
, UUID taxonUuid
) {
37 this(Collections
.singleton(derivativeUuid
), taxonUuid
);
40 public DerivateViewEditorInput(Collection
<UUID
> derivativeUuids
, UUID taxonUuid
) {
41 this.derivativeUuids
= derivativeUuids
;
42 this.taxonUuid
= taxonUuid
;
45 public DerivateViewEditorInput(UUID derivativeUuid
) {
46 this(derivativeUuid
, null);
49 public DerivateViewEditorInput(Collection
<UUID
> derivativeUuids
) {
50 this(derivativeUuids
, null);
53 public Collection
<UUID
> getDerivativeUuids() {
54 return derivativeUuids
;
57 public UUID
getTaxonUuid() {
62 public Object
getAdapter(Class adapter
) {
67 public boolean exists() {
72 public ImageDescriptor
getImageDescriptor() {
77 public String
getName() {
78 return getEditorName();
82 public IPersistableElement
getPersistable() {
87 public String
getToolTipText() {
88 return getEditorName();
91 private String
getEditorName() {
92 return Messages
.DerivateViewEditorInput_SPECIMEN_EDITOR
;