2 * Copyright (C) 2007-2012 Mathieu Baudier
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.slc
.client
.ui
.dist
.editors
;
18 import javax
.jcr
.Repository
;
20 import org
.argeo
.slc
.jcr
.SlcNames
;
21 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
22 import org
.eclipse
.ui
.IEditorInput
;
23 import org
.eclipse
.ui
.IPersistableElement
;
26 * An editor input pointing to a distribution
28 public class DistributionEditorInput
implements IEditorInput
, SlcNames
{
30 private Repository repository
;
31 private String workspaceName
;
32 private String artifactsBase
= "/";
34 public DistributionEditorInput(Repository repository
, String workspaceName
,
35 String artifactsBase
) {
37 this.repository
= repository
;
38 this.workspaceName
= workspaceName
;
39 this.artifactsBase
= artifactsBase
;
42 public DistributionEditorInput(Repository repository
, String workspaceName
) {
43 this(repository
, workspaceName
, "/");
46 public Object
getAdapter(@SuppressWarnings("rawtypes") Class adapter
) {
50 public boolean exists() {
54 public ImageDescriptor
getImageDescriptor() {
58 // Dummy compulsory methods
59 public String
getToolTipText() {
63 public String
getName() {
67 public IPersistableElement
getPersistable() {
71 public boolean equals(Object obj
) {
76 if (!(obj
instanceof DistributionEditorInput
))
79 DistributionEditorInput other
= (DistributionEditorInput
) obj
;
80 return getRepository().equals(other
.getRepository())
81 && getWorkspaceName().equals(other
.getWorkspaceName());
84 public Repository
getRepository() {
88 public String
getWorkspaceName() {
92 public String
getArtifactsBase() {