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 a path to a node plus workspace name and repository
9 * alias. In a multirepository environment, path can be enriched with Repository
13 public class GenericNodeEditorInput
implements IEditorInput
{
14 private final String path
;
15 private final String repositoryAlias
;
16 private final String workspaceName
;
19 * In order to implement a generic explorer that supports remote and multi
20 * workspaces repositories, node path can be detailed by these strings.
22 * @param repositoryAlias
24 * @param workspaceName
28 public GenericNodeEditorInput(String repositoryAlias
, String workspaceName
,
31 this.repositoryAlias
= repositoryAlias
;
32 this.workspaceName
= workspaceName
;
35 public Object
getAdapter(@SuppressWarnings("rawtypes") Class adapter
) {
39 public boolean exists() {
43 public ImageDescriptor
getImageDescriptor() {
47 public String
getName() {
51 public String
getRepositoryAlias() {
52 return repositoryAlias
;
55 public String
getWorkspaceName() {
59 public IPersistableElement
getPersistable() {
63 public String
getToolTipText() {
67 public String
getPath() {
71 public boolean equals(Object obj
) {
76 if (getClass() != obj
.getClass())
79 GenericNodeEditorInput other
= (GenericNodeEditorInput
) obj
;
81 if (!path
.equals(other
.getPath()))
84 String own
= other
.getWorkspaceName();
85 if ((workspaceName
== null && own
!= null)
86 || (workspaceName
!= null && (own
== null || !workspaceName
90 String ora
= other
.getRepositoryAlias();
91 if ((repositoryAlias
== null && ora
!= null)
92 || (repositoryAlias
!= null && (ora
== null || !repositoryAlias