Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2015-09-03 21:48:42 +0000
committerRyan D. Brooks2015-09-03 21:48:42 +0000
commitde7615241795ee2505ddbaed02253ccaf53fb849 (patch)
tree15a8b87f984dc79a755247c4598926da226f0786 /plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src
parent2162fc11415a33f0b2a6b9837265a36f2f6ec81b (diff)
downloadorg.eclipse.osee-de7615241795ee2505ddbaed02253ccaf53fb849.tar.gz
org.eclipse.osee-de7615241795ee2505ddbaed02253ccaf53fb849.tar.xz
org.eclipse.osee-de7615241795ee2505ddbaed02253ccaf53fb849.zip
refactor: Use common command handler for rendering
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src')
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java24
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java35
2 files changed, 7 insertions, 52 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
index c125cb7b709..5f8e746a4f9 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
@@ -19,6 +19,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.dsl.ui.integration.internal.DslUiIntegrationConstants;
@@ -28,6 +29,8 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.types.IArtifact;
+import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
+import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
import org.eclipse.osee.framework.ui.skynet.render.DefaultArtifactRenderer;
import org.eclipse.osee.framework.ui.skynet.render.FileSystemRenderer;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
@@ -42,13 +45,7 @@ import org.eclipse.ui.part.FileEditorInput;
* @author Jonathan E. Jensen
*/
public abstract class AbstractDslRenderer extends FileSystemRenderer {
-
private static final String DEFAULT_EDITOR_ID = "org.eclipse.osee.framework.core.dsl.OseeDsl";
- protected static final String COMMAND_ID = "org.eclipse.osee.framework.ui.skynet.render.dsl.editor.command";
-
- protected AbstractDslRenderer() {
- super();
- }
/**
* Simple String name of the renderer
@@ -64,22 +61,15 @@ public abstract class AbstractDslRenderer extends FileSystemRenderer {
/**
* Provides a list of the artifact types that the renderer supports.
- *
+ *
* @return a list of the artifact types that the renderer supports
*/
protected abstract IArtifactType[] getArtifactTypeMatches();
- /**
- * Provides the command ID associated with this renderer and adds it to the commandGroup.
- */
@Override
- public List<String> getCommandIds(CommandGroup commandGroup) {
- ArrayList<String> commandIds = new ArrayList<String>(1);
- if (commandGroup.isEdit()) {
- commandIds.add(COMMAND_ID);
- }
-
- return commandIds;
+ public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact) {
+ ImageDescriptor icon = ArtifactImageManager.getImageDescriptor(artifact);
+ commands.add(new MenuCmdDef(CommandGroup.EDIT, SPECIALIZED_EDIT, "DSL Editor", icon));
}
/**
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java
deleted file mode 100644
index 097cea75c02..00000000000
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * 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.framework.core.dsl.ui.integration.internal;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler;
-import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
-import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
-
-/**
- * @author Roberto E. Escobar
- */
-public class OseeDslEditorHandler extends AbstractEditorHandler {
-
- @Override
- public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) {
- RendererManager.openInJob(artifacts, PresentationType.SPECIALIZED_EDIT);
- return null;
- }
-
- @Override
- protected PermissionEnum getPermissionLevel() {
- return PermissionEnum.WRITE;
- }
-}

Back to the top