1 package org
.argeo
.slc
.client
.ui
.dist
.editors
;
3 import org
.argeo
.slc
.SlcException
;
4 import org
.argeo
.slc
.SlcNames
;
5 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
6 import org
.eclipse
.ui
.IEditorInput
;
7 import org
.eclipse
.ui
.IPersistableElement
;
9 /** An editor input pointing to a distribution workspace */
10 public class DistWkspEditorInput
implements IEditorInput
, SlcNames
{
13 // private RepositoryFactory repositoryFactory;
14 // private Keyring keyring;
15 // private Node repoNode;
16 private String repoNodePath
;
20 private String workspaceName
;
22 // public WorkspaceEditorInput(RepositoryFactory repositoryFactory,
23 // Keyring keyring, Repository localRepository, Node repoNode,
25 // // this.repositoryFactory = repositoryFactory;
26 // // this.keyring = keyring;
27 // this.localRepository = localRepository;
28 // // this.repoNode= repoNode;
33 /** uri and workspace name cannot be null */
34 public DistWkspEditorInput(String repoNodePath
, String uri
,
35 String workspaceName
) {
36 if (workspaceName
== null)
37 throw new SlcException("Workspace name cannot be null");
39 throw new SlcException("URI for repository cannot be null");
40 this.repoNodePath
= repoNodePath
;
41 this.workspaceName
= workspaceName
;
45 public Object
getAdapter(@SuppressWarnings("rawtypes") Class adapter
) {
49 public boolean exists() {
53 public ImageDescriptor
getImageDescriptor() {
57 // Dummy compulsory methods
58 public String
getToolTipText() {
59 return "Editor for workspace " + workspaceName
60 + " in repository of URI " + uri
;
63 public String
getName() {
64 return workspaceName
+ "@" + uri
;
67 public IPersistableElement
getPersistable() {
71 public boolean equals(Object obj
) {
76 if (!(obj
instanceof DistWkspEditorInput
))
79 DistWkspEditorInput other
= (DistWkspEditorInput
) obj
;
81 if (!workspaceName
.equals(other
.getWorkspaceName()))
83 if (!uri
.equals(other
.getUri()))
86 if (repoNodePath
== null)
87 return other
.getRepoNodePath() == null;
89 return repoNodePath
.equals(other
.getRepoNodePath());
92 public String
getUri() {
96 public String
getWorkspaceName() {
100 public String
getRepoNodePath() {