diff options
author | ddunne | 2008-05-09 19:53:31 +0000 |
---|---|---|
committer | ddunne | 2008-05-09 19:53:31 +0000 |
commit | 3f4e4e7a8639bc49a0a7287ead3a78e09d0c1560 (patch) | |
tree | fc60db23ca29a3ea80038245355b3f3186c0a224 | |
parent | ba0399a0423b37741656d582cc83e7e3f85ad4db (diff) | |
download | org.eclipse.osee-3f4e4e7a8639bc49a0a7287ead3a78e09d0c1560.tar.gz org.eclipse.osee-3f4e4e7a8639bc49a0a7287ead3a78e09d0c1560.tar.xz org.eclipse.osee-3f4e4e7a8639bc49a0a7287ead3a78e09d0c1560.zip |
Fixed editor inputs to allow SMA and Artifact editors to be opened simultaneously
3 files changed, 92 insertions, 22 deletions
diff --git a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java index bb18964e354..0ce8757acdc 100644 --- a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java +++ b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java @@ -10,32 +10,99 @@ *******************************************************************************/ package org.eclipse.osee.ats.editor; +import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; -import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IPersistableElement; /** * @author Donald G. Dunne */ -public class SMAEditorInput extends ArtifactEditorInput { +public class SMAEditorInput implements IEditorInput { + + protected Artifact artifact; - /** - * @param artifact - */ public SMAEditorInput(Artifact artifact) { - super(artifact); + this.artifact = artifact; } - /* (non-Javadoc) - * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput#equals(java.lang.Object) - */ - @Override public boolean equals(Object obj) { + boolean equals = false; if (obj instanceof SMAEditorInput) { SMAEditorInput otherEdInput = (SMAEditorInput) obj; - return artifact == otherEdInput.artifact; + equals = (artifact == otherEdInput.artifact); } - return false; + return equals; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#exists() + */ + public boolean exists() { + return true; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#getImageDescriptor() + */ + public ImageDescriptor getImageDescriptor() { + return null; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#getName() + */ + public String getName() { + if (artifact == null) { + return "No Artifact Input Provided"; + } + return artifact.getVersionedName(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#getPersistable() + */ + public IPersistableElement getPersistable() { + return null; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#getToolTipText() + */ + public String getToolTipText() { + return getName(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + */ + @SuppressWarnings("unchecked") + public Object getAdapter(Class adapter) { + return null; + } + + public Artifact getArtifact() { + return artifact; + } + + /** + * @param artifact the artifact to set + */ + public void setArtifact(Artifact artifact) { + this.artifact = artifact; } } diff --git a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditorInput.java b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditorInput.java index e629530f693..68257fac111 100644 --- a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditorInput.java +++ b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditorInput.java @@ -17,13 +17,13 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.osee.ats.artifact.TaskArtifact; import org.eclipse.osee.ats.util.DefaultTeamState; import org.eclipse.osee.ats.util.widgets.dialog.TaskResOptionDefinition; -import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput; +import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IPersistableElement; /** * @author Donald G. Dunne */ -public class TaskEditorInput extends ArtifactEditorInput { +public class TaskEditorInput implements IEditorInput { private final Collection<TaskArtifact> taskArts; private final String name; @@ -33,23 +33,17 @@ public class TaskEditorInput extends ArtifactEditorInput { * @param artifact */ public TaskEditorInput(String name, Collection<TaskArtifact> taskArts, List<TaskResOptionDefinition> resOptions) { - super(null); this.name = name; this.taskArts = taskArts; this.resOptions = resOptions; } public TaskEditorInput(String name, Collection<TaskArtifact> taskArts) { - super(null); this.name = name; this.taskArts = taskArts; this.resOptions = null; } - /* (non-Javadoc) - * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput#equals(java.lang.Object) - */ - @Override public boolean equals(Object obj) { return false; } @@ -109,4 +103,12 @@ public class TaskEditorInput extends ArtifactEditorInput { return ""; } + /* (non-Javadoc) + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + */ + @Override + public Object getAdapter(Class adapter) { + return null; + } + } diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInput.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInput.java index 88120377267..a9508824e98 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInput.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditorInput.java @@ -26,12 +26,13 @@ public class ArtifactEditorInput implements IEditorInput { } public boolean equals(Object obj) { + boolean equals = false; if (obj instanceof ArtifactEditorInput) { ArtifactEditorInput otherEdInput = (ArtifactEditorInput) obj; - return artifact == otherEdInput.artifact; + equals = (artifact == otherEdInput.artifact); } - return false; + return equals; } /* |