1 package org
.argeo
.slc
.client
.ui
.editors
;
3 import java
.util
.ArrayList
;
6 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
7 import org
.eclipse
.ui
.IEditorInput
;
8 import org
.eclipse
.ui
.IMemento
;
9 import org
.eclipse
.ui
.IPersistableElement
;
11 public class ProcessEditorInput
implements IEditorInput
, IPersistableElement
{
12 private String processPath
;
13 private List
<String
> initialFlowPaths
= new ArrayList
<String
>();
14 private Boolean launchImmediately
= false;
16 /** New empty process */
17 public ProcessEditorInput() {
20 /** New process with some flows */
21 public ProcessEditorInput(List
<String
> initialFlowPaths
,
22 Boolean launchImmediately
) {
23 this.initialFlowPaths
= initialFlowPaths
;
24 this.launchImmediately
= launchImmediately
;
27 /** Existing process */
28 public ProcessEditorInput(String processPath
) {
29 this.processPath
= processPath
;
32 @SuppressWarnings("rawtypes")
33 public Object
getAdapter(Class arg0
) {
37 public boolean exists() {
38 return processPath
!= null;
41 public ImageDescriptor
getImageDescriptor() {
45 public String
getName() {
46 return processPath
!= null ? processPath
: "<new process>";
49 public IPersistableElement
getPersistable() {
53 public String
getToolTipText() {
57 public void saveState(IMemento memento
) {
58 memento
.putString("processPath", processPath
);
61 public String
getFactoryId() {
62 return ProcessEditorInputFactory
.ID
;
65 public String
getProcessPath() {
69 public List
<String
> getInitialFlowPaths() {
70 return initialFlowPaths
;
73 public Boolean
getLaunchImmediately() {
74 return launchImmediately
;
78 public boolean equals(Object obj
) {
79 if (!(obj
instanceof ProcessEditorInput
))
81 ProcessEditorInput pei
= (ProcessEditorInput
) obj
;
82 if (processPath
!= null && pei
.processPath
!= null)
83 return processPath
.equals(pei
.processPath
);