Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-08-10 16:41:22 -0400
committerrescobar2010-08-10 16:41:22 -0400
commit07f256cbdd445af563a4b60f657846956ca556cb (patch)
tree726823f992bc8c2c128f1261033fa4a46f7cdfb7 /plugins/org.eclipse.osee.framework.core.dsl.ui.integration
parent079ee52a5e78d23a839e26fa6524443532e67333 (diff)
downloadorg.eclipse.osee-07f256cbdd445af563a4b60f657846956ca556cb.tar.gz
org.eclipse.osee-07f256cbdd445af563a4b60f657846956ca556cb.tar.xz
org.eclipse.osee-07f256cbdd445af563a4b60f657846956ca556cb.zip
"Team Workflow" - YGHW1 - "Block changes to requirements unless done under an appropriate action."
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.ui.integration')
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/plugin.xml28
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java35
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java117
4 files changed, 183 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF
index 4bf7758787..c66455660f 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF
@@ -44,7 +44,10 @@ Import-Package: org.eclipse.compare,
org.eclipse.osee.framework.ui.plugin,
org.eclipse.osee.framework.ui.plugin.util,
org.eclipse.osee.framework.ui.skynet,
+ org.eclipse.osee.framework.ui.skynet.artifact.editor,
+ org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers,
org.eclipse.osee.framework.ui.skynet.panels,
+ org.eclipse.osee.framework.ui.skynet.render,
org.eclipse.osee.framework.ui.skynet.results,
org.eclipse.osee.framework.ui.skynet.results.table,
org.eclipse.osee.framework.ui.swt,
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/plugin.xml b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/plugin.xml
index ae0335fb86..6bace035fb 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/plugin.xml
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/plugin.xml
@@ -30,4 +30,32 @@
classname="org.eclipse.osee.framework.core.dsl.ui.integration.operations.XtextOseeTypesHandler">
</OseeTypesHandler>
</extension>
+ <extension
+ point="org.eclipse.osee.framework.ui.skynet.ArtifactRenderer">
+ <Renderer
+ classname="org.eclipse.osee.framework.core.dsl.ui.integration.internal.OseeDslRenderer">
+ </Renderer>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.osee.framework.core.dsl.OseeDsl.editor.command"
+ name="OseeDsl Editor">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.osee.framework.core.dsl.ui.integration.internal.OseeDslEditorHandler"
+ commandId="org.eclipse.osee.framework.core.dsl.OseeDsl.editor.command">
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="+">
+ </count>
+ </with>
+ </enabledWhen>
+ </handler>
+ </extension>
</plugin>
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
new file mode 100644
index 0000000000..048ca31256
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * 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.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 execute(ExecutionEvent event) {
+ RendererManager.openInJob(artifacts, PresentationType.SPECIALIZED_EDIT);
+ dispose();
+ return null;
+ }
+
+ @Override
+ protected PermissionEnum getPermissionLevel() {
+ return PermissionEnum.WRITE;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java
new file mode 100644
index 0000000000..f0699732b8
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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 static org.eclipse.osee.framework.ui.skynet.render.PresentationType.GENERALIZED_EDIT;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+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.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.BaseArtifactEditorInput;
+import org.eclipse.osee.framework.ui.skynet.render.DefaultArtifactRenderer;
+import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
+import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class OseeDslRenderer extends DefaultArtifactRenderer {
+
+ private static final String OSEE_DSL_EDITOR_ID = "org.eclipse.osee.framework.core.dsl.OseeDsl";
+ private static final String COMMAND_ID = "org.eclipse.osee.framework.core.dsl.OseeDsl.editor.command";
+
+ @Override
+ public String getName() {
+ return "OseeDsl Editor";
+ }
+
+ @Override
+ public DefaultArtifactRenderer newInstance() {
+ return new OseeDslRenderer();
+ }
+
+ @Override
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact) {
+ if (presentationType != GENERALIZED_EDIT && !artifact.isHistorical()) {
+ if (artifact.isOfType(CoreArtifactTypes.ACCESS_CONTROL_MODEL)) {
+ return SUBTYPE_TYPE_MATCH;
+ }
+ }
+ return NO_MATCH;
+ }
+
+ @Override
+ public Image getImage(Artifact artifact) {
+ return super.getImage(artifact);
+ }
+
+ @Override
+ public List<String> getCommandId(PresentationType presentationType) {
+ ArrayList<String> commandIds = new ArrayList<String>(1);
+ if (presentationType == PresentationType.SPECIALIZED_EDIT) {
+ commandIds.add(COMMAND_ID);
+ }
+ return commandIds;
+ }
+
+ @Override
+ public void open(final List<Artifact> artifacts, PresentationType presentationType) throws OseeCoreException {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ for (Artifact artifact : artifacts) {
+ // String value = artifact.getSoleAttributeValueAsString(CoreAttributeTypes.GeneralStringData, "");
+ AWorkbench.getActivePage().openEditor(new XtextArtifactEditorInput(artifact), OSEE_DSL_EDITOR_ID);
+ }
+ } catch (CoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+
+ }
+
+ @Override
+ public boolean supportsCompare() {
+ return true;
+ }
+
+ private final static class XtextArtifactEditorInput extends BaseArtifactEditorInput {
+
+ public XtextArtifactEditorInput(Artifact artifact) {
+ super(artifact);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof XtextArtifactEditorInput) {
+ return super.equals(obj);
+ }
+ return false;
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+ System.out.println(adapter);
+ return super.getAdapter(adapter);
+ }
+
+ }
+
+}

Back to the top