Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 11:43:07 +0000
committerCamille Letavernier2014-08-21 13:50:25 +0000
commitdbc038b44bcbb890ae256d15eb09eb285512f020 (patch)
tree757e736583eea3ae352ad9ac91a81df7e59b79ff /plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor
parentea48a20561464c3cbb7895d430583669a9f82fcc (diff)
downloadorg.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.gz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.xz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.zip
[Code style] Apply clean-up and formatter on Main plug-ins
Diffstat (limited to 'plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java54
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/CompoundCommandActionDelegate.java21
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCopyAction.java8
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCutAction.java10
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDeleteAction.java28
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDropAdapter.java22
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoPasteAction.java10
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/ValidationAction.java8
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/ActionBarContributor.java16
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java79
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/util/ActionUtil.java26
11 files changed, 140 insertions, 142 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java
index f748633905e..84139714a5c 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java
@@ -15,7 +15,7 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
-// private CustomizationManager fCustomizationManager;
+ // private CustomizationManager fCustomizationManager;
public static LogHelper log;
@@ -50,41 +50,41 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
-// /**
-// *
-// * @return the customization manager in charge to adapt element in modisco
-// */
-// public CustomizationManager getCustomizationManager() {
-// return org.eclipse.papyrus.infra.emf.Activator.getDefault().getCustomizationManager();
-// // if(this.fCustomizationManager == null) {
-// // this.fCustomizationManager = new CustomizationManager();
-// // init(this.fCustomizationManager);
-// // }
-// // return this.fCustomizationManager;
-// }
+ // /**
+ // *
+ // * @return the customization manager in charge to adapt element in modisco
+ // */
+ // public CustomizationManager getCustomizationManager() {
+ // return org.eclipse.papyrus.infra.emf.Activator.getDefault().getCustomizationManager();
+ // // if(this.fCustomizationManager == null) {
+ // // this.fCustomizationManager = new CustomizationManager();
+ // // init(this.fCustomizationManager);
+ // // }
+ // // return this.fCustomizationManager;
+ // }
- // private void init(final CustomizationManager customizationManager) {
- // customizationManager.setShowContainer(false);
- // customizationManager.setShowDerivedLinks(false);
- // customizationManager.setShowEmptyLinks(false);
+ // private void init(final CustomizationManager customizationManager) {
+ // customizationManager.setShowContainer(false);
+ // customizationManager.setShowDerivedLinks(false);
+ // customizationManager.setShowEmptyLinks(false);
//
- // try {
- // List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
- // for(MetamodelView metamodelView : registryDefaultCustomizations) {
- // customizationManager.registerCustomization(metamodelView);
- // }
+ // try {
+ // List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
+ // for(MetamodelView metamodelView : registryDefaultCustomizations) {
+ // customizationManager.registerCustomization(metamodelView);
+ // }
//
- // customizationManager.loadCustomizations();
- // } catch (Throwable e) {
+ // customizationManager.loadCustomizations();
+ // } catch (Throwable e) {
// Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Error initializing customizations", e)); //$NON-NLS-1$
- // }
- // }
+ // }
+ // }
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/CompoundCommandActionDelegate.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/CompoundCommandActionDelegate.java
index b21be463879..1476cb717cf 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/CompoundCommandActionDelegate.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/CompoundCommandActionDelegate.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -19,7 +19,7 @@ import org.eclipse.swt.graphics.Image;
* An EMF Compound Command with support for Images, Tooltip text and description
* (From CommandActionDelegate)
* The first sub-command should be a CommandActionDelegate
- *
+ *
* @author Camille Letavernier
*/
public class CompoundCommandActionDelegate extends CompoundCommand implements CommandActionDelegate {
@@ -28,32 +28,33 @@ public class CompoundCommandActionDelegate extends CompoundCommand implements Co
/**
* Sets the Image for this command
- *
+ *
* @param image
- * The image to display on the command
+ * The image to display on the command
*/
public void setImage(Image image) {
this.image = image;
}
public Object getImage() {
- if(image == null)
- return ((CommandActionDelegate)getCommandList().get(0)).getImage();
- else
+ if (image == null) {
+ return ((CommandActionDelegate) getCommandList().get(0)).getImage();
+ } else {
return image;
+ }
}
public String getText() {
- return ((CommandActionDelegate)getCommandList().get(0)).getText();
+ return ((CommandActionDelegate) getCommandList().get(0)).getText();
}
public String getToolTipText() {
- return ((CommandActionDelegate)getCommandList().get(0)).getToolTipText();
+ return ((CommandActionDelegate) getCommandList().get(0)).getToolTipText();
}
@Override
public String getDescription() {
- return ((CommandActionDelegate)getCommandList().get(0)).getDescription();
+ return ((CommandActionDelegate) getCommandList().get(0)).getDescription();
}
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCopyAction.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCopyAction.java
index dd9449b01f5..12a08157613 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCopyAction.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCopyAction.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -21,7 +21,7 @@ import org.eclipse.papyrus.infra.emf.editor.util.ActionUtil;
/**
* An adapter for the EMF "Copy" Action, compatible with the
* MoDisco customizable content provider.
- *
+ *
* @author Camille Letavernier
*/
public class MoDiscoCopyAction extends CopyAction {
@@ -34,9 +34,9 @@ public class MoDiscoCopyAction extends CopyAction {
/**
* Constructor.
- *
+ *
* @param domain
- * The Editing domain on which the action will be executed
+ * The Editing domain on which the action will be executed
*/
public MoDiscoCopyAction(EditingDomain domain) {
super(domain);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCutAction.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCutAction.java
index 277ec47fe2b..188072639c8 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCutAction.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoCutAction.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -21,7 +21,7 @@ import org.eclipse.papyrus.infra.emf.editor.util.ActionUtil;
/**
* An adapter for the EMF "Cut" Action, compatible with the
* MoDisco customizable content provider.
- *
+ *
* @author Camille Letavernier
*/
public class MoDiscoCutAction extends CutAction {
@@ -33,11 +33,11 @@ public class MoDiscoCutAction extends CutAction {
}
/**
- *
+ *
* Constructor.
- *
+ *
* @param domain
- * The Editing domain on which the command will be executed
+ * The Editing domain on which the command will be executed
*/
public MoDiscoCutAction(EditingDomain domain) {
super(domain);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDeleteAction.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDeleteAction.java
index 0a9a67120bd..06aa83514fc 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDeleteAction.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDeleteAction.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -21,20 +21,20 @@ import org.eclipse.papyrus.infra.emf.editor.util.ActionUtil;
/**
* An adapter for the EMF "Delete" Action, compatible with the
* MoDisco customizable content provider.
- *
+ *
* @author Camille Letavernier
*/
public class MoDiscoDeleteAction extends DeleteAction {
/**
* Constructor.
- *
+ *
* @param domain
- * The editing domain on which the action will be called
+ * The editing domain on which the action will be called
* @param removeAllReferences
- * If true, all references to the deleted object will be removed.
- * This causes the whole resourceSet to be loaded, which may
- * lead to performance issues.
+ * If true, all references to the deleted object will be removed.
+ * This causes the whole resourceSet to be loaded, which may
+ * lead to performance issues.
*/
public MoDiscoDeleteAction(EditingDomain domain, boolean removeAllReferences) {
super(domain, removeAllReferences);
@@ -42,22 +42,22 @@ public class MoDiscoDeleteAction extends DeleteAction {
/**
* Constructor. All references to the deleted object will be removed.
- *
+ *
* @param domain
- * The editing domain on which the action will be called
+ * The editing domain on which the action will be called
*/
public MoDiscoDeleteAction(EditingDomain domain) {
super(domain);
}
/**
- *
+ *
* Constructor.
- *
+ *
* @param removeAllReferences
- * If true, all references to the deleted object will be removed.
- * This causes the whole resourceSet to be loaded, which may
- * lead to performance issues.
+ * If true, all references to the deleted object will be removed.
+ * This causes the whole resourceSet to be loaded, which may
+ * lead to performance issues.
*/
public MoDiscoDeleteAction(boolean removeAllReferences) {
super(removeAllReferences);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDropAdapter.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDropAdapter.java
index ab57b1224b3..1905587ca43 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDropAdapter.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoDropAdapter.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -25,19 +25,19 @@ import org.eclipse.swt.widgets.Widget;
/**
* An adapter for Drag & Drop in the Context editor. The default Ecore drag & drop
* is not compatible with the EMF Facet Tree Elements
- *
+ *
* @author Camille Letavernier
*/
public class MoDiscoDropAdapter extends EditingDomainViewerDropAdapter {
/**
- *
+ *
* Constructor.
- *
+ *
* @param domain
- * The Editing domain for this Drop Adapter
+ * The Editing domain for this Drop Adapter
* @param viewer
- * The Viewer for this Drop Adapter
+ * The Viewer for this Drop Adapter
*/
public MoDiscoDropAdapter(EditingDomain domain, Viewer viewer) {
super(domain, viewer);
@@ -45,8 +45,8 @@ public class MoDiscoDropAdapter extends EditingDomainViewerDropAdapter {
@Override
protected Collection<?> extractDragSource(Object object) {
- if(object instanceof ISelection) {
- return super.extractDragSource(ActionUtil.getAdaptedSelection((ISelection)object));
+ if (object instanceof ISelection) {
+ return super.extractDragSource(ActionUtil.getAdaptedSelection((ISelection) object));
} else {
return super.extractDragSource(object);
}
@@ -55,9 +55,9 @@ public class MoDiscoDropAdapter extends EditingDomainViewerDropAdapter {
@Override
protected Object extractDropTarget(Widget item) {
Object dropTarget = super.extractDropTarget(item);
- if(dropTarget instanceof IAdaptable) {
- Object adapter = ((IAdaptable)dropTarget).getAdapter(EObject.class);
- if(adapter != null) {
+ if (dropTarget instanceof IAdaptable) {
+ Object adapter = ((IAdaptable) dropTarget).getAdapter(EObject.class);
+ if (adapter != null) {
return adapter;
}
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoPasteAction.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoPasteAction.java
index 41345871d9f..4abe4b255fe 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoPasteAction.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/MoDiscoPasteAction.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -21,7 +21,7 @@ import org.eclipse.papyrus.infra.emf.editor.util.ActionUtil;
/**
* An adapter for the EMF "Paste" Action, compatible with the
* MoDisco customizable content provider.
- *
+ *
* @author Camille Letavernier
*/
public class MoDiscoPasteAction extends PasteAction {
@@ -33,11 +33,11 @@ public class MoDiscoPasteAction extends PasteAction {
}
/**
- *
+ *
* Constructor.
- *
+ *
* @param domain
- * The editing domain on which the command will be called
+ * The editing domain on which the command will be called
*/
public MoDiscoPasteAction(EditingDomain domain) {
super(domain);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/ValidationAction.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/ValidationAction.java
index 7a5108d6caf..9a7aa0cbc46 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/ValidationAction.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/actions/ValidationAction.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011 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
@@ -19,13 +19,13 @@ import org.eclipse.papyrus.infra.emf.editor.util.ActionUtil;
/**
* An adapter for the EMF "Validate" Action, compatible with the
* MoDisco customizable content provider.
- *
+ *
* @author Camille Letavernier
*/
public class ValidationAction extends ValidateAction {
public ValidationAction() {
- //Nothing
+ // Nothing
}
public ValidationAction(EditingDomain domain) {
@@ -38,6 +38,6 @@ public class ValidationAction extends ValidateAction {
@Override
public boolean updateSelection(IStructuredSelection selection) {
- return super.updateSelection((IStructuredSelection)ActionUtil.getAdaptedSelection(selection));
+ return super.updateSelection((IStructuredSelection) ActionUtil.getAdaptedSelection(selection));
}
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/ActionBarContributor.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/ActionBarContributor.java
index fd96e5b918a..47b01f7e4dd 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/ActionBarContributor.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/ActionBarContributor.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -38,7 +38,7 @@ import org.eclipse.papyrus.infra.emf.newchild.runtime.NewchildManager;
* The Action bar contributor for the Context Editor
* Mainly serves as an Adapter for the Ecore actions, as the Ecore actions are
* not natively compatible with the EMF Facet tree objects
- *
+ *
* @author Camille Letavernier
*/
public class ActionBarContributor extends EcoreActionBarContributor {
@@ -46,9 +46,9 @@ public class ActionBarContributor extends EcoreActionBarContributor {
protected IStructuredSelection lastSelection;
/**
- *
+ *
* Constructor.
- *
+ *
*/
public ActionBarContributor() {
super();
@@ -56,8 +56,8 @@ public class ActionBarContributor extends EcoreActionBarContributor {
}
public void setEditingDomain(EditingDomain domain) {
- if(validateAction instanceof ValidationAction) {
- ((ValidationAction)validateAction).setEditingDomain(domain);
+ if (validateAction instanceof ValidationAction) {
+ ((ValidationAction) validateAction).setEditingDomain(domain);
}
}
@@ -91,8 +91,8 @@ public class ActionBarContributor extends EcoreActionBarContributor {
super.selectionChanged(newEvent);
- if(newSelection instanceof IStructuredSelection) {
- this.lastSelection = (IStructuredSelection)newSelection;
+ if (newSelection instanceof IStructuredSelection) {
+ this.lastSelection = (IStructuredSelection) newSelection;
} else {
this.lastSelection = null;
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java
index 1ead2651e20..a8555e8bb3d 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java
@@ -31,11 +31,8 @@ import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationCatalogManager;
import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
import org.eclipse.papyrus.emf.facet.custom.ui.ICustomizedContentProviderFactory;
-import org.eclipse.papyrus.infra.emf.Activator;
import org.eclipse.papyrus.infra.emf.editor.actions.MoDiscoDropAdapter;
import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider;
import org.eclipse.papyrus.infra.widgets.editors.AbstractEditor;
@@ -62,15 +59,15 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
/**
* An extended EMF editor
- *
+ *
* This generic editor provides the following features :
- *
+ *
* - EMF Facet browser customization
* - Papyrus customizable property view
* - Papyrus customizable new child
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetPageContributor, CommandStackListener {
@@ -93,15 +90,15 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
Composite gParent = new Composite(getContainer(), SWT.NONE);
gParent.setLayout(new FillLayout());
- //SashForm parent = new SashForm(gParent, SWT.VERTICAL | SWT.V_SCROLL | SWT.H_SCROLL);
- //parent.setLayout(new FillLayout());
+ // SashForm parent = new SashForm(gParent, SWT.VERTICAL | SWT.V_SCROLL | SWT.H_SCROLL);
+ // parent.setLayout(new FillLayout());
Composite parent = new Composite(gParent, SWT.NONE);
parent.setLayout(new PropertiesLayout());
// Only creates the other pages if there is something that can be edited
//
- if(!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
// Create a page for the selection tree view.
//
@@ -112,7 +109,7 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
filterPattern.addCommitListener(new ICommitListener() {
public void commit(AbstractEditor editor) {
- filter.setPattern((String)filterPattern.getValue());
+ filter.setPattern((String) filterPattern.getValue());
selectionViewer.refresh();
}
@@ -122,7 +119,7 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
selectionViewer = new TreeViewer(tree);
- selectionViewer.setFilters(new ViewerFilter[]{ filter });
+ selectionViewer.setFilters(new ViewerFilter[] { filter });
setCurrentViewer(selectionViewer);
initializeCustomizationCatalogManager();
@@ -137,7 +134,7 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
selectionViewer.setLabelProvider(labelProvider);
selectionViewer.setInput(getTreeViewerInput());
- // selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ // selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
@@ -147,9 +144,9 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
setActivePage(0);
- // Preview preview = new Preview(this);
- // preview.createPartControl(parent);
- // addPreview(preview);
+ // Preview preview = new Preview(this);
+ // preview.createPartControl(parent);
+ // addPreview(preview);
parent.layout();
}
@@ -163,7 +160,7 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
@Override
public void controlResized(ControlEvent event) {
- if(!guard) {
+ if (!guard) {
guard = true;
hideTabs();
guard = false;
@@ -171,8 +168,8 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
}
});
- if(getActionBarContributor() instanceof ActionBarContributor) {
- ((ActionBarContributor)getActionBarContributor()).setEditingDomain(getEditingDomain());
+ if (getActionBarContributor() instanceof ActionBarContributor) {
+ ((ActionBarContributor) getActionBarContributor()).setEditingDomain(getEditingDomain());
}
updateProblemIndication();
@@ -180,8 +177,8 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
protected Object getTreeViewerInput() {
List<EObject> roots = new LinkedList<EObject>();
- for(Resource resource : getResourceSet().getResources()) {
- for(EObject rootEObject : resource.getContents()) {
+ for (Resource resource : getResourceSet().getResources()) {
+ for (EObject rootEObject : resource.getContents()) {
roots.add(rootEObject);
}
}
@@ -218,15 +215,15 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
// Try to select the affected objects.
//
- Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
- if(mostRecentCommand != null) {
+ Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
setSelectionToViewer(mostRecentCommand.getAffectedObjects());
}
Iterator<PropertySheetPage> propertySheetPagesIterator = propertySheetPages.iterator();
- while(propertySheetPagesIterator.hasNext()) {
+ while (propertySheetPagesIterator.hasNext()) {
PropertySheetPage propertySheetPage = propertySheetPagesIterator.next();
- if(propertySheetPage.getControl().isDisposed()) {
+ if (propertySheetPage.getControl().isDisposed()) {
propertySheetPagesIterator.remove();
} else {
propertySheetPage.refresh();
@@ -253,14 +250,14 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
viewer.getControl().setMenu(menu);
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
- Transfer[] transfers = new Transfer[]{ LocalTransfer.getInstance() };
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
viewer.addDropSupport(dndOperations, transfers, new MoDiscoDropAdapter(editingDomain, viewer));
}
@Override
public IPropertySheetPage getPropertySheetPage() {
- if(iPropertySheetPage == null) {
+ if (iPropertySheetPage == null) {
iPropertySheetPage = new TabbedPropertySheetPage(this);
}
return iPropertySheetPage;
@@ -268,22 +265,22 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
protected ICustomizationManager getCustomizationManager() {
return org.eclipse.papyrus.infra.emf.Activator.getDefault().getCustomizationManager();
-// if(customizationManager == null) {
-// customizationManager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(getResourceSet());
-// }
-// return customizationManager;
+ // if(customizationManager == null) {
+ // customizationManager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(getResourceSet());
+ // }
+ // return customizationManager;
}
protected void initializeCustomizationCatalogManager() {
-// ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(getResourceSet());
-// ICustomizationCatalogManager customCatalog = Activator.getDefault().getCustomizationManager()
-// List<Customization> allCustomizations = customCatalog.getRegisteredCustomizations();
-// for(Customization customization : allCustomizations) {
-// if(customization.isMustBeLoadedByDefault()) {
-// System.out.println("Apply default customization: " + customization.getName());
-// getCustomizationManager().getManagedCustomizations().add(customization);
-// }
-// }
+ // ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(getResourceSet());
+ // ICustomizationCatalogManager customCatalog = Activator.getDefault().getCustomizationManager()
+ // List<Customization> allCustomizations = customCatalog.getRegisteredCustomizations();
+ // for(Customization customization : allCustomizations) {
+ // if(customization.isMustBeLoadedByDefault()) {
+ // System.out.println("Apply default customization: " + customization.getName());
+ // getCustomizationManager().getManagedCustomizations().add(customization);
+ // }
+ // }
}
protected IStructuredContentProvider createContentProvider() {
@@ -295,7 +292,7 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
}
protected ILabelProvider createLabelProvider() {
-// return IResolvingCustomizedLabelProviderFactory.DEFAULT.createCustomizedLabelProvider(getCustomizationManager());
+ // return IResolvingCustomizedLabelProviderFactory.DEFAULT.createCustomizedLabelProvider(getCustomizationManager());
return new EMFLabelProvider();
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/util/ActionUtil.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/util/ActionUtil.java
index 4ac9ad61cbf..b8662fc5e07 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/util/ActionUtil.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/util/ActionUtil.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 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
@@ -23,9 +23,9 @@ import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
/**
* Utility class for Actions
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class ActionUtil {
@@ -36,17 +36,17 @@ public class ActionUtil {
* themselves. This method adapts a collections of such objects to their
* underlying EObjects, so that EMF can handle them.
* Objects that cannot be adapted remain as-is in the collection.
- *
+ *
* @param selection
- * The collection to adapt
+ * The collection to adapt
* @return
* The adapted selection
*/
public static Collection<Object> getAdaptedSelection(Collection<? extends Object> selection) {
Collection<Object> newSelection = new LinkedList<Object>();
- for(Object o : selection) {
+ for (Object o : selection) {
EObject adaptedEObject = EMFHelper.getEObject(o);
- if(adaptedEObject != null) {
+ if (adaptedEObject != null) {
newSelection.add(adaptedEObject);
} else {
newSelection.add(o);
@@ -62,22 +62,22 @@ public class ActionUtil {
* themselves. This method adapts a ISelection of such objects to their
* underlying EObjects, so that EMF can handle them.
* Objects that cannot be adapted remain as-is in the selection.
- *
+ *
* @param sourceSelection
- * The selection to adapt
+ * The selection to adapt
* @return
* The adapted selection
*/
public static ISelection getAdaptedSelection(ISelection sourceSelection) {
- if(sourceSelection instanceof StructuredSelection) {
- StructuredSelection currentSelection = (StructuredSelection)sourceSelection;
+ if (sourceSelection instanceof StructuredSelection) {
+ StructuredSelection currentSelection = (StructuredSelection) sourceSelection;
List<Object> newSelection = new LinkedList<Object>();
Iterator<?> it = currentSelection.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
Object object = it.next();
EObject adaptedEObject = EMFHelper.getEObject(object);
- if(adaptedEObject != null) {
+ if (adaptedEObject != null) {
newSelection.add(adaptedEObject);
} else {
newSelection.add(object);

Back to the top