Browse Source

Adding plug-in containing the perspective factories for the statechart editor.

essermar@googlemail.com 14 years ago
parent
commit
765a81e832

+ 7 - 0
plugins/org.yakindu.sct.ui/.classpath

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 28 - 0
plugins/org.yakindu.sct.ui/.project

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.ui</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 3 - 0
plugins/org.yakindu.sct.ui/.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,3 @@
+#Fri Aug 05 15:07:43 CEST 2011
+eclipse.preferences.version=1
+encoding/<project>=UTF-8

+ 8 - 0
plugins/org.yakindu.sct.ui/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,8 @@
+#Thu Aug 04 17:00:06 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

+ 13 - 0
plugins/org.yakindu.sct.ui/META-INF/MANIFEST.MF

@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ui
+Bundle-SymbolicName: org.yakindu.sct.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.yakindu.sct.ui.UIPluginActivator
+Bundle-Vendor: YAKINDU
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.yakindu.sct.ui,
+ org.yakindu.sct.ui.perspectives

+ 6 - 0
plugins/org.yakindu.sct.ui/build.properties

@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               icons/

BIN
plugins/org.yakindu.sct.ui/icons/modeling_perspective.png


BIN
plugins/org.yakindu.sct.ui/icons/simulation_perspective.png


+ 22 - 0
plugins/org.yakindu.sct.ui/plugin.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            class="org.yakindu.sct.ui.perspectives.ModelingPerspectiveFactory"
+            fixed="false"
+            icon="icons/modeling_perspective.png"
+            id="org.yakindu.sct.ui.ModelingPerspective"
+            name="YAKINDU SCT Modeling">
+      </perspective>
+      <perspective
+            class="org.yakindu.sct.ui.perspectives.SimulationPerspectiveFactory"
+            fixed="false"
+            icon="icons/simulation_perspective.png"
+            id="org.yakindu.sct.ui.SimulationPerspective"
+            name="YAKINDU SCT Simulation">
+      </perspective>
+   </extension>
+
+</plugin>

+ 50 - 0
plugins/org.yakindu.sct.ui/src/org/yakindu/sct/ui/UIPluginActivator.java

@@ -0,0 +1,50 @@
+package org.yakindu.sct.ui;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPluginActivator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.yakindu.sct.ui"; //$NON-NLS-1$
+
+	// The shared instance
+	private static UIPluginActivator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public UIPluginActivator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static UIPluginActivator getDefault() {
+		return plugin;
+	}
+
+}

+ 17 - 0
plugins/org.yakindu.sct.ui/src/org/yakindu/sct/ui/perspectives/IYakinduSctPerspectives.java

@@ -0,0 +1,17 @@
+package org.yakindu.sct.ui.perspectives;
+
+import org.yakindu.sct.ui.UIPluginActivator;
+
+/**
+ * Ids for the YAKINDU Statechart editor perspectives.
+ * <p>
+ * This interface contains constants only; it is not intended to be implemented
+ * or extended.
+ */
+public interface IYakinduSctPerspectives {
+
+	public final static String ID_PERSPECTIVE_SCT_MODELING = UIPluginActivator.PLUGIN_ID
+			+ "." + "ModelingPerspective";
+	public final static String ID_PERSPECTIVE_SCT_SIMULATION = UIPluginActivator.PLUGIN_ID
+			+ "." + "SimulationPerspective";
+}

+ 40 - 0
plugins/org.yakindu.sct.ui/src/org/yakindu/sct/ui/perspectives/ModelingPerspectiveFactory.java

@@ -0,0 +1,40 @@
+package org.yakindu.sct.ui.perspectives;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class ModelingPerspectiveFactory implements IPerspectiveFactory {
+
+	@Override
+	public void createInitialLayout(IPageLayout layout) {
+		defineActions(layout);
+		defineLayout(layout);
+	}
+
+	private void defineLayout(IPageLayout layout) {
+		String editorArea = layout.getEditorArea();
+
+		IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
+				0.16f, editorArea);
+		left.addView(IPageLayout.ID_PROJECT_EXPLORER);
+		// Included to get rid of a warning issued by the workbench
+		left.addPlaceholder("org.eclipse.jdt.ui.PackageExplorer");
+
+		IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT,
+				0.84f, editorArea);
+		right.addView(IPageLayout.ID_OUTLINE);
+
+		IFolderLayout bottom = layout.createFolder("bottom",
+				IPageLayout.BOTTOM, 0.65f, editorArea);
+		bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
+		bottom.addView(IPageLayout.ID_PROP_SHEET);
+	}
+
+	private void defineActions(IPageLayout layout) {
+		layout.addNewWizardShortcut("org.yakindu.sct.ui.editor.StatechartDiagramWizard");
+		layout.addPerspectiveShortcut(IYakinduSctPerspectives.ID_PERSPECTIVE_SCT_SIMULATION);
+		layout.addActionSet("org.eclipse.debug.ui.launchActionSet");
+	}
+
+}

+ 44 - 0
plugins/org.yakindu.sct.ui/src/org/yakindu/sct/ui/perspectives/SimulationPerspectiveFactory.java

@@ -0,0 +1,44 @@
+package org.yakindu.sct.ui.perspectives;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class SimulationPerspectiveFactory implements IPerspectiveFactory {
+
+	@Override
+	public void createInitialLayout(IPageLayout layout) {
+		defineActions(layout);
+		defineLayout(layout);
+
+	}
+
+	private void defineLayout(IPageLayout layout) {
+		String editorArea = layout.getEditorArea();
+
+		IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
+				0.16f, editorArea);
+		left.addView(IPageLayout.ID_PROJECT_EXPLORER);
+		// Included to get rid of a warning issued by the workbench
+		left.addPlaceholder("org.eclipse.jdt.ui.PackageExplorer");
+
+		IFolderLayout topRight = layout.createFolder("topRight",
+				IPageLayout.RIGHT, 0.84f, editorArea);
+		topRight.addView(IPageLayout.ID_OUTLINE);
+
+		IFolderLayout bottomRight = layout.createFolder("bottomRight",
+				IPageLayout.BOTTOM, 0.33f, "topRight");
+		bottomRight.addView("org.yakindu.sct.simulation.ui.declarationview");
+
+		IFolderLayout top = layout.createFolder("top", IPageLayout.TOP, 0.22f,
+				editorArea);
+		top.addView("org.eclipse.debug.ui.DebugView");
+	}
+
+	private void defineActions(IPageLayout layout) {
+		layout.addNewWizardShortcut("org.yakindu.sct.ui.editor.StatechartDiagramWizard");
+		layout.addPerspectiveShortcut(IYakinduSctPerspectives.ID_PERSPECTIVE_SCT_MODELING);
+		layout.addActionSet("org.eclipse.debug.ui.launchActionSet");
+	}
+
+}