]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/editors/ProcessEditorInput.java
Remove old license headers
[gpl/argeo-slc.git] / org.argeo.slc.client.ui / src / org / argeo / slc / client / ui / editors / ProcessEditorInput.java
1 package org.argeo.slc.client.ui.editors;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
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;
10
11 public class ProcessEditorInput implements IEditorInput, IPersistableElement {
12 private String processPath;
13 private List<String> initialFlowPaths = new ArrayList<String>();
14 private Boolean launchImmediately = false;
15
16 /** New empty process */
17 public ProcessEditorInput() {
18 }
19
20 /** New process with some flows */
21 public ProcessEditorInput(List<String> initialFlowPaths,
22 Boolean launchImmediately) {
23 this.initialFlowPaths = initialFlowPaths;
24 this.launchImmediately = launchImmediately;
25 }
26
27 /** Existing process */
28 public ProcessEditorInput(String processPath) {
29 this.processPath = processPath;
30 }
31
32 @SuppressWarnings("rawtypes")
33 public Object getAdapter(Class arg0) {
34 return null;
35 }
36
37 public boolean exists() {
38 return processPath != null;
39 }
40
41 public ImageDescriptor getImageDescriptor() {
42 return null;
43 }
44
45 public String getName() {
46 return processPath != null ? processPath : "<new process>";
47 }
48
49 public IPersistableElement getPersistable() {
50 return this;
51 }
52
53 public String getToolTipText() {
54 return "";
55 }
56
57 public void saveState(IMemento memento) {
58 memento.putString("processPath", processPath);
59 }
60
61 public String getFactoryId() {
62 return ProcessEditorInputFactory.ID;
63 }
64
65 public String getProcessPath() {
66 return processPath;
67 }
68
69 public List<String> getInitialFlowPaths() {
70 return initialFlowPaths;
71 }
72
73 public Boolean getLaunchImmediately() {
74 return launchImmediately;
75 }
76
77 @Override
78 public boolean equals(Object obj) {
79 if (!(obj instanceof ProcessEditorInput))
80 return false;
81 ProcessEditorInput pei = (ProcessEditorInput) obj;
82 if (processPath != null && pei.processPath != null)
83 return processPath.equals(pei.processPath);
84 return false;
85 }
86
87 }