]> git.argeo.org Git - gpl/argeo-slc.git/blob - plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/editors/AkbNodeEditorInput.java
work on a first draft of the AKB UI
[gpl/argeo-slc.git] / plugins / org.argeo.slc.akb.ui / src / main / java / org / argeo / slc / akb / ui / editors / AkbNodeEditorInput.java
1 package org.argeo.slc.akb.ui.editors;
2
3 import org.eclipse.jface.resource.ImageDescriptor;
4 import org.eclipse.ui.IEditorInput;
5 import org.eclipse.ui.IPersistableElement;
6
7 /**
8 * Editor input for all editors that display info on a given AKB JCR Node.
9 * Relies on the Jcr ID
10 */
11 public class AkbNodeEditorInput implements IEditorInput {
12
13 private final String jcrId;
14
15 /** the Jcr ID cannot be null */
16 public AkbNodeEditorInput(String jcrId) {
17 this.jcrId = jcrId;
18 }
19
20 public String getIdentifier() {
21 return jcrId;
22 }
23
24 public boolean exists() {
25 return true;
26 }
27
28 public ImageDescriptor getImageDescriptor() {
29 return null;
30 }
31
32 public String getName() {
33 return jcrId;
34 }
35
36 public IPersistableElement getPersistable() {
37 return null;
38 }
39
40 public String getToolTipText() {
41 return "Display and edit information about a given AKB Jcr Node";
42 }
43
44 @SuppressWarnings("rawtypes")
45 public Object getAdapter(Class adapter) {
46 return null;
47 }
48
49 public int hashCode() {
50 return jcrId.hashCode();
51 }
52
53 public boolean equals(Object obj) {
54 if (this == obj)
55 return true;
56 if (obj == null)
57 return false;
58 if (getClass() != obj.getClass())
59 return false;
60 AkbNodeEditorInput other = (AkbNodeEditorInput) obj;
61 if (!jcrId.equals(other.getIdentifier()))
62 return false;
63 return true;
64 }
65 }