1 package org
.argeo
.cms
.ui
.workbench
.internal
.jcr
.parts
;
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 @SuppressWarnings("unchecked")
43 public Object
getAdapter(@SuppressWarnings("rawtypes") Class adapter
) {
47 public boolean exists() {
51 public ImageDescriptor
getImageDescriptor() {
55 public String
getName() {
59 public String
getRepositoryAlias() {
60 return repositoryAlias
;
63 public String
getWorkspaceName() {
67 public IPersistableElement
getPersistable() {
71 public String
getToolTipText() {
75 public String
getPath() {
79 public boolean equals(Object obj
) {
84 if (getClass() != obj
.getClass())
87 StringNodeEditorInput other
= (StringNodeEditorInput
) obj
;
89 if (!path
.equals(other
.getPath()))
92 String own
= other
.getWorkspaceName();
93 if ((workspaceName
== null && own
!= null)
94 || (workspaceName
!= null && (own
== null || !workspaceName
98 String ora
= other
.getRepositoryAlias();
99 if ((repositoryAlias
== null && ora
!= null)
100 || (repositoryAlias
!= null && (ora
== null || !repositoryAlias