1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.argeo.cms.ui.workbench.internal.jcr.parts;
17
18 import org.eclipse.jface.resource.ImageDescriptor;
19 import org.eclipse.ui.IEditorInput;
20 import org.eclipse.ui.IPersistableElement;
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 public class StringNodeEditorInput implements IEditorInput {
36 private final String path;
37 private final String repositoryAlias;
38 private final String workspaceName;
39
40
41
42
43
44
45
46
47
48
49
50 public StringNodeEditorInput(String repositoryAlias, String workspaceName,
51 String path) {
52 this.path = path;
53 this.repositoryAlias = repositoryAlias;
54 this.workspaceName = workspaceName;
55 }
56
57 @SuppressWarnings("unchecked")
58 public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
59 return null;
60 }
61
62 public boolean exists() {
63 return true;
64 }
65
66 public ImageDescriptor getImageDescriptor() {
67 return null;
68 }
69
70 public String getName() {
71 return path;
72 }
73
74 public String getRepositoryAlias() {
75 return repositoryAlias;
76 }
77
78 public String getWorkspaceName() {
79 return workspaceName;
80 }
81
82 public IPersistableElement getPersistable() {
83 return null;
84 }
85
86 public String getToolTipText() {
87 return path;
88 }
89
90 public String getPath() {
91 return path;
92 }
93
94 public boolean equals(Object obj) {
95 if (this == obj)
96 return true;
97 if (obj == null)
98 return false;
99 if (getClass() != obj.getClass())
100 return false;
101
102 StringNodeEditorInput other = (StringNodeEditorInput) obj;
103
104 if (!path.equals(other.getPath()))
105 return false;
106
107 String own = other.getWorkspaceName();
108 if ((workspaceName == null && own != null)
109 || (workspaceName != null && (own == null || !workspaceName
110 .equals(own))))
111 return false;
112
113 String ora = other.getRepositoryAlias();
114 if ((repositoryAlias == null && ora != null)
115 || (repositoryAlias != null && (ora == null || !repositoryAlias
116 .equals(ora))))
117 return false;
118
119 return true;
120 }
121 }