1 package org
.argeo
.jcr
.ui
.explorer
.editors
;
3 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
4 import org
.eclipse
.ui
.IEditorInput
;
5 import org
.eclipse
.ui
.IPersistableElement
;
8 * An editor input based on three strings define a node :
10 * <li>complete path to the node</li>
11 * <li>the workspace name</li>
12 * <li>the repository alias</li>
14 * In a single workspace and/or repository environment, name and alias can be
17 * Note : unused for the time being.
20 public class StringNodeEditorInput
implements IEditorInput
{
21 private final String path
;
22 private final String repositoryAlias
;
23 private final String workspaceName
;
26 * In order to implement a generic explorer that supports remote and multi
27 * workspaces repositories, node path can be detailed by these strings.
29 * @param repositoryAlias
31 * @param workspaceName
35 public StringNodeEditorInput(String repositoryAlias
, String workspaceName
,
38 this.repositoryAlias
= repositoryAlias
;
39 this.workspaceName
= workspaceName
;
42 public Object
getAdapter(@SuppressWarnings("rawtypes") Class adapter
) {
46 public boolean exists() {
50 public ImageDescriptor
getImageDescriptor() {
54 public String
getName() {
58 public String
getRepositoryAlias() {
59 return repositoryAlias
;
62 public String
getWorkspaceName() {
66 public IPersistableElement
getPersistable() {
70 public String
getToolTipText() {
74 public String
getPath() {
78 public boolean equals(Object obj
) {
83 if (getClass() != obj
.getClass())
86 StringNodeEditorInput other
= (StringNodeEditorInput
) obj
;
88 if (!path
.equals(other
.getPath()))
91 String own
= other
.getWorkspaceName();
92 if ((workspaceName
== null && own
!= null)
93 || (workspaceName
!= null && (own
== null || !workspaceName
97 String ora
= other
.getRepositoryAlias();
98 if ((repositoryAlias
== null && ora
!= null)
99 || (repositoryAlias
!= null && (ora
== null || !repositoryAlias