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.widgets
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.widgets')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/Activator.java22
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/ColorPickerEditor.java34
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareColorPicker.java14
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareFontEditor.java8
4 files changed, 39 insertions, 39 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/Activator.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/Activator.java
index 714eb26ca1f..cdf23022ad5 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/Activator.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/Activator.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
@@ -57,7 +57,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
@@ -66,9 +66,9 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the image at the given path from this plugin
- *
+ *
* @param path
- * the path of the image to be displayed
+ * the path of the image to be displayed
* @return The Image at the given location, or null if it couldn't be found
*/
public Image getImage(String path) {
@@ -77,11 +77,11 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the image from the given image descriptor
- *
+ *
* @param pluginId
- * The plugin in which the image is located
+ * The plugin in which the image is located
* @param path
- * The path to the image from the plugin
+ * The path to the image from the plugin
* @return
* The Image at the given location, or null if it couldn't be found
*/
@@ -89,7 +89,7 @@ public class Activator extends AbstractUIPlugin {
final ImageRegistry registry = getImageRegistry();
String key = pluginId + "/" + path; //$NON-NLS-1$
Image image = registry.get(key);
- if(image == null) {
+ if (image == null) {
registry.put(key, AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, path));
image = registry.get(key);
}
@@ -98,14 +98,14 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the image from the given path
- *
+ *
* @param imagePath
- * The path of the image, in the form /<plug-in ID>/<path to the image>
+ * The path of the image, in the form /<plug-in ID>/<path to the image>
* @return
* The Image at the given location, or null if none was found
*/
public Image getImageFromPlugin(String imagePath) {
- if(imagePath.startsWith("/")) { //$NON-NLS-1$
+ if (imagePath.startsWith("/")) { //$NON-NLS-1$
String pluginId, path;
imagePath = imagePath.substring(1, imagePath.length());
pluginId = imagePath.substring(0, imagePath.indexOf("/")); //$NON-NLS-1$
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/ColorPickerEditor.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/ColorPickerEditor.java
index 548c2712d45..0f96ad77657 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/ColorPickerEditor.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/ColorPickerEditor.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
@@ -64,7 +64,7 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
Rectangle r = colorPicker.getBounds();
Point location = colorPicker.getParent().toDisplay(r.x, r.y);
colorPickerPopup.open(new Point(location.x, location.y + r.height));
- if(colorPickerPopup.getSelectedColor() == null && !colorPickerPopup.useDefaultColor()) {
+ if (colorPickerPopup.getSelectedColor() == null && !colorPickerPopup.useDefaultColor()) {
return;
}
setColor(colorPickerPopup.getSelectedColor());
@@ -72,15 +72,15 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
}
public void widgetDefaultSelected(SelectionEvent e) {
- //Nothing
+ // Nothing
}
});
}
@Override
protected void doBinding() {
- //We don't do a real databinding here
- if(modelProperty != null) {
+ // We don't do a real databinding here
+ if (modelProperty != null) {
getParent().addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
@@ -94,7 +94,7 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
@Override
public void dispose() {
- if(modelProperty != null) {
+ if (modelProperty != null) {
modelProperty.removeChangeListener(this);
}
super.dispose();
@@ -106,7 +106,7 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
doSetColor(colorValue);
- if(modelProperty != null) {
+ if (modelProperty != null) {
modelProperty.setValue(colorValue);
}
}
@@ -119,13 +119,13 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
/**
* Sets the image for a color button (square filled with the color that button represents)
- *
+ *
* @see GradientFieldEditor#setButtonImage(RGB)
*/
private void updateButton() {
// First, dispose the current image, if any
Image image = colorPicker.getImage();
- if(image != null) {
+ if (image != null) {
image.dispose();
}
@@ -133,7 +133,7 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
// Now set the new image based on rgbColor
Color color = new Color(display, this.color);
- //TODO : Find a way to instantiate a transparent image (Instead of a default-white one)
+ // TODO : Find a way to instantiate a transparent image (Instead of a default-white one)
image = backgroundImage == null ? new Image(display, 16, 16) : new Image(display, backgroundImage.getBounds());
GC gc = new GC(image);
@@ -145,7 +145,7 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
gc.setBackground(color);
gc.setForeground(color);
- if(backgroundImage != null) {
+ if (backgroundImage != null) {
gc.fillRectangle(defaultColorBoundsWithImage);
gc.drawImage(backgroundImage, 0, 0);
} else {
@@ -169,7 +169,7 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
@Override
public Integer getValue() {
- if(color == null) {
+ if (color == null) {
return defaultColor;
}
@@ -197,9 +197,9 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
}
public void handleChange(ChangeEvent event) {
- if(modelProperty != null) {
- Integer value = (Integer)modelProperty.getValue();
- if(value == null) {
+ if (modelProperty != null) {
+ Integer value = (Integer) modelProperty.getValue();
+ if (value == null) {
value = 0;
}
@@ -215,9 +215,9 @@ public class ColorPickerEditor extends AbstractValueEditor implements IChangeLis
/**
* Sets the default color for this Editor. The default color
* will be set when the "Default" button is pressed.
- *
+ *
* @param color
- * The default color for this editor
+ * The default color for this editor
*/
public void setDefaultColor(int color) {
this.defaultColor = color;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareColorPicker.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareColorPicker.java
index 35f3b7cb4b6..d1742767c1a 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareColorPicker.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareColorPicker.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
@@ -20,9 +20,9 @@ import org.eclipse.swt.widgets.Composite;
/**
* A widget to edit Colors represented by an Integer (RGB) value
* The editor is a Button with a color-picker popup.
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class XWTAwareColorPicker extends AbstractPropertyEditor {
@@ -40,7 +40,7 @@ public class XWTAwareColorPicker extends AbstractPropertyEditor {
public void setImage(String imagePath) {
this.imagePath = imagePath;
Image image = Activator.getDefault().getImageFromPlugin(imagePath);
- if(image != null) {
+ if (image != null) {
editor.setImage(image);
}
}
@@ -49,8 +49,8 @@ public class XWTAwareColorPicker extends AbstractPropertyEditor {
protected void doBinding() {
super.doBinding();
Object defaultValue = input.getDefaultValue(propertyPath);
- if(defaultValue instanceof Integer) {
- editor.setDefaultColor((Integer)defaultValue);
+ if (defaultValue instanceof Integer) {
+ editor.setDefaultColor((Integer) defaultValue);
}
}
@@ -59,7 +59,7 @@ public class XWTAwareColorPicker extends AbstractPropertyEditor {
}
protected void checkBounds() {
- if(x > -1 && y > -1 && width > -1 && height > -1) {
+ if (x > -1 && y > -1 && width > -1 && height > -1) {
editor.setColorBounds(new Rectangle(x, y, width, height));
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareFontEditor.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareFontEditor.java
index 5cf5d1acac9..ea935adff62 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareFontEditor.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.widgets/src/org/eclipse/papyrus/infra/gmfdiag/widgets/editors/XWTAwareFontEditor.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
@@ -47,12 +47,12 @@ public class XWTAwareFontEditor extends AbstractPropertyEditor {
}
private synchronized static IStaticContentProvider getFontContentProvider() {
- if(fontContentProvider == null) {
+ if (fontContentProvider == null) {
FontData[] fontDatas = Display.getDefault().getFontList(null, true);
Set<String> fontNames = new HashSet<String>();
- for(FontData data : fontDatas) {
- if(data.getName() != null) {
+ for (FontData data : fontDatas) {
+ if (data.getName() != null) {
fontNames.add(data.getName());
}
}

Back to the top