Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java85
1 files changed, 85 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java
new file mode 100644
index 00000000000..5f97b7d4ad8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.world;
+
+import java.util.logging.Level;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.ats.internal.AtsPlugin;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldEditorInput implements IEditorInput {
+
+ IWorldEditorProvider iWorldEditorProvider;
+
+ @Override
+ public int hashCode() {
+ return iWorldEditorProvider.hashCode();
+ }
+
+ public IWorldEditorProvider getIWorldEditorProvider() {
+ return iWorldEditorProvider;
+ }
+
+ public WorldEditorInput(IWorldEditorProvider iWorldEditorProvider) {
+ this.iWorldEditorProvider = iWorldEditorProvider;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof WorldEditorInput))
+ return false;
+ WorldEditorInput castObj = (WorldEditorInput) obj;
+ return castObj.iWorldEditorProvider.equals(this.iWorldEditorProvider);
+ }
+
+ public boolean exists() {
+ return false;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public String getToolTipText() {
+ try {
+ return iWorldEditorProvider.getName();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "Exception getting name: " + ex.getLocalizedMessage();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ try {
+ return iWorldEditorProvider.getName();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "Exception getting name: " + ex.getLocalizedMessage();
+ }
+ }
+}

Back to the top