Merge branch 'develop' into remoting-4.0
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / key / AbstractIdentificationEditorInput.java
1 /**
2 *
3 */
4 package eu.etaxonomy.taxeditor.editor.key;
5
6 import org.eclipse.jface.resource.ImageDescriptor;
7 import org.eclipse.ui.IEditorInput;
8 import org.eclipse.ui.IPersistableElement;
9
10 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
11 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
12 import eu.etaxonomy.cdm.model.description.IIdentificationKey;
13 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
14 import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
15
16 /**
17 * @author n.hoffmann
18 *
19 */
20 public abstract class AbstractIdentificationEditorInput<T extends IIdentificationKey>
21 extends CdmEntitySessionInput implements IEditorInput, IConversationEnabled {
22
23 private final ConversationHolder conversation;
24
25 protected AbstractIdentificationEditorInput(ConversationHolder conversation) {
26 super(true);
27 this.conversation = conversation;
28 }
29
30 /*
31 * (non-Javadoc)
32 *
33 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
34 */
35 @Override
36 public Object getAdapter(Class adapter) {
37 // TODO Auto-generated method stub
38 return null;
39 }
40
41 /*
42 * (non-Javadoc)
43 *
44 * @see org.eclipse.ui.IEditorInput#exists()
45 */
46 @Override
47 public boolean exists() {
48 return getKey() != null;
49 }
50
51 /*
52 * (non-Javadoc)
53 *
54 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
55 */
56 @Override
57 public ImageDescriptor getImageDescriptor() {
58 // TODO Auto-generated method stub
59 return null;
60 }
61
62 /*
63 * (non-Javadoc)
64 *
65 * @see org.eclipse.ui.IEditorInput#getPersistable()
66 */
67 @Override
68 public IPersistableElement getPersistable() {
69 // TODO Auto-generated method stub
70 return null;
71 }
72
73 /*
74 * (non-Javadoc)
75 *
76 * @see org.eclipse.ui.IEditorInput#getToolTipText()
77 */
78 @Override
79 public String getToolTipText() {
80 return getName();
81 }
82
83 /*
84 * (non-Javadoc)
85 *
86 * @see org.eclipse.ui.IEditorInput#getName()
87 */
88 @Override
89 public String getName() {
90 return getKey().toString();
91 }
92
93 @Override
94 public ConversationHolder getConversationHolder() {
95 return conversation;
96 }
97
98 public abstract T getKey();
99
100 @Override
101 public void update(CdmDataChangeMap changeEvents) {
102 }
103
104 /* (non-Javadoc)
105 * @see java.lang.Object#equals(java.lang.Object)
106 */
107 @Override
108 public boolean equals(Object obj) {
109 // TODO Auto-generated method stub
110 boolean result = super.equals(obj);
111 return result;
112 }
113
114 }