Ver código fonte

Move Simulation perspective to simulation.ui (#698)

* #676 : add simulation feature
* #676 : add generator model feature

* #676 : add editor feature

* #676 : add documentation feature

* #676 : add compare feature

* #676 : sct feature includes new features

* #676 : feature dependencies

* #676 : add new features to mvn

* #676 : features to repository

* #676 : compute feature dependencies

* #676 : remove versions

* #676 : remove computed dependencies

* #676 : fix versions

* #676 : add sct.commons to simulation & generator feature as plugin
dependency

* #676 : add test

* #676 : mlove simulation perspective to simulation.ui

* #676 : remove unused dependencies
Johannes Dicks 9 anos atrás
pai
commit
92546ac29e

plugins/org.yakindu.sct.ui/icons/simulation_perspective.png → plugins/org.yakindu.sct.simulation.ui/icons/simulation_perspective.png


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

@@ -105,5 +105,26 @@
 		<decoratorProvider class="org.yakindu.sct.simulation.ui.view.decorator.HighlightingSubmachineDecorationProvider"> 
 			<Priority name="Medium" />
  		</decoratorProvider> 
- </extension> 
+ </extension>
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            class="org.yakindu.sct.simulation.ui.perspective.SimulationPerspectiveFactory"
+            icon="icons/simulation_perspective.png"
+            id="org.yakindu.sct.ui.SimulationPerspective"
+            name="SC Simulation">
+      </perspective>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectiveExtensions">
+      <perspectiveExtension
+            targetID="org.yakindu.sct.ui.SimulationPerspective">
+         <newWizardShortcut
+               id="org.yakindu.sct.ui.editor.StatechartDiagramWizard">
+         </newWizardShortcut>
+         <newWizardShortcut
+               id="org.yakindu.sct.generator.genmodel.ui.SGenNewFileWizard">
+         </newWizardShortcut>
+      </perspectiveExtension>
+   </extension> 
 </plugin>

+ 23 - 22
plugins/org.yakindu.sct.ui/src/org/yakindu/sct/ui/perspectives/SimulationPerspectiveFactory.java

@@ -1,24 +1,25 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * 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:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.perspectives;
-
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-/**
- * 
- * @author martin esser
- * 
- */
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * 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:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.ui.perspective;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+import org.yakindu.sct.ui.perspectives.IYakinduSctPerspectives;
+
+/**
+ * 
+ * @author martin esser
+ * 
+ */
 public class SimulationPerspectiveFactory implements IPerspectiveFactory {
 
 	public void createInitialLayout(IPageLayout layout) {
@@ -42,7 +43,7 @@ public class SimulationPerspectiveFactory implements IPerspectiveFactory {
 
 		IFolderLayout bottomRight = layout.createFolder("bottomRight",
 				IPageLayout.BOTTOM, 0.33f, "topRight");
-		bottomRight.addView("org.yakindu.sct.simulation.ui.declarationview");
+		bottomRight.addView("org.yakindu.sct.simulation.ui.declarationview");
 		bottomRight.addView("org.eclipse.debug.ui.BreakpointView");
 
 		IFolderLayout top = layout.createFolder("top", IPageLayout.TOP, 0.22f,

+ 0 - 1
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/wizards/CreationWizard.java

@@ -62,7 +62,6 @@ import org.yakindu.sct.ui.editor.StatechartImages;
 import org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor;
 import org.yakindu.sct.ui.editor.factories.FactoryUtils;
 import org.yakindu.sct.ui.editor.providers.SemanticHints;
-import org.yakindu.sct.ui.perspectives.PerspectiveUtil;
 import org.yakindu.sct.ui.wizards.ModelCreationWizardPage;
 
 /**

+ 65 - 64
plugins/org.yakindu.sct.ui/src/org/yakindu/sct/ui/perspectives/PerspectiveUtil.java

@@ -1,64 +1,65 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * 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:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.perspectives;
-
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.osgi.service.prefs.BackingStoreException;
-import org.yakindu.sct.ui.UIPluginActivator;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class PerspectiveUtil {
-
-	public static final String AUTO_SWITCH_PERSPECTIVE = "AutoSwitchPerspective";
-
-	public static void switchToModelingPerspective(IWorkbenchWindow window) {
-		IPreferenceStore prefs = UIPluginActivator.getDefault()
-				.getPreferenceStore();
-		boolean hide = prefs.getBoolean(AUTO_SWITCH_PERSPECTIVE);
-		IWorkbenchPage page = window.getActivePage();
-		if (!hide) {
-			IWorkbench workbench = window.getWorkbench();
-			IPerspectiveRegistry registry = workbench.getPerspectiveRegistry();
-			IPerspectiveDescriptor descriptor = registry
-					.findPerspectiveWithId(IYakinduSctPerspectives.ID_PERSPECTIVE_SCT_MODELING);
-			if ((page != null) && (page.getPerspective() != descriptor)) {
-				MessageDialogWithToggle dialog = MessageDialogWithToggle
-						.openYesNoQuestion(
-								window.getShell(),
-								"Confirm Perspective Switch",
-								"This kind of editor is associated with the YAKINDU Modeling perspective. Do you want to switch to this perspective now?",
-								"Do not offer to switch perspective in the future",
-								hide, prefs, AUTO_SWITCH_PERSPECTIVE);
-				if (dialog.getReturnCode() == 2)
-					page.setPerspective(descriptor);
-				hide = dialog.getToggleState();
-				prefs.setValue(AUTO_SWITCH_PERSPECTIVE, hide);
-				try {
-					InstanceScope.INSTANCE.getNode(UIPluginActivator.PLUGIN_ID)
-							.flush();
-				} catch (BackingStoreException e) {
-					e.printStackTrace();
-				}
-			}
-		}
-	}
-}
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * 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:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.ui.editor.wizards;
+
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveRegistry;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.osgi.service.prefs.BackingStoreException;
+import org.yakindu.sct.ui.UIPluginActivator;
+import org.yakindu.sct.ui.perspectives.IYakinduSctPerspectives;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class PerspectiveUtil {
+
+	public static final String AUTO_SWITCH_PERSPECTIVE = "AutoSwitchPerspective";
+
+	public static void switchToModelingPerspective(IWorkbenchWindow window) {
+		IPreferenceStore prefs = UIPluginActivator.getDefault()
+				.getPreferenceStore();
+		boolean hide = prefs.getBoolean(AUTO_SWITCH_PERSPECTIVE);
+		IWorkbenchPage page = window.getActivePage();
+		if (!hide) {
+			IWorkbench workbench = window.getWorkbench();
+			IPerspectiveRegistry registry = workbench.getPerspectiveRegistry();
+			IPerspectiveDescriptor descriptor = registry
+					.findPerspectiveWithId(IYakinduSctPerspectives.ID_PERSPECTIVE_SCT_MODELING);
+			if ((page != null) && (page.getPerspective() != descriptor)) {
+				MessageDialogWithToggle dialog = MessageDialogWithToggle
+						.openYesNoQuestion(
+								window.getShell(),
+								"Confirm Perspective Switch",
+								"This kind of editor is associated with the YAKINDU Modeling perspective. Do you want to switch to this perspective now?",
+								"Do not offer to switch perspective in the future",
+								hide, prefs, AUTO_SWITCH_PERSPECTIVE);
+				if (dialog.getReturnCode() == 2)
+					page.setPerspective(descriptor);
+				hide = dialog.getToggleState();
+				prefs.setValue(AUTO_SWITCH_PERSPECTIVE, hide);
+				try {
+					InstanceScope.INSTANCE.getNode(UIPluginActivator.PLUGIN_ID)
+							.flush();
+				} catch (BackingStoreException e) {
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+}

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

@@ -10,13 +10,6 @@
             id="org.yakindu.sct.ui.ModelingPerspective"
             name="SC Modeling">
       </perspective>
-      <perspective
-            class="org.yakindu.sct.ui.perspectives.SimulationPerspectiveFactory"
-            fixed="false"
-            icon="icons/simulation_perspective.png"
-            id="org.yakindu.sct.ui.SimulationPerspective"
-            name="SC Simulation">
-      </perspective>
    </extension>
    <extension
          point="org.eclipse.ui.preferencePages">
@@ -37,14 +30,5 @@
                id="org.yakindu.sct.generator.genmodel.ui.SGenNewFileWizard">
          </newWizardShortcut>
       </perspectiveExtension>
-      <perspectiveExtension
-            targetID="org.yakindu.sct.ui.SimulationPerspective">
-         <newWizardShortcut
-               id="org.yakindu.sct.ui.editor.StatechartDiagramWizard">
-         </newWizardShortcut>
-         <newWizardShortcut
-               id="org.yakindu.sct.generator.genmodel.ui.SGenNewFileWizard">
-         </newWizardShortcut>
-      </perspectiveExtension>
    </extension>
 </plugin>

+ 2 - 7
plugins/org.yakindu.sct.ui/src/org/yakindu/sct/ui/perspectives/IYakinduSctPerspectives.java

@@ -10,8 +10,6 @@
 */
 package org.yakindu.sct.ui.perspectives;
 
-import org.yakindu.sct.ui.UIPluginActivator;
-
 /**
  * Ids for the YAKINDU statechart editor perspectives.
  * <p>
@@ -19,9 +17,6 @@ import org.yakindu.sct.ui.UIPluginActivator;
  * 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";
+	public final static String ID_PERSPECTIVE_SCT_MODELING = "org.yakindu.sct.ui.ModelingPerspective";
+	public final static String ID_PERSPECTIVE_SCT_SIMULATION = "org.yakindu.sct.ui.SimulationPerspective";
 }