Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 07:37:18 -0400
committerCamille Letavernier2014-08-21 07:37:18 -0400
commitea48a20561464c3cbb7895d430583669a9f82fcc (patch)
tree0fdf9eebacbbb301b13bafce3ca4a6952ff6e91c /extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant
parentf91b71175fd97557cf378cdcad845a44a6274b16 (diff)
downloadorg.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.tar.gz
org.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.tar.xz
org.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.zip
[Code style] Apply clean-up and formatter on Extra plug-ins
Diffstat (limited to 'extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant')
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/AdvancePluginImport.java56
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimpleFeatureImport.java26
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/SimplePluginImport.java61
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ADLToolAbstractHandler.java77
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/Activator.java14
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompleteFeatureArchitectureHandler.java27
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelCompletePluginArchitectureHandler.java27
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelFeatureArchitectureFromWorkspaceHandler.java27
-rw-r--r--extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ModelPluginArchitectureFromWorkspaceHandler.java23
9 files changed, 176 insertions, 162 deletions
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/AdvancePluginImport.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/AdvancePluginImport.java
index 283c0019c30..8804ff386ad 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/AdvancePluginImport.java
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adl4eclipsetool/assistant/AdvancePluginImport.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,16 +16,12 @@ 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.CompletePluginsArchitectureSnapshotCommand;
-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;
@@ -48,12 +44,12 @@ import org.eclipse.uml2.uml.Package;
public class AdvancePluginImport extends Wizard implements IImportWizard {
protected BundleSelectionPage bundleSelectionPage;
- protected TransactionalEditingDomain transactionalEditingDomain=null;
+ protected TransactionalEditingDomain transactionalEditingDomain = null;
protected PapyrusMultiDiagramEditor papyrusEditor;
protected ModelSet modelSet;
/**
- *
+ *
* Constructor.
*
*/
@@ -64,32 +60,33 @@ public class AdvancePluginImport extends Wizard implements IImportWizard {
@Override
public void addPages() {
- //look for all plugins from the workspace
- ArrayList<Object> bundleList= new ArrayList<Object>();
+ // look for all plugins from the workspace
+ ArrayList<Object> bundleList = new ArrayList<Object>();
bundleList.addAll(ArchitectureSnapshotDesigner.getLoadedBundles());
bundleSelectionPage = new BundleSelectionPage(bundleList);
addPage(bundleSelectionPage);
}
/**
- *
+ *
* @return the list of selected bundle from the page
*/
- public ArrayList<Object> getSelectedBundle(){
+ public ArrayList<Object> getSelectedBundle() {
return bundleSelectionPage.getResult();
}
+
@Override
public boolean performFinish() {
-
+
// one bundle must be selected
- if(getSelectedBundle().size()>0){
+ 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
- CompletePluginsArchitectureSnapshotCommand comd= new CompletePluginsArchitectureSnapshotCommand(dom, (Package)selection.get(0), getSelectedBundle());
+ ArrayList<Element> selection = getSelectionSet();
+
+ if ((selection.size() == 1) && (selection.get(0) instanceof Package)) {
+ // launch the simple retro engineering
+ CompletePluginsArchitectureSnapshotCommand comd = new CompletePluginsArchitectureSnapshotCommand(dom, (Package) selection.get(0), getSelectedBundle());
dom.getCommandStack().execute(comd);
}
return true;
@@ -98,9 +95,9 @@ public class AdvancePluginImport extends Wizard implements IImportWizard {
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
-
- //get the service registry of papyrus from the selection
- ServicesRegistry registry=null;
+
+ // get the service registry of papyrus from the selection
+ ServicesRegistry registry = null;
try {
registry = ServiceUtilsForSelection.getInstance().getServiceRegistry(selection);
} catch (ServiceException e1) {
@@ -111,27 +108,28 @@ public class AdvancePluginImport extends Wizard implements IImportWizard {
} 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>();
+ protected ArrayList<Element> getSelectionSet() {
+ ArrayList<Element> selectedSet = new ArrayList<Element>();
ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
- if(selection instanceof IStructuredSelection) {
+ if (selection instanceof IStructuredSelection) {
@SuppressWarnings("rawtypes")
- Iterator selectedobjectIteractor = ((IStructuredSelection)selection).iterator();
+ Iterator selectedobjectIteractor = ((IStructuredSelection) selection).iterator();
while (selectedobjectIteractor.hasNext()) {
Object currentSelection = selectedobjectIteractor.next();
EObject selectedEObject = EMFHelper.getEObject(currentSelection);
- if (selectedEObject instanceof org.eclipse.uml2.uml.Element){
- selectedSet.add((Element)selectedEObject);
+ if (selectedEObject instanceof org.eclipse.uml2.uml.Element) {
+ selectedSet.add((Element) selectedEObject);
}
}
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
index f1115cd0926..174dd963ff3 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -26,29 +26,29 @@ 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{
+public class SimpleFeatureImport extends SimplePluginImport {
@Override
public void addPages() {
- //look for all plug-ins from the workspace
- ArrayList<Object> bundleList= new ArrayList<Object>();
+ // 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){
+ 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());
+ 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;
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
index 32aa67b058e..94e3fc14c28 100644
--- 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -16,11 +16,8 @@ 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;
@@ -47,12 +44,12 @@ import org.eclipse.uml2.uml.Package;
public class SimplePluginImport extends Wizard implements IImportWizard {
protected BundleSelectionPage bundleSelectionPage;
- protected TransactionalEditingDomain transactionalEditingDomain=null;
+ protected TransactionalEditingDomain transactionalEditingDomain = null;
protected PapyrusMultiDiagramEditor papyrusEditor;
protected ModelSet modelSet;
/**
- *
+ *
* Constructor.
*
*/
@@ -63,32 +60,33 @@ public class SimplePluginImport extends Wizard implements IImportWizard {
@Override
public void addPages() {
- //look for all plugins from the workspace
- ArrayList<Object> bundleList= new ArrayList<Object>();
+ // 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(){
+ public ArrayList<Object> getSelectedBundle() {
return bundleSelectionPage.getResult();
}
+
@Override
public boolean performFinish() {
-
+
// one bundle must be selected
- if(getSelectedBundle().size()>0){
+ 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());
+ 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;
@@ -97,9 +95,9 @@ public class SimplePluginImport extends Wizard implements IImportWizard {
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
-
- //get the service registry of papyrus from the selection
- ServicesRegistry registry=null;
+
+ // get the service registry of papyrus from the selection
+ ServicesRegistry registry = null;
try {
registry = ServiceUtilsForSelection.getInstance().getServiceRegistry(selection);
} catch (ServiceException e1) {
@@ -110,31 +108,32 @@ public class SimplePluginImport extends Wizard implements IImportWizard {
} 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>();
+ protected ArrayList<Element> getSelectionSet() {
+ ArrayList<Element> selectedSet = new ArrayList<Element>();
ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
- if(selection instanceof IStructuredSelection) {
+ if (selection instanceof IStructuredSelection) {
@SuppressWarnings("rawtypes")
- Iterator selectedobjectIteractor = ((IStructuredSelection)selection).iterator();
+ Iterator selectedobjectIteractor = ((IStructuredSelection) selection).iterator();
while (selectedobjectIteractor.hasNext()) {
Object currentSelection = selectedobjectIteractor.next();
-
- EObject selectedEObject = EMFHelper.getEObject(currentSelection);
- if (selectedEObject instanceof org.eclipse.uml2.uml.Element){
- selectedSet.add((Element)selectedEObject);
- }
+
+ EObject selectedEObject = EMFHelper.getEObject(currentSelection);
+ 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/ADLToolAbstractHandler.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ADLToolAbstractHandler.java
index 5531c00d970..e30b261fc09 100644
--- a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ADLToolAbstractHandler.java
+++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.assistant/src/org/eclipse/papyrus/adltool/assistant/ADLToolAbstractHandler.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -37,38 +37,39 @@ import org.eclipse.uml2.uml.Element;
*/
public abstract class ADLToolAbstractHandler extends AbstractHandler {
- protected TransactionalEditingDomain transactionalEditingDomain=null;
+ protected TransactionalEditingDomain transactionalEditingDomain = null;
protected PapyrusMultiDiagramEditor papyrusEditor;
/**
* getSelected element in the diagram or in hte model explorer
+ *
* @return Element or null
*/
- protected Element getSelection(){
- org.eclipse.uml2.uml.Element selectedElement =null;
+ protected Element getSelection() {
+ org.eclipse.uml2.uml.Element selectedElement = null;
ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
- //look for papyrus
- int i=0;
- while(!(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() instanceof IMultiDiagramEditor)&&i<100000) {
+ // look for papyrus
+ int i = 0;
+ while (!(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() instanceof IMultiDiagramEditor) && i < 100000) {
i++;
}
- if((PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()instanceof IMultiDiagramEditor)){
+ if ((PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() instanceof IMultiDiagramEditor)) {
IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- papyrusEditor = ((PapyrusMultiDiagramEditor)editorPart);
+ papyrusEditor = ((PapyrusMultiDiagramEditor) editorPart);
- if(selection instanceof IStructuredSelection) {
- Object selectedobject = ((IStructuredSelection)selection).getFirstElement();
- if(selectedobject instanceof GraphicalEditPart) {
- Object graphicalElement = ((GraphicalEditPart)selectedobject).getModel();
- if((graphicalElement instanceof View) && ((View)graphicalElement).getElement() instanceof org.eclipse.uml2.uml.Element) {
- selectedElement = (org.eclipse.uml2.uml.Element)((View)graphicalElement).getElement();
+ if (selection instanceof IStructuredSelection) {
+ Object selectedobject = ((IStructuredSelection) selection).getFirstElement();
+ if (selectedobject instanceof GraphicalEditPart) {
+ Object graphicalElement = ((GraphicalEditPart) selectedobject).getModel();
+ if ((graphicalElement instanceof View) && ((View) graphicalElement).getElement() instanceof org.eclipse.uml2.uml.Element) {
+ selectedElement = (org.eclipse.uml2.uml.Element) ((View) graphicalElement).getElement();
}
}
- else if(selectedobject instanceof IAdaptable) {
- EObject selectedEObject = (EObject)((IAdaptable)selectedobject).getAdapter(EObject.class);
- if (selectedEObject instanceof org.eclipse.uml2.uml.Element){
- selectedElement=(Element)selectedEObject;
+ else if (selectedobject instanceof IAdaptable) {
+ EObject selectedEObject = (EObject) ((IAdaptable) selectedobject).getAdapter(EObject.class);
+ if (selectedEObject instanceof org.eclipse.uml2.uml.Element) {
+ selectedElement = (Element) selectedEObject;
}
}
@@ -77,43 +78,45 @@ public abstract class ADLToolAbstractHandler extends AbstractHandler {
}
return null;
}
+
/**
* getSelected element in the diagram or in hte model explorer
+ *
* @return Element or null
*/
- protected ArrayList<Element> getSelectionSet(){
- ArrayList<Element> selectedSet =new ArrayList<Element>();
+ protected ArrayList<Element> getSelectionSet() {
+ ArrayList<Element> selectedSet = new ArrayList<Element>();
ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
- //look for papyrus
- int i=0;
- while(!(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() instanceof IMultiDiagramEditor)&&i<100000) {
+ // look for papyrus
+ int i = 0;
+ while (!(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() instanceof IMultiDiagramEditor) && i < 100000) {
i++;
}
- if((PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()instanceof IMultiDiagramEditor)){
+ if ((PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() instanceof IMultiDiagramEditor)) {
IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- papyrusEditor = ((PapyrusMultiDiagramEditor)editorPart);
+ papyrusEditor = ((PapyrusMultiDiagramEditor) editorPart);
- if(selection instanceof IStructuredSelection) {
+ if (selection instanceof IStructuredSelection) {
@SuppressWarnings("rawtypes")
- Iterator selectedobjectIteractor = ((IStructuredSelection)selection).iterator();
+ 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());
+ 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);
+ 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 24150f65ff0..1bf1ec54451 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -20,14 +20,14 @@ import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
-public class Activator extends AbstractUIPlugin implements IStartup{
+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
private static Activator plugin;
-
+
/**
* The constructor
*/
@@ -36,8 +36,10 @@ public class Activator extends AbstractUIPlugin implements IStartup{
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -45,8 +47,10 @@ public class Activator extends AbstractUIPlugin implements IStartup{
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
@@ -63,7 +67,7 @@ public class Activator extends AbstractUIPlugin implements IStartup{
public void earlyStartup() {
// TODO Auto-generated method stub
-
+
}
}
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 064a5aeee91..e846e754872 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -31,12 +31,14 @@ import org.eclipse.uml2.uml.Package;
/**
* this handler is used to generate the feature and plugin architecture from workspace
- *@deprecated
+ *
+ * @deprecated
*/
+@Deprecated
public class ModelCompleteFeatureArchitectureHandler extends ADLToolAbstractHandler {
/**
- *
+ *
* Constructor.
*
*/
@@ -44,8 +46,8 @@ public class ModelCompleteFeatureArchitectureHandler extends ADLToolAbstractHand
}
public Object execute(ExecutionEvent event) throws ExecutionException {
- Element selectedElement=getSelection();
- ServicesRegistry registry=null;
+ Element selectedElement = getSelection();
+ ServicesRegistry registry = null;
try {
registry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event);
} catch (ServiceException e1) {
@@ -57,21 +59,22 @@ public class ModelCompleteFeatureArchitectureHandler extends ADLToolAbstractHand
} catch (ServiceException e) {
throw new ExecutionException("Can't get ModelSet", e);
}
- FeatureArchitectureWizard bWizard=new FeatureArchitectureWizard(false);
- WizardDialog wizardDialog = new WizardDialog(new Shell(),bWizard);
+ FeatureArchitectureWizard bWizard = new FeatureArchitectureWizard(false);
+ WizardDialog wizardDialog = new WizardDialog(new Shell(), bWizard);
if (wizardDialog.open() == Window.OK) {
TransactionalEditingDomain dom = modelSet.getTransactionalEditingDomain();
- if( selectedElement instanceof Package){
- CompleteFeaturesArchitectureSnapshotCommand comd= new CompleteFeaturesArchitectureSnapshotCommand(dom, (Package)selectedElement, bWizard.getSelectedBundle());
+ if (selectedElement instanceof Package) {
+ CompleteFeaturesArchitectureSnapshotCommand comd = new CompleteFeaturesArchitectureSnapshotCommand(dom, (Package) selectedElement, bWizard.getSelectedBundle());
dom.getCommandStack().execute(comd);
}
- }
+ }
+
-
return null;
}
+
/**
- *
+ *
* {@inheritDoc}
*/
@Override
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 ad7dd71c1d8..c6bc608caff 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
@@ -1,8 +1,7 @@
-
/*****************************************************************************
* 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
@@ -30,13 +29,14 @@ import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Package;
/**
- *@deprecated
+ * @deprecated
*
*/
+@Deprecated
public class ModelCompletePluginArchitectureHandler extends ADLToolAbstractHandler {
/**
- *
+ *
* Constructor.
*
*/
@@ -44,8 +44,8 @@ public class ModelCompletePluginArchitectureHandler extends ADLToolAbstractHandl
}
public Object execute(ExecutionEvent event) throws ExecutionException {
- Element selectedElement=getSelection();
- ServicesRegistry registry=null;
+ Element selectedElement = getSelection();
+ ServicesRegistry registry = null;
try {
registry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event);
} catch (ServiceException e1) {
@@ -57,21 +57,22 @@ public class ModelCompletePluginArchitectureHandler extends ADLToolAbstractHandl
} catch (ServiceException e) {
throw new ExecutionException("Can't get ModelSet", e);
}
- PluginArchitectureWizard bWizard=new PluginArchitectureWizard(false);
- WizardDialog wizardDialog = new WizardDialog(new Shell(),bWizard);
+ PluginArchitectureWizard bWizard = new PluginArchitectureWizard(false);
+ WizardDialog wizardDialog = new WizardDialog(new Shell(), bWizard);
if (wizardDialog.open() == Window.OK) {
TransactionalEditingDomain dom = modelSet.getTransactionalEditingDomain();
- if( selectedElement instanceof Package){
- CompletePluginsArchitectureSnapshotCommand comd= new CompletePluginsArchitectureSnapshotCommand(dom, (Package)selectedElement,bWizard.getSelectedBundle());
+ if (selectedElement instanceof Package) {
+ CompletePluginsArchitectureSnapshotCommand comd = new CompletePluginsArchitectureSnapshotCommand(dom, (Package) selectedElement, bWizard.getSelectedBundle());
dom.getCommandStack().execute(comd);
}
- }
+ }
return null;
}
+
/**
- *
- *{@inheritDoc}
+ *
+ * {@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 ca1a5bd7084..2d3eb49ed0f 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -31,12 +31,14 @@ import org.eclipse.uml2.uml.Package;
/**
* this handler is used to generate the feature and plugin architecture from workspace
- *@deprecated
+ *
+ * @deprecated
*/
+@Deprecated
public class ModelFeatureArchitectureFromWorkspaceHandler extends ADLToolAbstractHandler {
-
+
/**
- *
+ *
* Constructor.
*
*/
@@ -44,8 +46,8 @@ public class ModelFeatureArchitectureFromWorkspaceHandler extends ADLToolAbstrac
}
public Object execute(ExecutionEvent event) throws ExecutionException {
- Element selectedElement=getSelection();
- ServicesRegistry registry=null;
+ Element selectedElement = getSelection();
+ ServicesRegistry registry = null;
try {
registry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event);
} catch (ServiceException e1) {
@@ -57,19 +59,20 @@ public class ModelFeatureArchitectureFromWorkspaceHandler extends ADLToolAbstrac
} catch (ServiceException e) {
throw new ExecutionException("Can't get ModelSet", e);
}
- FeatureArchitectureWizard bWizard=new FeatureArchitectureWizard(true);
- WizardDialog wizardDialog = new WizardDialog(new Shell(),bWizard);
+ FeatureArchitectureWizard bWizard = new FeatureArchitectureWizard(true);
+ WizardDialog wizardDialog = new WizardDialog(new Shell(), bWizard);
if (wizardDialog.open() == Window.OK) {
TransactionalEditingDomain dom = modelSet.getTransactionalEditingDomain();
- if( selectedElement instanceof Package){
- SimpleFeaturesArchitectureSnapshotCommand comd= new SimpleFeaturesArchitectureSnapshotCommand(dom, (Package)selectedElement, bWizard.getSelectedBundle());
+ if (selectedElement instanceof Package) {
+ SimpleFeaturesArchitectureSnapshotCommand comd = new SimpleFeaturesArchitectureSnapshotCommand(dom, (Package) selectedElement, bWizard.getSelectedBundle());
dom.getCommandStack().execute(comd);
}
- }
+ }
+
-
return null;
}
+
/**
* {@inheritDoc}
*/
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 12a400d75c3..b6ebb6fa6ad 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
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -31,11 +31,13 @@ import org.eclipse.uml2.uml.Package;
/**
* this handler is used to generate the architecture from workspace
- *@deprecated
+ *
+ * @deprecated
*/
+@Deprecated
public class ModelPluginArchitectureFromWorkspaceHandler extends ADLToolAbstractHandler {
/**
- *
+ *
* Constructor.
*
*/
@@ -43,8 +45,8 @@ public class ModelPluginArchitectureFromWorkspaceHandler extends ADLToolAbstract
}
public Object execute(ExecutionEvent event) throws ExecutionException {
- Element selectedElement=getSelection();
- ServicesRegistry registry=null;
+ Element selectedElement = getSelection();
+ ServicesRegistry registry = null;
try {
registry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event);
} catch (ServiceException e1) {
@@ -56,19 +58,20 @@ public class ModelPluginArchitectureFromWorkspaceHandler extends ADLToolAbstract
} catch (ServiceException e) {
throw new ExecutionException("Can't get ModelSet", e);
}
- PluginArchitectureWizard bWizard=new PluginArchitectureWizard(true);
- WizardDialog wizardDialog = new WizardDialog(new Shell(),bWizard);
+ PluginArchitectureWizard bWizard = new PluginArchitectureWizard(true);
+ WizardDialog wizardDialog = new WizardDialog(new Shell(), bWizard);
if (wizardDialog.open() == Window.OK) {
TransactionalEditingDomain dom = modelSet.getTransactionalEditingDomain();
- if( selectedElement instanceof Package){
- SimplePluginsArchitectureSnapshotCommand comd= new SimplePluginsArchitectureSnapshotCommand(dom, (Package)selectedElement, bWizard.getSelectedBundle());
+ if (selectedElement instanceof Package) {
+ SimplePluginsArchitectureSnapshotCommand comd = new SimplePluginsArchitectureSnapshotCommand(dom, (Package) selectedElement, bWizard.getSelectedBundle());
dom.getCommandStack().execute(comd);
}
- }
+ }
return null;
}
+
/**
* {@inheritDoc}
*/

Back to the top