X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=cms%2Forg.argeo.slc.client.ui%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Feditors%2FProcessEditorInput.java;fp=cms%2Forg.argeo.slc.client.ui%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Feditors%2FProcessEditorInput.java;h=f93af3feda22903121c0a3ce6ae603f408908c74;hb=ecc22e604e47533c79de9cecdcdeacbc752cbff1;hp=0000000000000000000000000000000000000000;hpb=e07ded4632e53f8b8869763bc1f1f4091361e76e;p=gpl%2Fargeo-slc.git diff --git a/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/editors/ProcessEditorInput.java b/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/editors/ProcessEditorInput.java new file mode 100644 index 000000000..f93af3fed --- /dev/null +++ b/cms/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/editors/ProcessEditorInput.java @@ -0,0 +1,87 @@ +package org.argeo.slc.client.ui.editors; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.IPersistableElement; + +public class ProcessEditorInput implements IEditorInput, IPersistableElement { + private String processPath; + private List initialFlowPaths = new ArrayList(); + private Boolean launchImmediately = false; + + /** New empty process */ + public ProcessEditorInput() { + } + + /** New process with some flows */ + public ProcessEditorInput(List initialFlowPaths, + Boolean launchImmediately) { + this.initialFlowPaths = initialFlowPaths; + this.launchImmediately = launchImmediately; + } + + /** Existing process */ + public ProcessEditorInput(String processPath) { + this.processPath = processPath; + } + + @SuppressWarnings("rawtypes") + public Object getAdapter(Class arg0) { + return null; + } + + public boolean exists() { + return processPath != null; + } + + public ImageDescriptor getImageDescriptor() { + return null; + } + + public String getName() { + return processPath != null ? processPath : ""; + } + + public IPersistableElement getPersistable() { + return this; + } + + public String getToolTipText() { + return ""; + } + + public void saveState(IMemento memento) { + memento.putString("processPath", processPath); + } + + public String getFactoryId() { + return ProcessEditorInputFactory.ID; + } + + public String getProcessPath() { + return processPath; + } + + public List getInitialFlowPaths() { + return initialFlowPaths; + } + + public Boolean getLaunchImmediately() { + return launchImmediately; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ProcessEditorInput)) + return false; + ProcessEditorInput pei = (ProcessEditorInput) obj; + if (processPath != null && pei.processPath != null) + return processPath.equals(pei.processPath); + return false; + } + +}