Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tessier2013-08-30 09:31:17 -0400
committerPatrick Tessier2013-08-30 09:31:17 -0400
commit3665926f4bf365e1c9acdbaf23841ed395c82e54 (patch)
treeba21dfc8e57653cacfbe59564d69b80f46bb156e /extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant
parentd697c80bbcb2e8a3eac1fde6095956855fab399a (diff)
downloadorg.eclipse.papyrus-3665926f4bf365e1c9acdbaf23841ed395c82e54.tar.gz
org.eclipse.papyrus-3665926f4bf365e1c9acdbaf23841ed395c82e54.tar.xz
org.eclipse.papyrus-3665926f4bf365e1c9acdbaf23841ed395c82e54.zip
401703: Create adl4eclipse profile
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401703 now retro engineering of plugin with feature is complete extension points are represented by ports
Diffstat (limited to 'extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant')
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/plugin.xml25
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimpleFeatureImport.java59
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimplePluginImport.java148
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/Activator.java2
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompleteFeatureArchitectureHandler.java11
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompletePluginArchitectureHandler.java17
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelFeatureArchitectureFromWorkspaceHandler.java14
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelPluginArchitectureFromWorkspaceHandler.java15
9 files changed, 267 insertions, 27 deletions
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/META-INF/MANIFEST.MF b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/META-INF/MANIFEST.MF
index ec651e394c2..8f76750ea2e 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/META-INF/MANIFEST.MF
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/META-INF/MANIFEST.MF
@@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
org.eclipse.uml2.uml,
org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
- org.eclipse.papyrus.adl4eclipsetool;bundle-version="0.10.1"
+ org.eclipse.papyrus.adl4eclipsetool;bundle-version="0.10.1",
+ org.eclipse.pde.core;bundle-version="3.9.0"
Export-Package: org.eclipse.papyrus.adltool.assistant
Bundle-Vendor: %providerName
Bundle-Version: 0.10.1.qualifier
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/plugin.xml b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/plugin.xml
index 2f76edd5d0b..3ba9bd4b24c 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/plugin.xml
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/plugin.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <extension
+ <!--extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
@@ -75,10 +75,31 @@
id="org.eclipse.papyrus.adltool.assistant.ModelCompleteFeatureArchitectureHandler"
name="Complete Feature architecture snapshot">
</command>
- </extension>
+ </extension-->
<extension
point="org.eclipse.ui.startup">
<startup
class="org.eclipse.papyrus.adltool.assistant.Activator"></startup>
</extension>
+ <extension
+ point="org.eclipse.ui.importWizards">
+ <category
+ id="org.eclipse.papyrus.editor.category"
+ name="papyrus">
+ </category>
+ <wizard
+ category="org.eclipse.papyrus.editor.category"
+ class="org.eclipse.papyrus.adl4eclipsetool.assistant.SimplePluginImport"
+ icon="img/adl.png"
+ id="org.eclipse.papyrus.adl4eclipsetool.assistant.wizard1"
+ name="Simple Plugins architecture snapshot">
+ </wizard>
+ <wizard
+ category="org.eclipse.papyrus.editor.category"
+ class="org.eclipse.papyrus.adl4eclipsetool.assistant.SimpleFeatureImport"
+ icon="img/adl.png"
+ id="org.eclipse.papyrus.adl4eclipsetool.assistant.wizard1"
+ name="Simple Features architecture snapshot">
+ </wizard>
+ </extension>
</plugin>
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimpleFeatureImport.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimpleFeatureImport.java
new file mode 100644
index 00000000000..f1115cd0926
--- /dev/null
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimpleFeatureImport.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * 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:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.adl4eclipsetool.assistant;
+
+import java.util.ArrayList;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.adltool.command.SimpleFeaturesArchitectureSnapshotCommand;
+import org.eclipse.papyrus.adltool.designer.ArchitectureSnapshotDesigner;
+import org.eclipse.papyrus.adltool.designer.wizard.BundleSelectionPage;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * this class is used to do the retro engineering from workspace plug-in. It adds only in the platform dependencies.
+ *
+ */
+public class SimpleFeatureImport extends SimplePluginImport{
+ @Override
+ public void addPages() {
+ //look for all plug-ins from the workspace
+ ArrayList<Object> bundleList= new ArrayList<Object>();
+ bundleList.addAll(ArchitectureSnapshotDesigner.getWorkspaceFeature());
+ bundleSelectionPage = new BundleSelectionPage(bundleList);
+ addPage(bundleSelectionPage);
+ }
+
+
+ @Override
+ public boolean performFinish() {
+
+ // one bundle must be selected
+ if(getSelectedBundle().size()>0){
+ // get the domain in order to launch the command
+ TransactionalEditingDomain dom = modelSet.getTransactionalEditingDomain();
+ ArrayList<Element> selection=getSelectionSet();
+
+ if( (selection.size()==1) &&(selection.get(0)instanceof Package)){
+ //launch the simple retro engineering
+ SimpleFeaturesArchitectureSnapshotCommand comd= new SimpleFeaturesArchitectureSnapshotCommand(dom, (Package)selection.get(0), getSelectedBundle());
+ dom.getCommandStack().execute(comd);
+ }
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimplePluginImport.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimplePluginImport.java
new file mode 100644
index 00000000000..36ca3d8fc73
--- /dev/null
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimplePluginImport.java
@@ -0,0 +1,148 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * 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:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.adl4eclipsetool.assistant;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.papyrus.adltool.command.SimplePluginsArchitectureSnapshotCommand;
+import org.eclipse.papyrus.adltool.designer.ArchitectureSnapshotDesigner;
+import org.eclipse.papyrus.adltool.designer.wizard.BundleSelectionPage;
+import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForSelection;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * this class is used to do the retro engineering from workspaceplugin. It adds only in the platform dependencies.
+ *
+ */
+public class SimplePluginImport extends Wizard implements IImportWizard {
+
+ protected BundleSelectionPage bundleSelectionPage;
+ protected TransactionalEditingDomain transactionalEditingDomain=null;
+ protected PapyrusMultiDiagramEditor papyrusEditor;
+ protected ModelSet modelSet;
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public SimplePluginImport() {
+ super();
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ public void addPages() {
+ //look for all plugins from the workspace
+ ArrayList<Object> bundleList= new ArrayList<Object>();
+ bundleList.addAll(ArchitectureSnapshotDesigner.getWorkspaceBundle());
+ bundleSelectionPage = new BundleSelectionPage(bundleList);
+ addPage(bundleSelectionPage);
+ }
+
+ /**
+ *
+ * @return the list of selected bundle from the page
+ */
+ public ArrayList<Object> getSelectedBundle(){
+ return bundleSelectionPage.getResult();
+ }
+ @Override
+ public boolean performFinish() {
+
+ // one bundle must be selected
+ if(getSelectedBundle().size()>0){
+ // get the domain in order to launche the command
+ TransactionalEditingDomain dom = modelSet.getTransactionalEditingDomain();
+ ArrayList<Element> selection=getSelectionSet();
+
+ if( (selection.size()==1) &&(selection.get(0)instanceof Package)){
+ //launch the simple retro engineering
+ SimplePluginsArchitectureSnapshotCommand comd= new SimplePluginsArchitectureSnapshotCommand(dom, (Package)selection.get(0),getSelectedBundle());
+ dom.getCommandStack().execute(comd);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+
+ //get the service registry of papyrus from the selection
+ ServicesRegistry registry=null;
+ try {
+ registry = ServiceUtilsForSelection.getInstance().getServiceRegistry(selection);
+ } catch (ServiceException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ modelSet = registry.getService(ModelSet.class);
+ } catch (ServiceException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * getSelected element in the diagram or in the model explorer
+ * @return Element or null
+ */
+ protected ArrayList<Element> getSelectionSet(){
+ ArrayList<Element> selectedSet =new ArrayList<Element>();
+ ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ ISelection selection = selectionService.getSelection();
+
+
+ if(selection instanceof IStructuredSelection) {
+ @SuppressWarnings("rawtypes")
+ Iterator selectedobjectIteractor = ((IStructuredSelection)selection).iterator();
+ while (selectedobjectIteractor.hasNext()) {
+ Object currentSelection = selectedobjectIteractor.next();
+ if(currentSelection instanceof GraphicalEditPart) {
+ Object graphicalElement = ((GraphicalEditPart)currentSelection).getModel();
+ if((graphicalElement instanceof View) && ((View)graphicalElement).getElement() instanceof org.eclipse.uml2.uml.Element) {
+ selectedSet.add( (org.eclipse.uml2.uml.Element)((View)graphicalElement).getElement());
+ }
+ }
+ else if(currentSelection instanceof IAdaptable) {
+ EObject selectedEObject = (EObject)((IAdaptable)currentSelection).getAdapter(EObject.class);
+ if (selectedEObject instanceof org.eclipse.uml2.uml.Element){
+ selectedSet.add((Element)selectedEObject);
+ }
+ }
+ }
+
+ }
+ return selectedSet;
+ }
+
+}
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/Activator.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/Activator.java
index 8846e4faaf4..24150f65ff0 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/Activator.java
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/Activator.java
@@ -22,7 +22,7 @@ import org.osgi.framework.BundleContext;
*/
public class Activator extends AbstractUIPlugin implements IStartup{
- // The plug-in ID
+ /** The plug-in ID**/
public static final String PLUGIN_ID = "org.eclipse.papyrus.adl4eclipsetool.assistant"; //$NON-NLS-1$
// The shared instance
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompleteFeatureArchitectureHandler.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompleteFeatureArchitectureHandler.java
index 0d8d5521c7e..064a5aeee91 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompleteFeatureArchitectureHandler.java
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompleteFeatureArchitectureHandler.java
@@ -31,10 +31,15 @@ import org.eclipse.uml2.uml.Package;
/**
* this handler is used to generate the feature and plugin architecture from workspace
- *
+ *@deprecated
*/
public class ModelCompleteFeatureArchitectureHandler extends ADLToolAbstractHandler {
+ /**
+ *
+ * Constructor.
+ *
+ */
public ModelCompleteFeatureArchitectureHandler() {
}
@@ -67,9 +72,7 @@ public class ModelCompleteFeatureArchitectureHandler extends ADLToolAbstractHand
}
/**
*
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
+ * {@inheritDoc}
*/
@Override
public boolean isEnabled() {
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompletePluginArchitectureHandler.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompletePluginArchitectureHandler.java
index dbc46fb4c53..ad7dd71c1d8 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompletePluginArchitectureHandler.java
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompletePluginArchitectureHandler.java
@@ -29,10 +29,17 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Package;
-
+/**
+ *@deprecated
+ *
+ */
public class ModelCompletePluginArchitectureHandler extends ADLToolAbstractHandler {
-
+ /**
+ *
+ * Constructor.
+ *
+ */
public ModelCompletePluginArchitectureHandler() {
}
@@ -59,14 +66,12 @@ public class ModelCompletePluginArchitectureHandler extends ADLToolAbstractHandl
dom.getCommandStack().execute(comd);
}
}
-
+
return null;
}
/**
*
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
+ *{@inheritDoc}
*/
@Override
public boolean isEnabled() {
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelFeatureArchitectureFromWorkspaceHandler.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelFeatureArchitectureFromWorkspaceHandler.java
index 012376f3fb7..ca1a5bd7084 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelFeatureArchitectureFromWorkspaceHandler.java
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelFeatureArchitectureFromWorkspaceHandler.java
@@ -31,10 +31,15 @@ import org.eclipse.uml2.uml.Package;
/**
* this handler is used to generate the feature and plugin architecture from workspace
- *
+ *@deprecated
*/
public class ModelFeatureArchitectureFromWorkspaceHandler extends ADLToolAbstractHandler {
-
+
+ /**
+ *
+ * Constructor.
+ *
+ */
public ModelFeatureArchitectureFromWorkspaceHandler() {
}
@@ -66,10 +71,7 @@ public class ModelFeatureArchitectureFromWorkspaceHandler extends ADLToolAbstrac
return null;
}
/**
- *
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
+ * {@inheritDoc}
*/
@Override
public boolean isEnabled() {
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelPluginArchitectureFromWorkspaceHandler.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelPluginArchitectureFromWorkspaceHandler.java
index 2f870f942fc..12a400d75c3 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelPluginArchitectureFromWorkspaceHandler.java
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelPluginArchitectureFromWorkspaceHandler.java
@@ -31,10 +31,14 @@ import org.eclipse.uml2.uml.Package;
/**
* this handler is used to generate the architecture from workspace
- *
+ *@deprecated
*/
public class ModelPluginArchitectureFromWorkspaceHandler extends ADLToolAbstractHandler {
-
+ /**
+ *
+ * Constructor.
+ *
+ */
public ModelPluginArchitectureFromWorkspaceHandler() {
}
@@ -62,14 +66,11 @@ public class ModelPluginArchitectureFromWorkspaceHandler extends ADLToolAbstract
}
}
-
+
return null;
}
/**
- *
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
+ * {@inheritDoc}
*/
@Override
public boolean isEnabled() {

Back to the top