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/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties
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/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/Activator.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/AppearanceConstraint.java22
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java18
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java17
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsDecorableElementConstraint.java16
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java10
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsSingleDiagramEditorConstraint.java14
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/AbstractDiagramPreferencesObservableValue.java20
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/BooleanDiagramViewObservableValue.java32
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java34
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientDataObservableValue.java36
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java20
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/IntegerDiagramViewObservableValue.java32
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/ObservableGradientData.java36
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java26
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/NotationStyleHandlerProvider.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/StyleHandlerManager.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/messages/Messages.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/AppearanceModelElementFactory.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java26
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElement.java30
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElementFactory.java8
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java48
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GradientDataModelElement.java40
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/NotationModelElementFactory.java38
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulerAndGridModelElement.java72
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulersAndGridModelElementFactory.java18
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/StyleHandlerProvider.java20
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java33
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java56
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java14
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/RulersAndGridPropertyConstants.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/widget/DiagramPreferencesDefaultButton.java35
34 files changed, 424 insertions, 387 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/Activator.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/Activator.java
index bf276c6fd2f..e5f4efceb53 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/Activator.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/Activator.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
@@ -64,7 +64,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/AppearanceConstraint.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/AppearanceConstraint.java
index 375e41bb12e..49064906064 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/AppearanceConstraint.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/AppearanceConstraint.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 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,7 +25,7 @@ import org.eclipse.papyrus.infra.gmfdiag.properties.modelelement.StyleHandlerPro
/**
* A constraint matching an Object on which the Appearance properties can
* be applied. This constraint dispatches
- *
+ *
* @author Camille Letavernier
*/
public class AppearanceConstraint implements Constraint {
@@ -38,10 +38,10 @@ public class AppearanceConstraint implements Constraint {
public AppearanceConstraint() {
constraints = new LinkedList<Constraint>();
- for(StyleHandlerProvider provider : StyleHandlerManager.instance.getStyleHandlerProviders()) {
+ for (StyleHandlerProvider provider : StyleHandlerManager.instance.getStyleHandlerProviders()) {
try {
Constraint constraint = provider.createConstraint();
- if(constraint == null) {
+ if (constraint == null) {
Activator.log.warn("StyleHandlerProvider " + provider.getClass().getName() + " provided an invalid Constraint");
} else {
constraints.add(constraint);
@@ -53,13 +53,13 @@ public class AppearanceConstraint implements Constraint {
}
public boolean overrides(Constraint constraint) {
- //Unsupported. The appearance property view constraints are not automatically overrideable
+ // Unsupported. The appearance property view constraints are not automatically overrideable
return false;
}
public boolean match(IStructuredSelection selection) {
- for(Constraint constraint : constraints) {
- if(constraint.match(selection)) {
+ for (Constraint constraint : constraints) {
+ if (constraint.match(selection)) {
return true;
}
}
@@ -70,7 +70,7 @@ public class AppearanceConstraint implements Constraint {
this.descriptor = descriptor;
display = getDisplay(descriptor);
- for(Constraint constraint : constraints) {
+ for (Constraint constraint : constraints) {
try {
constraint.setConstraintDescriptor(descriptor);
} catch (Exception ex) {
@@ -84,9 +84,9 @@ public class AppearanceConstraint implements Constraint {
}
private DisplayUnit getDisplay(ConstraintDescriptor descriptor) {
- if(descriptor.getDisplay() == null) {
- if(descriptor.eContainer() instanceof ConstraintDescriptor) {
- return getDisplay((ConstraintDescriptor)descriptor.eContainer());
+ if (descriptor.getDisplay() == null) {
+ if (descriptor.eContainer() instanceof ConstraintDescriptor) {
+ return getDisplay((ConstraintDescriptor) descriptor.eContainer());
}
}
return descriptor.getDisplay();
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java
index 6b78eb9fe03..cec54f28f80 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/GMFNotationConstraint.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
@@ -22,9 +22,9 @@ import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
* Retrieves the notation model from the selection,
* then applies an EMFInstanceOfConstraint on the resulting
* EObject
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class GMFNotationConstraint extends EMFInstanceOfConstraint {
@@ -36,17 +36,17 @@ public class GMFNotationConstraint extends EMFInstanceOfConstraint {
View view = null;
- if(selection instanceof EditPart) {
- EditPart part = (EditPart)selection;
+ if (selection instanceof EditPart) {
+ EditPart part = (EditPart) selection;
Object model = part.getModel();
- if(model instanceof View) {
- view = (View)model;
+ if (model instanceof View) {
+ view = (View) model;
}
}
EObject eObject = EMFHelper.getEObject(selection);
- if(eObject instanceof View) {
- view = (View)eObject;
+ if (eObject instanceof View) {
+ view = (View) eObject;
}
return view == null ? false : super.match(view);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java
index 25d03b481c4..439b5c37baa 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/HasEditPolicy.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
@@ -17,11 +17,11 @@ import org.eclipse.papyrus.infra.constraints.constraints.AbstractConstraint;
import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
/**
- *
+ *
* A constraint to test whether an object has the given EditPolicy or not
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class HasEditPolicy extends AbstractConstraint {
@@ -33,9 +33,10 @@ public class HasEditPolicy extends AbstractConstraint {
/**
* {@inheritDoc}
*/
+ @Override
public boolean match(Object selection) {
- if(editPolicyID != null && selection instanceof GraphicalEditPart) {
- return ((GraphicalEditPart)selection).getEditPolicy(editPolicyID) != null;
+ if (editPolicyID != null && selection instanceof GraphicalEditPart) {
+ return ((GraphicalEditPart) selection).getEditPolicy(editPolicyID) != null;
}
return false;
@@ -54,11 +55,11 @@ public class HasEditPolicy extends AbstractConstraint {
*/
@Override
protected boolean equivalent(Constraint constraint) {
- if(constraint == null) {
+ if (constraint == null) {
return false;
}
- return constraint instanceof HasEditPolicy && ((HasEditPolicy)constraint).editPolicyID == editPolicyID;
+ return constraint instanceof HasEditPolicy && ((HasEditPolicy) constraint).editPolicyID == editPolicyID;
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsDecorableElementConstraint.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsDecorableElementConstraint.java
index b45654d5e0f..ca1aa292aae 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsDecorableElementConstraint.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsDecorableElementConstraint.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -20,6 +20,7 @@ import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.constraints.constraints.AbstractConstraint;
import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
+
//import org.eclipse.papyrus.infra.gmfdiag.common.providers.ShapeDecorator;
@@ -31,12 +32,13 @@ public class IsDecorableElementConstraint extends AbstractConstraint {
/**
* {@inheritDoc}
*/
+ @Override
public boolean match(Object selection) {
- if(selection instanceof IAdaptable) {
- View node = (View)((IAdaptable)selection).getAdapter(View.class);
- if(node != null && !(node instanceof Diagram)) {
- DescriptionStyle descStyle = (DescriptionStyle)node.getStyle(NotationPackage.eINSTANCE.getDescriptionStyle());
- if(descStyle != null) {
+ if (selection instanceof IAdaptable) {
+ View node = (View) ((IAdaptable) selection).getAdapter(View.class);
+ if (node != null && !(node instanceof Diagram)) {
+ DescriptionStyle descStyle = (DescriptionStyle) node.getStyle(NotationPackage.eINSTANCE.getDescriptionStyle());
+ if (descStyle != null) {
return true;
}
}
@@ -50,7 +52,7 @@ public class IsDecorableElementConstraint extends AbstractConstraint {
*/
@Override
protected boolean equivalent(Constraint constraint) {
- if(constraint == null) {
+ if (constraint == null) {
return false;
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java
index 2a716fea4a8..5b71aefd735 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsEditPartConstraint.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
@@ -18,7 +18,7 @@ import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
/**
* Tests if the selection is an EditPart (Excluding DiagramEditPart)
- *
+ *
* @author Camille Letavernier
*/
public class IsEditPartConstraint extends AbstractConstraint {
@@ -33,9 +33,9 @@ public class IsEditPartConstraint extends AbstractConstraint {
*/
@Override
protected boolean equivalent(Constraint constraint) {
- //TODO : This should probably not always be false
- //Potential issue : the CompositeConstraint won't be able to
- //automatically find the overriding constraints
+ // TODO : This should probably not always be false
+ // Potential issue : the CompositeConstraint won't be able to
+ // automatically find the overriding constraints
return false;
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsSingleDiagramEditorConstraint.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsSingleDiagramEditorConstraint.java
index a68337a0f75..df8c9b4013e 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsSingleDiagramEditorConstraint.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/constraint/IsSingleDiagramEditorConstraint.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -18,23 +18,23 @@ import org.eclipse.papyrus.infra.constraints.constraints.JavaQuery;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil;
/**
- *
+ *
* A constraint to know if we are able to get a diagram editor from the selection
- *
+ *
*/
public class IsSingleDiagramEditorConstraint implements JavaQuery {
/**
- *
+ *
* @see org.eclipse.papyrus.infra.constraints.constraints.JavaQuery#match(java.lang.Object)
- *
+ *
* @param selection
* @return
*/
public boolean match(Object selection) {
- if(selection instanceof EditPart) {
- return DiagramEditPartsUtil.getDiagramWorkspacePreferenceStore((EditPart)selection) != null;
+ if (selection instanceof EditPart) {
+ return DiagramEditPartsUtil.getDiagramWorkspacePreferenceStore((EditPart) selection) != null;
}
return false;
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/AbstractDiagramPreferencesObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/AbstractDiagramPreferencesObservableValue.java
index 95ce8f2d3e8..0ba3a861e14 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/AbstractDiagramPreferencesObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/AbstractDiagramPreferencesObservableValue.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -21,9 +21,9 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
/**
- *
+ *
* This observable value listen the preference store to send event and refresh itself when a preferences has changed
- *
+ *
*/
public abstract class AbstractDiagramPreferencesObservableValue extends AbstractObservableValue {
@@ -43,13 +43,13 @@ public abstract class AbstractDiagramPreferencesObservableValue extends Abstract
private IPropertyChangeListener listener;
/**
- *
+ *
* Constructor.
- *
+ *
* @param diagram
- * the diagram for which we re editing a preference
+ * the diagram for which we re editing a preference
* @param preferenceName
- * the name of edited the preference
+ * the name of edited the preference
*/
public AbstractDiagramPreferencesObservableValue(final Diagram diagram, final String preferenceName, final IPreferenceStore editedPreferenceStore) {
this.preferenceName = preferenceName;
@@ -57,7 +57,7 @@ public abstract class AbstractDiagramPreferencesObservableValue extends Abstract
this.editedPreferenceStore.addPropertyChangeListener(this.listener = new IPropertyChangeListener() {
public void propertyChange(final PropertyChangeEvent event) {
- if(getEditedPreference().equals(event.getProperty())) {
+ if (getEditedPreference().equals(event.getProperty())) {
ValueDiff diff = new ValueDiff() {
@Override
@@ -84,7 +84,7 @@ public abstract class AbstractDiagramPreferencesObservableValue extends Abstract
}
/**
- *
+ *
* @return
* the edited preferences
*/
@@ -93,7 +93,7 @@ public abstract class AbstractDiagramPreferencesObservableValue extends Abstract
}
/**
- *
+ *
* @return
* the edited preference store
*/
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/BooleanDiagramViewObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/BooleanDiagramViewObservableValue.java
index fb94fe629e4..88724629823 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/BooleanDiagramViewObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/BooleanDiagramViewObservableValue.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -18,31 +18,31 @@ import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.preference.IPreferenceStore;
/**
- *
+ *
* Class used to edit boolean preference
- *
+ *
*/
public class BooleanDiagramViewObservableValue extends AbstractDiagramPreferencesObservableValue {
/**
- *
+ *
* Constructor.
- *
+ *
* @param diagram
- * the edited diagram
+ * the edited diagram
* @param preferenceName
- * the edited preference
+ * the edited preference
* @param preferenceStore
- * the edited preference store
+ * the edited preference store
*/
public BooleanDiagramViewObservableValue(final Diagram diagram, final String preferenceName, IPreferenceStore preferenceStore) {
super(diagram, preferenceName, preferenceStore);
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType()
- *
+ *
* @return
*/
public final Object getValueType() {
@@ -50,9 +50,9 @@ public class BooleanDiagramViewObservableValue extends AbstractDiagramPreference
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doGetValue()
- *
+ *
* @return
*/
@Override
@@ -62,16 +62,16 @@ public class BooleanDiagramViewObservableValue extends AbstractDiagramPreference
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doSetValue(java.lang.Object)
- *
+ *
* @param value
*/
@Override
protected void doSetValue(Object value) {
- if(value instanceof Boolean) {
+ if (value instanceof Boolean) {
final IPreferenceStore wsPreferenceStore = getEditedPreferenceStore();
- wsPreferenceStore.setValue(getEditedPreference(), ((Boolean)value).booleanValue());
+ wsPreferenceStore.setValue(getEditedPreference(), ((Boolean) value).booleanValue());
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java
index 2702a1cda47..58f7ef22c18 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/DoubleDiagramViewObservaleValue.java
@@ -6,31 +6,31 @@ import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.preference.IPreferenceStore;
/**
- *
+ *
* Class used to edit double preferences
- *
+ *
*/
public class DoubleDiagramViewObservaleValue extends AbstractDiagramPreferencesObservableValue {
/**
- *
+ *
* Constructor.
- *
+ *
* @param diagram
- * the edited diagram
+ * the edited diagram
* @param preferenceName
- * the edited preference
+ * the edited preference
* @param store
- * the edited preference store
+ * the edited preference store
*/
public DoubleDiagramViewObservaleValue(final Diagram diagram, final String preferenceName, final IPreferenceStore store) {
super(diagram, preferenceName, store);
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType()
- *
+ *
* @return
*/
public final Object getValueType() {
@@ -38,9 +38,9 @@ public class DoubleDiagramViewObservaleValue extends AbstractDiagramPreferencesO
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doGetValue()
- *
+ *
* @return
*/
@Override
@@ -50,17 +50,17 @@ public class DoubleDiagramViewObservaleValue extends AbstractDiagramPreferencesO
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doSetValue(java.lang.Object)
- *
+ *
* @param value
*/
@Override
protected void doSetValue(final Object value) {
- if(value instanceof Float) {
+ if (value instanceof Float) {
final IPreferenceStore wsPreferenceStore = getEditedPreferenceStore();
- final double oldValue = (Double)doGetValue();
- wsPreferenceStore.setValue(getEditedPreference(), ((Float)value).doubleValue());
+ final double oldValue = (Double) doGetValue();
+ wsPreferenceStore.setValue(getEditedPreference(), ((Float) value).doubleValue());
final ValueDiff diff = new ValueDiff() {
@Override
@@ -70,7 +70,7 @@ public class DoubleDiagramViewObservaleValue extends AbstractDiagramPreferencesO
@Override
public Object getNewValue() {
- return ((Float)value).doubleValue();
+ return ((Float) value).doubleValue();
}
};
fireValueChange(diff);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientDataObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientDataObservableValue.java
index d6b0af38fa2..b2fafd21d2a 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientDataObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientDataObservableValue.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
@@ -17,7 +17,7 @@ import org.eclipse.gmf.runtime.notation.datatype.GradientData;
/**
* An ObservableValue for GradientData
* The GradientData is not a pure EMF object
- *
+ *
* @author Camille Letavernier
*/
public class GradientDataObservableValue extends AbstractObservableValue {
@@ -27,13 +27,13 @@ public class GradientDataObservableValue extends AbstractObservableValue {
private GradientProperty property;
/**
- *
+ *
* Constructor.
- *
+ *
* @param data
- * The GradientData to observe
+ * The GradientData to observe
* @param property
- * The name of the property to observe
+ * The name of the property to observe
*/
public GradientDataObservableValue(GradientData data, String property) {
this.data = data;
@@ -46,11 +46,11 @@ public class GradientDataObservableValue extends AbstractObservableValue {
@Override
protected Object doGetValue() {
- if(data == null) {
+ if (data == null) {
return null;
}
- switch(property) {
+ switch (property) {
case gradientColor1:
return data.getGradientColor1();
case gradientColor2:
@@ -58,8 +58,8 @@ public class GradientDataObservableValue extends AbstractObservableValue {
case gradientStyle:
return data.getGradientStyle();
case activate:
- if(data instanceof ObservableGradientData) {
- return ((ObservableGradientData)data).getActivate();
+ if (data instanceof ObservableGradientData) {
+ return ((ObservableGradientData) data).getActivate();
} else {
return true;
}
@@ -70,30 +70,30 @@ public class GradientDataObservableValue extends AbstractObservableValue {
@Override
protected void doSetValue(Object value) {
- if(data == null) {
+ if (data == null) {
return;
}
- switch(property) {
+ switch (property) {
case gradientColor1:
- data.setGradientColor1((Integer)value);
+ data.setGradientColor1((Integer) value);
break;
case gradientColor2:
- data.setGradientColor2((Integer)value);
+ data.setGradientColor2((Integer) value);
break;
case gradientStyle:
- data.setGradientStyle((Integer)value);
+ data.setGradientStyle((Integer) value);
break;
case activate:
- if(data instanceof ObservableGradientData) {
- ((ObservableGradientData)data).setActivate((Boolean)value);
+ if (data instanceof ObservableGradientData) {
+ ((ObservableGradientData) data).setActivate((Boolean) value);
}
}
}
/**
* The list of properties that can be used by the GradientDataObservableValue
- *
+ *
* @author Camille Letavernier
*/
public static enum GradientProperty {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java
index 11cdef4f794..3292c6243c4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/GradientObservableValue.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,24 +19,24 @@ import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
/**
* An IObservableValue for a Gradient
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class GradientObservableValue extends PapyrusObservableValue {
private ObservableGradientData gradientData;
/**
- *
+ *
* Constructor.
- *
+ *
* @param source
- * The EObject owning the gradient data
+ * The EObject owning the gradient data
* @param feature
- * The Feature in which the gradient data is set
+ * The Feature in which the gradient data is set
* @param domain
- * The editing domain on which the commands will be executed
+ * The editing domain on which the commands will be executed
*/
public GradientObservableValue(EObject source, EStructuralFeature feature, EditingDomain domain) {
super(source, feature, domain);
@@ -44,8 +44,8 @@ public class GradientObservableValue extends PapyrusObservableValue {
@Override
protected Object doGetValue() {
- if(gradientData == null) {
- GradientData data = (GradientData)eObject.eGet(eStructuralFeature);
+ if (gradientData == null) {
+ GradientData data = (GradientData) eObject.eGet(eStructuralFeature);
gradientData = new ObservableGradientData(this, data);
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/IntegerDiagramViewObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/IntegerDiagramViewObservableValue.java
index f89b117504a..f5d49660741 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/IntegerDiagramViewObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/IntegerDiagramViewObservableValue.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -18,31 +18,31 @@ import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.preference.IPreferenceStore;
/**
- *
+ *
* Class used to edit integer preferences
- *
+ *
*/
public class IntegerDiagramViewObservableValue extends AbstractDiagramPreferencesObservableValue {
/**
- *
+ *
* Constructor.
- *
+ *
* @param diagram
- * the edited diagram
+ * the edited diagram
* @param preferenceName
- * the name of the edited preference
+ * the name of the edited preference
* @param store
- * the edited preference store
+ * the edited preference store
*/
public IntegerDiagramViewObservableValue(final Diagram diagram, final String preferenceName, final IPreferenceStore store) {
super(diagram, preferenceName, store);
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType()
- *
+ *
* @return
*/
public final Object getValueType() {
@@ -50,9 +50,9 @@ public class IntegerDiagramViewObservableValue extends AbstractDiagramPreference
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doGetValue()
- *
+ *
* @return
*/
@Override
@@ -62,16 +62,16 @@ public class IntegerDiagramViewObservableValue extends AbstractDiagramPreference
}
/**
- *
+ *
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doSetValue(java.lang.Object)
- *
+ *
* @param value
*/
@Override
protected void doSetValue(Object value) {
- if(value instanceof Integer) {
+ if (value instanceof Integer) {
final IPreferenceStore wsPreferenceStore = getEditedPreferenceStore();
- wsPreferenceStore.setValue(getEditedPreference(), ((Integer)value).intValue());
+ wsPreferenceStore.setValue(getEditedPreference(), ((Integer) value).intValue());
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/ObservableGradientData.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/ObservableGradientData.java
index 5520af4ff41..5d353a4294b 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/ObservableGradientData.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/ObservableGradientData.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011, 2014 CEA LIST 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
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 323802
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.databinding;
@@ -21,14 +21,14 @@ import org.eclipse.gmf.runtime.notation.datatype.GradientData;
/**
* This class encapsulates a gradient data, which may be null (If the
* gradient is not activated).
- *
+ *
* If the gradient data is null, it will be created just-in-time when
* setters are called.
- *
+ *
* This class has an additional property, {@link #activate}.
* activate = false implies that the gradient data has not been set
* (gradient data = null)
- *
+ *
* @author Camille Letavernier
*/
public class ObservableGradientData extends GradientData {
@@ -40,14 +40,14 @@ public class ObservableGradientData extends GradientData {
private boolean activate;
/**
- *
+ *
* Constructor.
- *
+ *
* @param source
- * The IObservableValue containing the gradient data. It will be
- * notified when the gradient data is changed
+ * The IObservableValue containing the gradient data. It will be
+ * notified when the gradient data is changed
* @param encapsulated
- * The encapsulated gradient data. May be null
+ * The encapsulated gradient data. May be null
*/
public ObservableGradientData(IObservableValue source, GradientData encapsulated) {
this.encapsulated = new GradientData(encapsulated);
@@ -75,7 +75,7 @@ public class ObservableGradientData extends GradientData {
* occurred
*/
protected void notifySource() {
- if(activate) {
+ if (activate) {
source.setValue(new GradientData(encapsulated));
} else {
source.setValue(null);
@@ -111,7 +111,7 @@ public class ObservableGradientData extends GradientData {
}
/**
- *
+ *
* @return true if this gradient data is activated
*/
public boolean getActivate() {
@@ -120,9 +120,9 @@ public class ObservableGradientData extends GradientData {
/**
* Activates or de-activates this gradient data
- *
+ *
* @param value
- * Whether the gradient data should be activated or de-activated
+ * Whether the gradient data should be activated or de-activated
*/
public void setActivate(boolean value) {
this.activate = value;
@@ -132,10 +132,10 @@ public class ObservableGradientData extends GradientData {
public EObject getOwner() {
EObject result = null;
- if(source instanceof IObserving) {
- Object owner = ((IObserving)source).getObserved();
- if(owner instanceof EObject) {
- result = (EObject)owner;
+ if (source instanceof IObserving) {
+ Object owner = ((IObserving) source).getObserved();
+ if (owner instanceof EObject) {
+ result = (EObject) owner;
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java
index 7702194e980..d15e5433ce5 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/databinding/RulersUnitObservableValue.java
@@ -11,17 +11,17 @@ import org.eclipse.papyrus.infra.gmfdiag.common.utils.UnitsConverterUtils;
@SuppressWarnings("restriction")
-//suppress warning for WorkspaceViewerProperties
+// suppress warning for WorkspaceViewerProperties
public class RulersUnitObservableValue extends IntegerDiagramViewObservableValue {
/**
- *
+ *
* Constructor.
- *
+ *
* @param view
- * the view
+ * the view
* @param store
- * the edited preference store
+ * the edited preference store
*/
public RulersUnitObservableValue(final Diagram view, final IPreferenceStore store) {
super(view, WorkspaceViewerProperties.RULERUNIT, store);
@@ -29,34 +29,34 @@ public class RulersUnitObservableValue extends IntegerDiagramViewObservableValue
/**
- *
+ *
* @see org.eclipse.papyrus.infra.gmfdiag.properties.databinding.IntegerDiagramViewObservableValue#doSetValue(java.lang.Object)
- *
+ *
* @param value
*/
@Override
protected void doSetValue(final Object value) {
- if(value instanceof Integer) {
- final Integer oldValue = (Integer)doGetValue();
+ if (value instanceof Integer) {
+ final Integer oldValue = (Integer) doGetValue();
final IPreferenceStore wsPreferenceStore = getEditedPreferenceStore();
final Double oldGridSpacing = wsPreferenceStore.getDouble(WorkspaceViewerProperties.GRIDSPACING);
- final String newValue = UnitsConverterUtils.convertUnits((Integer)oldValue, (Integer)value, NumberFormat.getInstance().format(oldGridSpacing));
+ final String newValue = UnitsConverterUtils.convertUnits(oldValue, (Integer) value, NumberFormat.getInstance().format(oldGridSpacing));
Number number = null;
try {
number = NumberFormat.getInstance().parse(newValue);
} catch (ParseException e) {
- //nothing to do
+ // nothing to do
number = null;
return;
}
- //we set the new unit value
+ // we set the new unit value
super.doSetValue(value);
- //we set the new spacing value
+ // we set the new spacing value
final double newGridSpacing = number.doubleValue();
wsPreferenceStore.setValue(WorkspaceViewerProperties.GRIDSPACING, newGridSpacing);
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/NotationStyleHandlerProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/NotationStyleHandlerProvider.java
index fdba8fba81e..926b3307c02 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/NotationStyleHandlerProvider.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/NotationStyleHandlerProvider.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -24,7 +24,7 @@ import org.eclipse.papyrus.views.properties.modelelement.ModelElementFactory;
/**
* Default implementation of StyleHandlerProvider
* Handles the GMF Notation views (With a low priority)
- *
+ *
* @author Camille Letavernier
*/
public class NotationStyleHandlerProvider implements StyleHandlerProvider {
@@ -36,7 +36,7 @@ public class NotationStyleHandlerProvider implements StyleHandlerProvider {
}
public boolean isProviderFor(Object selection) {
- if(selection instanceof GradientData) {
+ if (selection instanceof GradientData) {
return true;
}
return NotationHelper.findView(selection) != null;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/StyleHandlerManager.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/StyleHandlerManager.java
index 27f73c9509c..5b083c9ef52 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/StyleHandlerManager.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/extension/StyleHandlerManager.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -33,9 +33,9 @@ public class StyleHandlerManager {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
- for(IConfigurationElement e : config) {
+ for (IConfigurationElement e : config) {
try {
- StyleHandlerProvider provider = (StyleHandlerProvider)e.createExecutableExtension("provider"); //$NON-NLS-1$
+ StyleHandlerProvider provider = (StyleHandlerProvider) e.createExecutableExtension("provider"); //$NON-NLS-1$
String priorityString = e.getAttribute("priority");
int priority = Integer.parseInt(priorityString);
providersMap.put(priority, provider);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/messages/Messages.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/messages/Messages.java
index 88269b2493c..508eb15e8fa 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/messages/Messages.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/messages/Messages.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
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/AppearanceModelElementFactory.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/AppearanceModelElementFactory.java
index de8b9efcdd8..878ec9fd261 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/AppearanceModelElementFactory.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/AppearanceModelElementFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012, 2014 CEA LIST 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
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 417409
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.modelelement;
@@ -23,16 +23,16 @@ import org.eclipse.papyrus.views.properties.modelelement.ModelElementFactory;
* A ModelElementFactory for the Appearance property view. Dispatches the
* creation of ModelElement to the registered StyleHandlerProvider with
* the highest priority.
- *
+ *
* @author Camille Letavernier
*/
public class AppearanceModelElementFactory implements ModelElementFactory {
public ModelElement createFromSource(Object sourceElement, DataContextElement context) {
- for(StyleHandlerProvider provider : StyleHandlerManager.instance.getStyleHandlerProviders()) {
- if(provider.isProviderFor(sourceElement)) {
+ for (StyleHandlerProvider provider : StyleHandlerManager.instance.getStyleHandlerProviders()) {
+ if (provider.isProviderFor(sourceElement)) {
ModelElement element = provider.createModelElement(sourceElement, context);
- if(element == null) {
+ if (element == null) {
Activator.log.warn("The StyleHandlerProvider " + provider.getClass().getName() + " provided an invalid ModelElement");
}
return element;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java
index 7afe625c3ff..3e09b14e723 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElement.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012, 2014 CEA LIST 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
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 323802
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.modelelement;
@@ -38,7 +38,7 @@ public class CustomStyleModelElement extends EMFModelElement {
private DataContextElement element;
- //this.view == super.source
+ // this.view == super.source
private View view;
public CustomStyleModelElement(View source, DataContextElement context) {
@@ -52,8 +52,8 @@ public class CustomStyleModelElement extends EMFModelElement {
}
protected Property findProperty(String propertyPath) {
- for(Property property : element.getProperties()) {
- if(propertyPath.equals(property.getName())) {
+ for (Property property : element.getProperties()) {
+ if (propertyPath.equals(property.getName())) {
return property;
}
}
@@ -63,11 +63,11 @@ public class CustomStyleModelElement extends EMFModelElement {
@Override
public IObservable doGetObservable(String propertyPath) {
Property property = findProperty(propertyPath);
- if(property == null) {
+ if (property == null) {
return null;
}
- if(property.getMultiplicity() == 1) {
- switch(property.getType()) {
+ if (property.getMultiplicity() == 1) {
+ switch (property.getType()) {
case BOOLEAN:
return new CustomBooleanStyleObservableValue(view, domain, propertyPath);
case INTEGER:
@@ -80,7 +80,7 @@ public class CustomStyleModelElement extends EMFModelElement {
return null;
}
} else {
- switch(property.getType()) {
+ switch (property.getType()) {
case BOOLEAN:
return new CustomBooleanStyleObservableList(view, domain, propertyPath);
case INTEGER:
@@ -101,7 +101,7 @@ public class CustomStyleModelElement extends EMFModelElement {
}
- //TODO: Implement these methods for multivalued properties (XxxListStyle)
+ // TODO: Implement these methods for multivalued properties (XxxListStyle)
@Override
public IStaticContentProvider getContentProvider(String propertyPath) {
@@ -136,11 +136,11 @@ public class CustomStyleModelElement extends EMFModelElement {
@Override
public ReferenceValueFactory getValueFactory(String propertyPath) {
Property property = findProperty(propertyPath);
- if(property == null) {
+ if (property == null) {
return null;
}
- switch(property.getType()) {
+ switch (property.getType()) {
case STRING:
return new StringEditionFactory();
case INTEGER:
@@ -161,7 +161,7 @@ public class CustomStyleModelElement extends EMFModelElement {
@Override
public boolean getDirectCreation(String propertyPath) {
Property property = findProperty(propertyPath);
- if(property == null) {
+ if (property == null) {
return false;
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java
index a2c8553afea..1a224adc6e5 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/CustomStyleModelElementFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012, 2014 CEA LIST 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
@@ -28,7 +28,7 @@ public class CustomStyleModelElementFactory extends AbstractEMFModelElementFacto
protected CustomStyleModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
View view = NotationHelper.findView(sourceElement);
- if(view != null) {
+ if (view != null) {
EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(view);
return new CustomStyleModelElement(view, domain, context);
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElement.java
index 4792204ad56..a03f111ee31 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElement.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - bug 323802
*
@@ -36,7 +36,7 @@ import org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement;
* Model element for the decorated view in GMF. This is not a model element, as the properties to search are non-EMF Properties
*/
public class DecoratedModelElement extends AbstractModelElement {
-
+
private final static Map<Object, String> labels = new HashMap<Object, String>();
static {
labels.put(0, Messages.DecoratedModelElement_NORTH_WEST);
@@ -49,7 +49,7 @@ public class DecoratedModelElement extends AbstractModelElement {
labels.put(7, Messages.DecoratedModelElement_SOUTH);
labels.put(8, Messages.DecoratedModelElement_SOUTH_EAST);
}
-
+
/**
* The EObject manipulated by this ModelElement
*/
@@ -61,9 +61,9 @@ public class DecoratedModelElement extends AbstractModelElement {
protected EditingDomain domain;
/**
- *
+ *
* Constructs a new EMFModelElement for the given EObject
- *
+ *
* @param source
*/
public DecoratedModelElement(EObject source) {
@@ -71,9 +71,9 @@ public class DecoratedModelElement extends AbstractModelElement {
}
/**
- *
+ *
* Constructs a new EMFModelElement for the given EObject and Editing Domain
- *
+ *
* @param source
* @param domain
*/
@@ -95,18 +95,18 @@ public class DecoratedModelElement extends AbstractModelElement {
public EObject getSource() {
return source;
}
-
+
/**
* {@inheritDoc}
*/
@Override
protected IObservable doGetObservable(String propertyPath) {
- if(ShapeDecorator.SHAPE_DECORATOR_VISIBILITY.equals(propertyPath)) {
- return new CustomBooleanStyleObservableValue((View)source, domain, ShapeDecorator.SHAPE_DECORATOR_VISIBILITY);
+ if (ShapeDecorator.SHAPE_DECORATOR_VISIBILITY.equals(propertyPath)) {
+ return new CustomBooleanStyleObservableValue((View) source, domain, ShapeDecorator.SHAPE_DECORATOR_VISIBILITY);
}
- if(ShapeDecorator.SHAPE_DECORATOR_DIRECTION.equals(propertyPath)) {
- return new CustomIntStyleObservableValue((View)source, domain, ShapeDecorator.SHAPE_DECORATOR_DIRECTION);
+ if (ShapeDecorator.SHAPE_DECORATOR_DIRECTION.equals(propertyPath)) {
+ return new CustomIntStyleObservableValue((View) source, domain, ShapeDecorator.SHAPE_DECORATOR_DIRECTION);
}
return super.getObservable(propertyPath);
}
@@ -116,7 +116,7 @@ public class DecoratedModelElement extends AbstractModelElement {
*/
@Override
public boolean isEditable(String propertyPath) {
- if(ShapeDecorator.SHAPE_DECORATOR_DIRECTION.equals(propertyPath) || ShapeDecorator.SHAPE_DECORATOR_VISIBILITY.equals(propertyPath)) {
+ if (ShapeDecorator.SHAPE_DECORATOR_DIRECTION.equals(propertyPath) || ShapeDecorator.SHAPE_DECORATOR_VISIBILITY.equals(propertyPath)) {
return !EMFHelper.isReadOnly(source);
}
@@ -128,7 +128,7 @@ public class DecoratedModelElement extends AbstractModelElement {
*/
@Override
public ILabelProvider getLabelProvider(String propertyPath) {
- if(ShapeDecorator.SHAPE_DECORATOR_DIRECTION.equals(propertyPath)) {
+ if (ShapeDecorator.SHAPE_DECORATOR_DIRECTION.equals(propertyPath)) {
return new MapLabelProvider(labels);
}
return super.getLabelProvider(propertyPath);
@@ -139,7 +139,7 @@ public class DecoratedModelElement extends AbstractModelElement {
*/
@Override
public IStaticContentProvider getContentProvider(String propertyPath) {
- if(ShapeDecorator.SHAPE_DECORATOR_DIRECTION.equals(propertyPath)) {
+ if (ShapeDecorator.SHAPE_DECORATOR_DIRECTION.equals(propertyPath)) {
return new AbstractStaticContentProvider() {
/**
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElementFactory.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElementFactory.java
index 3b7b2cc602b..63a15b79b46 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElementFactory.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/DecoratedModelElementFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011, 2014 CEA LIST 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
@@ -32,9 +32,9 @@ public class DecoratedModelElementFactory extends AbstractModelElementFactory<De
protected DecoratedModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
View view = NotationHelper.findView(sourceElement);
- if(view != null) {
+ if (view != null) {
EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(view);
- if(ShapeDecorator.isDecorable(view)) {
+ if (ShapeDecorator.isDecorable(view)) {
return new DecoratedModelElement(view, domain);
}
@@ -47,7 +47,7 @@ public class DecoratedModelElementFactory extends AbstractModelElementFactory<De
@Override
protected void updateModelElement(DecoratedModelElement modelElement, Object newSourceElement) {
View view = NotationHelper.findView(newSourceElement);
- if((view == null) || !ShapeDecorator.isDecorable(view)) {
+ if ((view == null) || !ShapeDecorator.isDecorable(view)) {
throw new IllegalArgumentException("Cannot resolve decorable View selection: " + newSourceElement);
}
modelElement.source = view;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
index 0df75e11d41..31fa12825db 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GMFModelElement.java
@@ -56,7 +56,7 @@ public class GMFModelElement extends EMFModelElement {
* Constructor.
*
* @param source
- * The source element (from the Notation metamodel)
+ * The source element (from the Notation metamodel)
*/
public GMFModelElement(EObject source) {
super(source);
@@ -67,10 +67,10 @@ public class GMFModelElement extends EMFModelElement {
* Constructor.
*
* @param source
- * The source element (from the Notation metamodel)
+ * The source element (from the Notation metamodel)
* @param domain
- * The editing domain on which the commands will be executed.
- * May be null
+ * The editing domain on which the commands will be executed.
+ * May be null
*/
public GMFModelElement(EObject source, EditingDomain domain) {
super(source, domain);
@@ -78,7 +78,7 @@ public class GMFModelElement extends EMFModelElement {
@Override
protected boolean isFeatureEditable(String propertyPath) {
- if(propertyPath.endsWith("owner")) {
+ if (propertyPath.endsWith("owner")) {
return true;
}
return super.isFeatureEditable(propertyPath);
@@ -86,17 +86,17 @@ public class GMFModelElement extends EMFModelElement {
@Override
protected IObservable doGetObservable(String propertyPath) {
- if(propertyPath.endsWith("owner")) {
- Diagram diagram = (Diagram)source;
+ if (propertyPath.endsWith("owner")) {
+ Diagram diagram = (Diagram) source;
Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
- if(style != null) {
+ if (style != null) {
return new PapyrusObservableValue(style, StylePackage.Literals.PAPYRUS_VIEW_STYLE__OWNER, domain);
}
return new LegacyOwnerObservable(diagram, StylePackage.Literals.PAPYRUS_VIEW_STYLE__OWNER, domain);
- } else if(propertyPath.endsWith("prototype")) {
- Diagram diagram = (Diagram)source;
+ } else if (propertyPath.endsWith("prototype")) {
+ Diagram diagram = (Diagram) source;
Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
- if(style != null) {
+ if (style != null) {
return new PapyrusObservableValue(style, StylePackage.Literals.PAPYRUS_VIEW_STYLE__CONFIGURATION, domain);
}
return new LegacyOwnerObservable(diagram, StylePackage.Literals.PAPYRUS_VIEW_STYLE__CONFIGURATION, domain);
@@ -105,15 +105,15 @@ public class GMFModelElement extends EMFModelElement {
FeaturePath featurePath = getFeaturePath(propertyPath);
EStructuralFeature feature = getFeature(propertyPath);
- if(feature == null) {
+ if (feature == null) {
return null;
}
- if(feature.getEType() == NotationPackage.eINSTANCE.getGradientData()) {
+ if (feature.getEType() == NotationPackage.eINSTANCE.getGradientData()) {
return new GradientObservableValue(source, feature, domain);
}
- if(feature.getUpperBound() != 1) {
+ if (feature.getUpperBound() != 1) {
IObservableList list = domain == null ? EMFProperties.list(featurePath).observe(source) : new PapyrusObservableList(EMFProperties.list(featurePath).observe(source), domain, getSource(featurePath), feature);
return list;
}
@@ -124,7 +124,7 @@ public class GMFModelElement extends EMFModelElement {
@Override
public ILabelProvider getLabelProvider(String propertyPath) {
- if(propertyPath.endsWith("prototype")) {
+ if (propertyPath.endsWith("prototype")) {
return new ILabelProvider() {
public void addListener(ILabelProviderListener listener) {
@@ -141,12 +141,12 @@ public class GMFModelElement extends EMFModelElement {
}
public Image getImage(Object element) {
- ViewPrototype proto = DiagramUtils.getPrototype((Diagram)source);
+ ViewPrototype proto = DiagramUtils.getPrototype((Diagram) source);
return proto.getIcon();
}
public String getText(Object element) {
- ViewPrototype proto = DiagramUtils.getPrototype((Diagram)source);
+ ViewPrototype proto = DiagramUtils.getPrototype((Diagram) source);
return proto.getQualifiedName();
}
};
@@ -164,9 +164,9 @@ public class GMFModelElement extends EMFModelElement {
*/
@Override
public IStaticContentProvider getContentProvider(String propertyPath) {
- if("element".equals(propertyPath)) {
- if(source instanceof Diagram) {
- Diagram diagram = (Diagram)source;
+ if ("element".equals(propertyPath)) {
+ if (source instanceof Diagram) {
+ Diagram diagram = (Diagram) source;
return new ModelContentProvider(diagram, getRoot(diagram.getElement())) {
@Override
@@ -177,8 +177,8 @@ public class GMFModelElement extends EMFModelElement {
} else {
return EmptyContentProvider.instance;
}
- } else if("owner".equals(propertyPath)) {
- Diagram diagram = (Diagram)source;
+ } else if ("owner".equals(propertyPath)) {
+ Diagram diagram = (Diagram) source;
return new ModelContentProvider(diagram, getRoot(diagram.getElement())) {
@Override
@@ -194,13 +194,13 @@ public class GMFModelElement extends EMFModelElement {
* Gets the root EObject from the given one
*
* @param obj
- * An object
+ * An object
* @return The root object which is an ancestor of the given one
*/
private EObject getRoot(EObject obj) {
EObject current = obj;
EObject parent = obj.eContainer();
- while(parent != null) {
+ while (parent != null) {
current = parent;
parent = parent.eContainer();
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GradientDataModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GradientDataModelElement.java
index 07951aaf382..a3d514dc21b 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GradientDataModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/GradientDataModelElement.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011, 2014 CEA LIST 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
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 323802
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.modelelement;
@@ -29,14 +29,14 @@ import org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement;
/**
* A ModelElement for manipulating GradientData
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class GradientDataModelElement extends AbstractModelElement {
private static final String PROPERTY_PATH = "gradientStyle"; //$NON-NLS-1$
-
+
/**
* The source GradientData
*/
@@ -46,14 +46,14 @@ public class GradientDataModelElement extends AbstractModelElement {
* The notation style element that owns the {@link GradientData}.
*/
protected EObject owner;
-
+
/**
* Constructor.
- *
+ *
* @param sourceElement
- * the source GradientData
+ * the source GradientData
* @param owner
- * the owner of the gradient data (may be {@code null})
+ * the owner of the gradient data (may be {@code null})
*/
public GradientDataModelElement(GradientData sourceElement, EObject owner) {
this.sourceElement = sourceElement;
@@ -61,11 +61,11 @@ public class GradientDataModelElement extends AbstractModelElement {
}
/**
- *
+ *
* Constructor.
- *
+ *
* @param sourceElement
- * the source GradientData
+ * the source GradientData
*/
public GradientDataModelElement(GradientData sourceElement) {
this(sourceElement, null);
@@ -86,14 +86,14 @@ public class GradientDataModelElement extends AbstractModelElement {
// Let owner be null for compatibility with plain GradientData objects that we don't know their owners
return (owner == null) || !EMFHelper.isReadOnly(owner);
}
-
+
@Override
public IStaticContentProvider getContentProvider(String propertyPath) {
- if(propertyPath.equals(PROPERTY_PATH)) {
+ if (propertyPath.equals(PROPERTY_PATH)) {
return new AbstractStaticContentProvider() {
public Object[] getElements() {
- return new Integer[]{ 0, 1 };
+ return new Integer[] { 0, 1 };
}
};
@@ -104,14 +104,14 @@ public class GradientDataModelElement extends AbstractModelElement {
@Override
public ILabelProvider getLabelProvider(String propertyPath) {
- if(propertyPath.equals(PROPERTY_PATH)) {
+ if (propertyPath.equals(PROPERTY_PATH)) {
return new LabelProvider() {
@Override
public String getText(Object element) {
- if(element instanceof Integer) {
- int value = (Integer)element;
- if(value == 0) {
+ if (element instanceof Integer) {
+ int value = (Integer) element;
+ if (value == 0) {
return Messages.GradientDataModelElement_Vertical;
} else {
return Messages.GradientDataModelElement_Horizontal;
@@ -129,7 +129,7 @@ public class GradientDataModelElement extends AbstractModelElement {
@Override
public Object getDefaultValue(String propertyPath) {
GradientProperty property = GradientProperty.valueOf(propertyPath);
- switch(property) {
+ switch (property) {
case activate:
return false;
case gradientColor1:
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/NotationModelElementFactory.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/NotationModelElementFactory.java
index a0895d13c2d..992fcb22e21 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/NotationModelElementFactory.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/NotationModelElementFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011, 2014 CEA LIST 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
@@ -10,7 +10,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 323802
* Christian W. Damus (CEA) - bug 417409
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.modelelement;
@@ -28,7 +28,7 @@ import org.eclipse.papyrus.views.properties.modelelement.AbstractModelElementFac
/**
* A factory for handling the GMF Notation elements
- *
+ *
* @author Camille Letavernier
*/
public class NotationModelElementFactory extends AbstractModelElementFactory<AbstractModelElement> {
@@ -36,14 +36,14 @@ public class NotationModelElementFactory extends AbstractModelElementFactory<Abs
protected AbstractModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
if (sourceElement instanceof ObservableGradientData) {
- ObservableGradientData gradientData = (ObservableGradientData)sourceElement;
+ ObservableGradientData gradientData = (ObservableGradientData) sourceElement;
return new GradientDataModelElement(gradientData, gradientData.getOwner());
- } else if(sourceElement instanceof GradientData) {
- return new GradientDataModelElement((GradientData)sourceElement);
+ } else if (sourceElement instanceof GradientData) {
+ return new GradientDataModelElement((GradientData) sourceElement);
}
View view = NotationHelper.findView(sourceElement);
- if(view != null) {
+ if (view != null) {
EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(view);
return new GMFModelElement(view, domain);
}
@@ -54,32 +54,32 @@ public class NotationModelElementFactory extends AbstractModelElementFactory<Abs
@Override
protected void updateModelElement(AbstractModelElement modelElement, Object newSourceElement) {
- if(modelElement instanceof GMFModelElement) {
- updateModelElement((GMFModelElement)modelElement, newSourceElement);
- } else if(modelElement instanceof GradientDataModelElement) {
- updateModelElement((GradientDataModelElement)modelElement, newSourceElement);
+ if (modelElement instanceof GMFModelElement) {
+ updateModelElement((GMFModelElement) modelElement, newSourceElement);
+ } else if (modelElement instanceof GradientDataModelElement) {
+ updateModelElement((GradientDataModelElement) modelElement, newSourceElement);
}
}
-
+
void updateModelElement(GradientDataModelElement modelElement, Object newSourceElement) {
- if(newSourceElement instanceof ObservableGradientData) {
- ObservableGradientData ogd = (ObservableGradientData)newSourceElement;
+ if (newSourceElement instanceof ObservableGradientData) {
+ ObservableGradientData ogd = (ObservableGradientData) newSourceElement;
modelElement.sourceElement = ogd;
modelElement.owner = ogd.getOwner();
- } else if(newSourceElement instanceof GradientData) {
- modelElement.sourceElement = (GradientData)newSourceElement;
+ } else if (newSourceElement instanceof GradientData) {
+ modelElement.sourceElement = (GradientData) newSourceElement;
modelElement.owner = null;
} else {
throw new IllegalArgumentException("Cannot resolve GradientData selection: " + newSourceElement);
}
}
-
+
void updateModelElement(GMFModelElement modelElement, Object newSourceElement) {
View view = NotationHelper.findView(newSourceElement);
- if(view == null) {
+ if (view == null) {
throw new IllegalArgumentException("Cannot resolve View selection: " + newSourceElement);
}
-
+
AbstractEMFModelElementFactory.updateEMFModelElement(modelElement, view);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulerAndGridModelElement.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulerAndGridModelElement.java
index cae3f549ea8..3d99d477673 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulerAndGridModelElement.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulerAndGridModelElement.java
@@ -35,12 +35,12 @@ import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
import org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement;
/**
- *
+ *
* @author vl222926
* This class provides the ModelElement for the property view
*/
@SuppressWarnings("restriction")
-//suppress the warning for WorkspaceViewerProperties
+// suppress the warning for WorkspaceViewerProperties
public class RulerAndGridModelElement extends AbstractModelElement {
@@ -56,17 +56,17 @@ public class RulerAndGridModelElement extends AbstractModelElement {
protected IPreferenceStore store;
/**
- *
+ *
* Constructor.
- *
+ *
* @param view
- * the diagram for which we are editing preferences
+ * the diagram for which we are editing preferences
* @param domain
- * the editing domain
+ * the editing domain
* @param context
- * the data context
+ * the data context
* @param preferenceStore
- * the edited preference store
+ * the edited preference store
*/
public RulerAndGridModelElement(final Diagram view, final EditingDomain domain, final DataContextElement context, final IPreferenceStore preferenceStore) {
this.diagram = view;
@@ -74,9 +74,9 @@ public class RulerAndGridModelElement extends AbstractModelElement {
}
/**
- *
+ *
* @see org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement#dispose()
- *
+ *
*/
@Override
public void dispose() {
@@ -86,40 +86,40 @@ public class RulerAndGridModelElement extends AbstractModelElement {
}
/**
- *
+ *
* @see org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement#doGetObservable(java.lang.String)
- *
+ *
* @param propertyPath
* @return
*/
@Override
protected IObservable doGetObservable(final String propertyPath) {
IObservable observable = null;
- if(RulersAndGridPropertyConstants.GRID_IS_DISPLAYING_GRID.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_IS_DISPLAYING_GRID.equals(propertyPath)) {
observable = new BooleanDiagramViewObservableValue(this.diagram, WorkspaceViewerProperties.VIEWGRID, this.store);
}
- if(RulersAndGridPropertyConstants.RULERS_IS_DISPLAYING_RULER.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.RULERS_IS_DISPLAYING_RULER.equals(propertyPath)) {
observable = new BooleanDiagramViewObservableValue(this.diagram, WorkspaceViewerProperties.VIEWRULERS, this.store);
}
- if(RulersAndGridPropertyConstants.GRID_IS_IN_FRONT.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_IS_IN_FRONT.equals(propertyPath)) {
observable = new BooleanDiagramViewObservableValue(diagram, WorkspaceViewerProperties.GRIDORDER, this.store);
}
- if(RulersAndGridPropertyConstants.GRID_COLOR.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_COLOR.equals(propertyPath)) {
observable = new IntegerDiagramViewObservableValue(diagram, WorkspaceViewerProperties.GRIDLINECOLOR, this.store);
}
- if(RulersAndGridPropertyConstants.GRID_STYLE.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_STYLE.equals(propertyPath)) {
observable = new IntegerDiagramViewObservableValue(diagram, WorkspaceViewerProperties.GRIDLINESTYLE, this.store);
}
- if(RulersAndGridPropertyConstants.GRID_SPACING.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_SPACING.equals(propertyPath)) {
observable = new DoubleDiagramViewObservaleValue(diagram, WorkspaceViewerProperties.GRIDSPACING, this.store);
}
- if(RulersAndGridPropertyConstants.GRID_IS_SNAP_TO_GRID.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_IS_SNAP_TO_GRID.equals(propertyPath)) {
observable = new BooleanDiagramViewObservableValue(this.diagram, WorkspaceViewerProperties.SNAPTOGRID, this.store);
}
- if(RulersAndGridPropertyConstants.GRID_IS_SNAP_TO_SHAPE.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_IS_SNAP_TO_SHAPE.equals(propertyPath)) {
observable = new BooleanDiagramViewObservableValue(this.diagram, WorkspaceViewerProperties.SNAPTOGEOMETRY, this.store);
}
- if(RulersAndGridPropertyConstants.RULERS_UNITS.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.RULERS_UNITS.equals(propertyPath)) {
observable = new RulersUnitObservableValue(diagram, this.store);
}
return observable;
@@ -128,60 +128,60 @@ public class RulerAndGridModelElement extends AbstractModelElement {
/**
- *
+ *
* @see org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement#getContentProvider(java.lang.String)
- *
+ *
* @param propertyPath
* @return
*/
@Override
public IStaticContentProvider getContentProvider(String propertyPath) {
- if(RulersAndGridPropertyConstants.GRID_STYLE.equals(propertyPath)) {
- return new StaticContentProvider(new Object[]{ Graphics.LINE_DASH, Graphics.LINE_DASHDOT, Graphics.LINE_DASHDOTDOT, Graphics.LINE_DOT, Graphics.LINE_SOLID, Graphics.LINE_CUSTOM });
+ if (RulersAndGridPropertyConstants.GRID_STYLE.equals(propertyPath)) {
+ return new StaticContentProvider(new Object[] { Graphics.LINE_DASH, Graphics.LINE_DASHDOT, Graphics.LINE_DASHDOTDOT, Graphics.LINE_DOT, Graphics.LINE_SOLID, Graphics.LINE_CUSTOM });
}
- if(RulersAndGridPropertyConstants.RULERS_UNITS.equals(propertyPath)) {
- return new StaticContentProvider(new Object[]{ RulerProvider.UNIT_INCHES, RulerProvider.UNIT_CENTIMETERS, RulerProvider.UNIT_PIXELS });
+ if (RulersAndGridPropertyConstants.RULERS_UNITS.equals(propertyPath)) {
+ return new StaticContentProvider(new Object[] { RulerProvider.UNIT_INCHES, RulerProvider.UNIT_CENTIMETERS, RulerProvider.UNIT_PIXELS });
}
return super.getContentProvider(propertyPath);
}
/**
- *
+ *
* @see org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement#getLabelProvider(java.lang.String)
- *
+ *
* @param propertyPath
* @return
*/
@Override
public ILabelProvider getLabelProvider(final String propertyPath) {
- if(RulersAndGridPropertyConstants.GRID_STYLE.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_STYLE.equals(propertyPath)) {
return new LineStyleLabelProvider();
}
- if(RulersAndGridPropertyConstants.RULERS_UNITS.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.RULERS_UNITS.equals(propertyPath)) {
return new UnitsLabelProvider();
}
return null;
}
/**
- *
+ *
* @see org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement#isMandatory(java.lang.String)
- *
+ *
* @param propertyPath
* @return
*/
@Override
public boolean isMandatory(final String propertyPath) {
- if(RulersAndGridPropertyConstants.GRID_STYLE.equals(propertyPath) || RulersAndGridPropertyConstants.RULERS_UNITS.equals(propertyPath)) {
+ if (RulersAndGridPropertyConstants.GRID_STYLE.equals(propertyPath) || RulersAndGridPropertyConstants.RULERS_UNITS.equals(propertyPath)) {
return true;
}
return false;
}
/**
- *
+ *
* @see org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement#forceRefresh(java.lang.String)
- *
+ *
* @param propertyPath
* @return
*/
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulersAndGridModelElementFactory.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulersAndGridModelElementFactory.java
index 8b7e6e1abfe..9f467eca532 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulersAndGridModelElementFactory.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/RulersAndGridModelElementFactory.java
@@ -27,7 +27,7 @@ import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
import org.eclipse.papyrus.views.properties.modelelement.AbstractModelElementFactory;
/**
- *
+ *
* @author vl222926
* The factory used to edit Rulers and Grid properties
*/
@@ -35,12 +35,12 @@ public class RulersAndGridModelElementFactory extends AbstractModelElementFactor
@Override
protected RulerAndGridModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
- if(sourceElement instanceof EditPart) {
- final IPreferenceStore preferenceStore = DiagramEditPartsUtil.getDiagramWorkspacePreferenceStore((EditPart)sourceElement);
- View view = NotationHelper.findView(DiagramEditPartsUtil.getDiagramEditPart((EditPart)sourceElement));
- if(preferenceStore != null && view instanceof Diagram) {
+ if (sourceElement instanceof EditPart) {
+ final IPreferenceStore preferenceStore = DiagramEditPartsUtil.getDiagramWorkspacePreferenceStore((EditPart) sourceElement);
+ View view = NotationHelper.findView(DiagramEditPartsUtil.getDiagramEditPart((EditPart) sourceElement));
+ if (preferenceStore != null && view instanceof Diagram) {
EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(view);
- return new RulerAndGridModelElement((Diagram)view, domain, context, preferenceStore);
+ return new RulerAndGridModelElement((Diagram) view, domain, context, preferenceStore);
}
}
@@ -50,12 +50,12 @@ public class RulersAndGridModelElementFactory extends AbstractModelElementFactor
@Override
protected void updateModelElement(RulerAndGridModelElement modelElement, Object newSourceElement) {
- if(!(newSourceElement instanceof EditPart)) {
+ if (!(newSourceElement instanceof EditPart)) {
throw new IllegalArgumentException("Cannot resolve EditPart selection: " + newSourceElement);
}
- EditPart editPart = (EditPart)newSourceElement;
+ EditPart editPart = (EditPart) newSourceElement;
modelElement.store = DiagramEditPartsUtil.getDiagramWorkspacePreferenceStore(editPart);
- modelElement.diagram = (Diagram)NotationHelper.findView(DiagramEditPartsUtil.getDiagramEditPart(editPart));
+ modelElement.diagram = (Diagram) NotationHelper.findView(DiagramEditPartsUtil.getDiagramEditPart(editPart));
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/StyleHandlerProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/StyleHandlerProvider.java
index 8f93d6981c7..a44665191da 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/StyleHandlerProvider.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/modelelement/StyleHandlerProvider.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 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,33 +16,33 @@ import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
import org.eclipse.papyrus.views.properties.modelelement.ModelElement;
/**
- *
+ *
* Provides a ModelElement and a Constraint implementation for a given
* selection.
- *
+ *
* More than one implementation can be provided, with different priorities,
* so that the Appearance property view can be used to edit different models,
* in different contexts (e.g. Notation model, CSS stylesheet, Preferences...)
- *
+ *
* The Providers can be registered through the extension point:
* org.eclipse.papyrus.infra.gmfdiag.properties.stylehandler
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
-//TODO: Can this be generalized to the whole property view framework?
+// TODO: Can this be generalized to the whole property view framework?
public interface StyleHandlerProvider {
/**
* Returns a Constraint implementation
- *
+ *
* @return
*/
public Constraint createConstraint();
/**
* Tests whether this provider can handle the given selection.
- *
+ *
* @param selection
* @return
*/
@@ -52,7 +52,7 @@ public interface StyleHandlerProvider {
* Returns a ModelElement for the given selection. This method can only be
* called when {@link #isProviderFor(Object)} returns true for the given
* selection.
- *
+ *
* @param selection
* @param context
* @return
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java
index 78e29021201..598fc167a84 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/provider/ModelContentProvider.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
@@ -23,49 +23,60 @@ import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
/**
* Represents a simple ECore model content provider for the selection of a diagram's root model element
+ *
* @author Laurent Wouters
*/
public abstract class ModelContentProvider extends ECoreModelContentProvider implements IStaticContentProvider, IHierarchicContentProvider {
-
+
/**
* The diagram
*/
private Diagram diagram;
-
+
/**
* Initializes the provider with the given root
- * @param diagram The diagram for which a root model element is to be provided
- * @param root The root object
+ *
+ * @param diagram
+ * The diagram for which a root model element is to be provided
+ * @param root
+ * The root object
*/
public ModelContentProvider(Diagram diagram, EObject root) {
super(root);
this.diagram = diagram;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider#getElements()
*/
public Object[] getElements() {
return getElements(null);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider#isValidValue(java.lang.Object)
*/
public boolean isValidValue(Object element) {
- if (element == null)
+ if (element == null) {
return false;
- if (!(element instanceof EObject))
+ }
+ if (!(element instanceof EObject)) {
return false;
+ }
ViewPrototype prototype = DiagramUtils.getPrototype(diagram);
- if (prototype == null)
+ if (prototype == null) {
return false;
+ }
return isValid((EObject) element, diagram, prototype);
}
/**
* Determines whether the selection is valid
- *
+ *
* @param selection
* The selection
* @param diagram
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java
index 8b941318fae..94025ee9646 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/LegacyOwnerObservable.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
@@ -33,6 +33,7 @@ import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
/**
* Represents the observable value of a diagram's owner in the case where the diagram does not yet have the viewpoints-compatible style for holding the value itself
+ *
* @author Laurent Wouters
*/
public class LegacyOwnerObservable extends AbstractObservableValue {
@@ -44,11 +45,14 @@ public class LegacyOwnerObservable extends AbstractObservableValue {
private IChangeListener valueListener;
private PapyrusObservableValue styleObservable;
private PapyrusObservableValue valueObservable;
-
+
/**
* Initializes the observables
- * @param diagram The diagram to be observed
- * @param domain The editing domain
+ *
+ * @param diagram
+ * The diagram to be observed
+ * @param domain
+ * The editing domain
*/
public LegacyOwnerObservable(Diagram diagram, EReference feature, EditingDomain domain) {
super(Realm.getDefault());
@@ -60,55 +64,74 @@ public class LegacyOwnerObservable extends AbstractObservableValue {
this.styleObservable.addChangeListener(styleListener);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#isStale()
*/
+ @Override
public boolean isStale() {
return (valueListener != null);
}
-
+
/**
* Builds the listener for the styles property of the diagram
*/
private void buildStyleListener() {
this.styleListener = new IChangeListener() {
public void handleChange(ChangeEvent event) {
- if (valueListener != null)
+ if (valueListener != null) {
return;
+ }
Style style = LegacyOwnerObservable.this.diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE);
- if (style != null)
+ if (style != null) {
buildValueListener(style);
+ }
}
};
}
-
+
/**
* Builds the listener for the EObjectValue property of the style
- * @param style The style to be observed
+ *
+ * @param style
+ * The style to be observed
*/
private void buildValueListener(Style style) {
this.valueListener = new IChangeListener() {
public void handleChange(ChangeEvent event) {
fireValueChange(new ValueDiff() {
- public Object getOldValue() { return null; }
- public Object getNewValue() { return DiagramUtils.getOwner(diagram); }
+ @Override
+ public Object getOldValue() {
+ return null;
+ }
+
+ @Override
+ public Object getNewValue() {
+ return DiagramUtils.getOwner(diagram);
+ }
});
}
};
valueObservable = new PapyrusObservableValue(style, reference, domain);
valueObservable.addChangeListener(valueListener);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType()
*/
public Object getValueType() {
return EcorePackage.Literals.EOBJECT;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doGetValue()
*/
+ @Override
protected Object doGetValue() {
return DiagramUtils.getOwner(diagram);
}
@@ -118,6 +141,7 @@ public class LegacyOwnerObservable extends AbstractObservableValue {
*
* @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#doSetValue(java.lang.Object)
*/
+ @Override
protected void doSetValue(Object value) {
Command emfCommand = getCommand((EObject) value);
domain.getCommandStack().execute(emfCommand);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java
index 1fbdd42e1ac..34a6cfde70b 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/NotationUtil.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -21,19 +21,19 @@ public class NotationUtil {
/**
* Retrieve the IGraphicalEditPart from the given Object
- *
+ *
* @param source
- * The object to resolve
+ * The object to resolve
* @return
* The IGraphicalEditPart, or null if it couldn't be resolved
*/
public static IGraphicalEditPart resolveEditPart(Object source) {
- if(source instanceof IGraphicalEditPart) {
- return (IGraphicalEditPart)source;
+ if (source instanceof IGraphicalEditPart) {
+ return (IGraphicalEditPart) source;
}
- if(source instanceof IAdaptable) {
- return (IGraphicalEditPart)((IAdaptable)source).getAdapter(IGraphicalEditPart.class);
+ if (source instanceof IAdaptable) {
+ return (IGraphicalEditPart) ((IAdaptable) source).getAdapter(IGraphicalEditPart.class);
}
return null;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/RulersAndGridPropertyConstants.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/RulersAndGridPropertyConstants.java
index 03ae14a07fe..d4a665778f9 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/RulersAndGridPropertyConstants.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/util/RulersAndGridPropertyConstants.java
@@ -7,15 +7,15 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.util;
/**
- *
- *
+ *
+ *
* This class provides the constants used in the declaration of the property view for Rulers and Grid
*/
public class RulersAndGridPropertyConstants {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/widget/DiagramPreferencesDefaultButton.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/widget/DiagramPreferencesDefaultButton.java
index eda0cb82580..0bdd18efd9b 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/widget/DiagramPreferencesDefaultButton.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.properties/src/org/eclipse/papyrus/infra/gmfdiag/properties/widget/DiagramPreferencesDefaultButton.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -17,7 +17,6 @@ import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -35,9 +34,9 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
/**
- *
+ *
* The button used to reset the preference of the diagram to the defaut values
- *
+ *
*/
public class DiagramPreferencesDefaultButton extends Composite {
@@ -48,9 +47,9 @@ public class DiagramPreferencesDefaultButton extends Composite {
protected DataSource input;
/**
- *
+ *
* Constructor.
- *
+ *
* @param parent
* @param style
*/
@@ -73,7 +72,7 @@ public class DiagramPreferencesDefaultButton extends Composite {
/**
* Sets the input DataSource for this Property editor.
- *
+ *
* @param input
*/
public void setInput(DataSource input) {
@@ -88,7 +87,7 @@ public class DiagramPreferencesDefaultButton extends Composite {
}
/**
- *
+ *
* @return the listener to use for the button
*/
private SelectionListener createListener() {
@@ -106,9 +105,9 @@ public class DiagramPreferencesDefaultButton extends Composite {
}
/**
- *
+ *
* @see org.eclipse.swt.widgets.Widget#dispose()
- *
+ *
*/
@Override
public void dispose() {
@@ -125,7 +124,7 @@ public class DiagramPreferencesDefaultButton extends Composite {
final IPreferenceStore store = getPreferencesStore();
final IPreferenceStore globalPreferenceStore = Activator.getDefault().getPreferenceStore();
final String diagramType = getDiagramType();
- if(store != null && diagramType != null && !diagramType.equals("")) { //$NON-NLS-1$
+ if (store != null && diagramType != null && !diagramType.equals("")) { //$NON-NLS-1$
store.setValue(PreferencesConstantsHelper.VIEW_GRID_CONSTANT, globalPreferenceStore.getBoolean(PreferencesConstantsHelper.getDiagramConstant(diagramType, PreferencesConstantsHelper.VIEW_GRID)));
store.setValue(PreferencesConstantsHelper.VIEW_RULERS_CONSTANT, globalPreferenceStore.getBoolean(PreferencesConstantsHelper.getDiagramConstant(diagramType, PreferencesConstantsHelper.VIEW_RULER)));
store.setValue(PreferencesConstantsHelper.GRID_ORDER_CONSTANT, globalPreferenceStore.getBoolean(PreferencesConstantsHelper.getDiagramConstant(diagramType, PreferencesConstantsHelper.GRID_ORDER)));
@@ -141,29 +140,29 @@ public class DiagramPreferencesDefaultButton extends Composite {
}
/**
- *
+ *
* @return the preference store
*/
protected IPreferenceStore getPreferencesStore() {
final IStructuredSelection selection = this.input.getSelection();
final Object firstElement = selection.getFirstElement();
- if(firstElement instanceof EditPart) {
- return DiagramEditPartsUtil.getDiagramWorkspacePreferenceStore((EditPart)firstElement);
+ if (firstElement instanceof EditPart) {
+ return DiagramEditPartsUtil.getDiagramWorkspacePreferenceStore((EditPart) firstElement);
}
return null;
}
/**
- *
+ *
* @return
* the type of the diagram
*/
protected String getDiagramType() {
final IStructuredSelection selection = this.input.getSelection();
final Object firstElement = selection.getFirstElement();
- if(firstElement instanceof EditPart) {
- final DiagramEditPart diagramEditPart = DiagramEditPartsUtil.getDiagramEditPart((EditPart)firstElement);
- final Diagram diagram = (Diagram)diagramEditPart.getAdapter(Diagram.class);
+ if (firstElement instanceof EditPart) {
+ final DiagramEditPart diagramEditPart = DiagramEditPartsUtil.getDiagramEditPart((EditPart) firstElement);
+ final Diagram diagram = (Diagram) diagramEditPart.getAdapter(Diagram.class);
return diagram.getType();
}
return ""; //$NON-NLS-1$

Back to the top