Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2013-12-11 16:28:28 +0000
committerVincent Lorenzo2013-12-11 16:28:28 +0000
commit59ce8f4db28685083549d1ea989f08b939f6af43 (patch)
treebcbfa061f4901a326b42d9ce7a78b3decf450ce9 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences
parent4805b01c69b5ca19eeae72dcb353539f40053dbc (diff)
downloadorg.eclipse.papyrus-59ce8f4db28685083549d1ea989f08b939f6af43.tar.gz
org.eclipse.papyrus-59ce8f4db28685083549d1ea989f08b939f6af43.tar.xz
org.eclipse.papyrus-59ce8f4db28685083549d1ea989f08b939f6af43.zip
422553: [Diagram] Status (checked/uncheked) of the grid actions are not
updated when we change a new diagram take the focus https://bugs.eclipse.org/bugs/show_bug.cgi?id=422553 422406: Snap to grid disabled still makes snap to grid https://bugs.eclipse.org/bugs/show_bug.cgi?id=422406 423799: [Diagram]Rulers and Grid preferences are not customizable for each diagrams https://bugs.eclipse.org/bugs/show_bug.cgi?id=423799 423805: [Preferences] Key used for Preferences is the string "null" for all inherited diagrams (SysML Diagram + Uml Package +...) https://bugs.eclipse.org/bugs/show_bug.cgi?id=423805
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/plugin.xml17
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceInitializer.java3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceStore.java22
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java22
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/AbstractPapyrusElementPreferencePage.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/DiagramPreferencePage.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java43
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/internal/PapyrusRulersAndGridPreferencePage.java72
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/AbstractGroup.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/BackgroundColor.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/ConnectionGroup.java16
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DecorationGroup.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DimensionGroup.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/FontGroup.java5
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LabelGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LinkColorGroup.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeColorGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeCompartmentGroup.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedCompartmentGroup.java6
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedLabelGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/RulersAndGridGroup.java494
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramBackgroundColor.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramConnectionGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDecorationGroup.java1
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDimensionGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramFontGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramLinkColorGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramNodeColorGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramRulersAndGridGroup.java51
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/dialog/AbstractPreferenceKeyDialog.java22
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorBackgroundColor.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDecorationGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDimensionGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorFontGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorLinkColorGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorNodeColorGroup.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorRulersAndGridGroup.java49
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/utils/PreferenceConstantHelper.java211
41 files changed, 790 insertions, 366 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/META-INF/MANIFEST.MF
index 0c51d06a057..7690f0eab37 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/META-INF/MANIFEST.MF
@@ -1,6 +1,8 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.properties,
- org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
+ com.ibm.icu
Export-Package: org.eclipse.papyrus.infra.gmfdiag.preferences,
org.eclipse.papyrus.infra.gmfdiag.preferences.initializer,
org.eclipse.papyrus.infra.gmfdiag.preferences.jface.preference;x-internal:=true,
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/plugin.xml
index 65c0af373e8..d9d530745f0 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/plugin.xml
@@ -16,12 +16,6 @@
</page>
<page
category="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory"
- class="org.eclipse.papyrus.infra.gmfdiag.preferences.pages.internal.PapyrusRulersAndGridPreferencePage"
- id="org.eclipse.papyrus.infra.gmfdiag.preferences.rulersandgrid"
- name="Rulers And Grid">
- </page>
- <page
- category="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory"
class="org.eclipse.papyrus.infra.gmfdiag.preferences.pages.internal.PapyrusPrintingPreferencePage"
id="org.eclipse.papyrus.infra.gmfdiag.preferences.printing"
name="Printing">
@@ -58,17 +52,6 @@
</page>
<page
category="org.eclipse.papyrus.infra.gmfdiag.preferences.properties.generalcategory"
- class="org.eclipse.papyrus.infra.gmfdiag.preferences.pages.internal.PapyrusRulersAndGridPreferencePage"
- id="org.eclipse.papyrus.infra.gmfdiag.preferences.properties.rulersandgrid"
- name="Rulers And Grid">
- <enabledWhen>
- <adapt
- type="org.eclipse.core.resources.IProject">
- </adapt>
- </enabledWhen>
- </page>
- <page
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.properties.generalcategory"
class="org.eclipse.papyrus.infra.gmfdiag.preferences.pages.internal.PapyrusPrintingPreferencePage"
id="org.eclipse.papyrus.infra.gmfdiag.preferences.properties.printing"
name="Printing">
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceInitializer.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceInitializer.java
index b55ecc29363..7ed0f90ecd5 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceInitializer.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceInitializer.java
@@ -17,7 +17,6 @@ import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.PapyrusAllDiagramsPreferencePage;
import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.internal.PapyrusPrintingPreferencePage;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.internal.PapyrusRulersAndGridPreferencePage;
import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.internal.PapyrusUML2PreferencePage;
/**
@@ -39,7 +38,7 @@ public class PapyrusPreferenceInitializer extends AbstractPreferenceInitializer
@Override
public void initializeDefaultPreferences() {
PapyrusAllDiagramsPreferencePage.initDefaults(store);
- PapyrusRulersAndGridPreferencePage.initDefaults(store);
+ // PapyrusRulersAndGridPreferencePage.initDefaults(store);
PapyrusPrintingPreferencePage.initDefaults(store);
PapyrusUML2PreferencePage.initDefaults(store);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceStore.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceStore.java
index eb8a48bf6a8..9aa7376e7c5 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceStore.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/PapyrusPreferenceStore.java
@@ -18,8 +18,8 @@ import java.util.Iterator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.dialog.ApplyValueOnPreferenceKeyDialog;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
/**
* this class is a specific store that is used to look for value of element
@@ -44,14 +44,14 @@ public class PapyrusPreferenceStore extends PapyrusScopedPreferenceStore {
try {
for(int i = 0; i < getStorePreferences().keys().length; i++) {
//level diagram collect only element
- if(level.startsWith(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX)) {
- if(getStorePreferences().keys()[i].startsWith(PreferenceConstantHelper.DIAGRAM_ELEMENT)) {
+ if(level.startsWith(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX)) {
+ if(getStorePreferences().keys()[i].startsWith(PreferencesConstantsHelper.DIAGRAM_ELEMENT)) {
elementKey.add(getStorePreferences().keys()[i]);
}
}
//editor level, collect all element+diagram
- else if(level.startsWith(PreferenceConstantHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX)) {
- if((getStorePreferences().keys()[i].startsWith(PreferenceConstantHelper.DIAGRAM_ELEMENT)) || (getStorePreferences().keys()[i].startsWith(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX))) {
+ else if(level.startsWith(PreferencesConstantsHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX)) {
+ if((getStorePreferences().keys()[i].startsWith(PreferencesConstantsHelper.DIAGRAM_ELEMENT)) || (getStorePreferences().keys()[i].startsWith(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX))) {
elementKey.add(getStorePreferences().keys()[i]);
}
}
@@ -194,19 +194,19 @@ public class PapyrusPreferenceStore extends PapyrusScopedPreferenceStore {
protected String getUpperKey(String initialKey) {
String out = initialKey.toString();
- if(initialKey.startsWith(PreferenceConstantHelper.DIAGRAM_ELEMENT)) {
- out = initialKey.toString().replaceAll(PreferenceConstantHelper.DIAGRAM_ELEMENT, PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX);
+ if(initialKey.startsWith(PreferencesConstantsHelper.DIAGRAM_ELEMENT)) {
+ out = initialKey.toString().replaceAll(PreferencesConstantsHelper.DIAGRAM_ELEMENT, PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX);
out = out.substring(0, out.lastIndexOf("_")) + out.substring(out.indexOf("."), out.length());
}
- if(initialKey.startsWith(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX)) {
- // out=initialKey.toString().replaceAll(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX, PreferenceConstantHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX);
- out = PreferenceConstantHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX + out.substring(out.indexOf("."), out.length());
+ if(initialKey.startsWith(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX)) {
+ // out=initialKey.toString().replaceAll(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX, PreferencesConstantsHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX);
+ out = PreferencesConstantsHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX + out.substring(out.indexOf("."), out.length());
}
return out;
}
protected boolean hasPrefix(String key) {
- if(key.startsWith(PreferenceConstantHelper.DIAGRAM_ELEMENT) || key.startsWith(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX)) {
+ if(key.startsWith(PreferencesConstantsHelper.DIAGRAM_ELEMENT) || key.startsWith(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX)) {
return true;
}
return false;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java
index a405f7779b5..1db6cf676fb 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java
@@ -1,3 +1,16 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.preferences.messages;
import org.eclipse.osgi.util.NLS;
@@ -7,6 +20,15 @@ public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.gmfdiag.preferences.messages.messages"; //$NON-NLS-1$
public static String LabelGroup_Labels_To_Display;
+
+ public static String RulersAndGridGroup_GridColor;
+
+ public static String RulersAndGridGroup_GridInFront;
+
+ public static String RulersAndGridGroup_GridStyle;
+
+
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties
index bb2c968ed60..32eec8f4ccd 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties
@@ -1 +1,7 @@
LabelGroup_Labels_To_Display=Labels to display
+RulersAndGridGroup_GridColor=Grid Color
+RulersAndGridGroup_GridInFront=Grid In Front
+RulersAndGridGroup_GridStyle=Grid Style
+RulersAndGridGroup_GridColor=Grid Color
+RulersAndGridGroup_GridInFront=Grid In Front
+RulersAndGridGroup_GridStyle=Grid Style
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/AbstractPapyrusElementPreferencePage.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/AbstractPapyrusElementPreferencePage.java
index 377c04373b5..0a4f2b5d5b5 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/AbstractPapyrusElementPreferencePage.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/AbstractPapyrusElementPreferencePage.java
@@ -12,8 +12,8 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.preferences.pages;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.FontGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -68,11 +68,11 @@ public abstract class AbstractPapyrusElementPreferencePage extends AbstractPapyr
* Get the specified preference type associated with this preference page.
*
* @param preferenceType
- * an int representing the preference type to retrieve. It must be a value defined in {@link PreferenceConstantHelper}
+ * an int representing the preference type to retrieve. It must be a value defined in {@link PreferencesConstantsHelper}
* @return the preference constant used to store the given prefence type.
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getElementConstant(getTitle(), preferenceType);
+ return PreferencesConstantsHelper.getElementConstant(getTitle(), preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/DiagramPreferencePage.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/DiagramPreferencePage.java
index 1be6ca17808..152fb97653e 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/DiagramPreferencePage.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/DiagramPreferencePage.java
@@ -25,11 +25,13 @@ import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.ConnectionGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.DecorationGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.FontGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.NodeColorGroup;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.RulersAndGridGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram.DiagramBackgroundColor;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram.DiagramConnectionGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram.DiagramDecorationGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram.DiagramFontGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram.DiagramNodeColorGroup;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram.DiagramRulersAndGridGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -73,6 +75,9 @@ public class DiagramPreferencePage extends DiagramsPreferencePage {
DecorationGroup decorationGroupComposite = new DiagramDecorationGroup(contentGroup, getPreferenceKey(), this);
addAbstractGroup(decorationGroupComposite);
+
+ RulersAndGridGroup viewGroupComposite = new DiagramRulersAndGridGroup(parent, getPreferenceKey(), this);
+ addAbstractGroup(viewGroupComposite);
return super.createContents(parent);
}
@@ -168,7 +173,6 @@ public class DiagramPreferencePage extends DiagramsPreferencePage {
@Override
public void setVisible(boolean visible) {
- // TODO Auto-generated method stub
if(visible == true) {
VisiblePageSingleton.getInstance().setVisiblePage(this);
initGroup();
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java
index dc27266b937..201ec4f46f5 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.notation.Routing;
import org.eclipse.gmf.runtime.notation.Smoothness;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Activator;
import org.eclipse.papyrus.infra.gmfdiag.preferences.PapyrusPreferenceStore;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.BackgroundColor;
@@ -26,14 +27,15 @@ import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.DecorationGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.DimensionGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.FontGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.NodeColorGroup;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.RulersAndGridGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.EditorBackgroundColor;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.EditorConnectionGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.EditorDecorationGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.EditorDimensionGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.EditorFontGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.EditorNodeColorGroup;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.EditorRulersAndGridGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
@@ -70,6 +72,9 @@ public class PapyrusAllDiagramsPreferencePage extends AbstractPapyrusPreferenceP
DimensionGroup dimensionGroup = new EditorDimensionGroup(contentGroup, getTitle(), this);
addAbstractGroup(dimensionGroup);
+
+ RulersAndGridGroup viewGroupComposite = new EditorRulersAndGridGroup(parent, getTitle(), this);
+ addAbstractGroup(viewGroupComposite);
}
@@ -87,32 +92,34 @@ public class PapyrusAllDiagramsPreferencePage extends AbstractPapyrusPreferenceP
public static void initDefaults(IPreferenceStore store) {
//Nodes
- PreferenceConverter.setDefault(store, PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- PreferenceConverter.setDefault(store, PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+ PreferenceConverter.setDefault(store, PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
// Set the default for the gradient
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.GRADIENT_POLICY), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.GRADIENT_POLICY), false);
GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
// Links
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.SMOOTHNESS), Smoothness.NONE);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.JUMPLINK_STATUS), JumpLinkStatus.NONE);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.JUMPLINK_TYPE), JumpLinkStatus.NONE);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.JUMPLINK_REVERSE), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.SMOOTHNESS), Smoothness.NONE);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.JUMPLINK_STATUS), JumpLinkStatus.NONE);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.JUMPLINK_TYPE), JumpLinkStatus.NONE);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.JUMPLINK_REVERSE), false);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.ROUTING_STYLE), Routing.MANUAL);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.ROUTING_POLICY_OBSTRUCTION), false);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.ROUTING_POLICY_DISTANCE), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.ROUTING_STYLE), Routing.MANUAL);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.ROUTING_POLICY_OBSTRUCTION), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.ROUTING_POLICY_DISTANCE), false);
//decoration
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.SHADOW), false);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.ELEMENTICON), false);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.QUALIFIEDNAME), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.SHADOW), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.ELEMENTICON), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.QUALIFIEDNAME), false);
//dimension
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.WIDTH), 100);
- store.setDefault(PreferenceConstantHelper.getPapyrusEditorConstant(PreferenceConstantHelper.HEIGHT), 100);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.WIDTH), 100);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.HEIGHT), 100);
+ //Rulers and grid group
+ RulersAndGridGroup.initDefaults(store);
}
/**
@@ -120,7 +127,7 @@ public class PapyrusAllDiagramsPreferencePage extends AbstractPapyrusPreferenceP
*/
public void storeAllPreferences() {
super.storeAllPreferences();
- ((PapyrusPreferenceStore)getPreferenceStore()).deleteAllSubPreference(PreferenceConstantHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX);
+ ((PapyrusPreferenceStore)getPreferenceStore()).deleteAllSubPreference(PreferencesConstantsHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/internal/PapyrusRulersAndGridPreferencePage.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/internal/PapyrusRulersAndGridPreferencePage.java
deleted file mode 100644
index 9b60f04eb2f..00000000000
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/internal/PapyrusRulersAndGridPreferencePage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
- * Copyright (c) 2008 Atos Origin.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Thibault Landre (Atos Origin) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.preferences.pages.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.Activator;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
-
-/**
- * The preference page for the rulers and grid
- *
- * @author tlandre
- */
-public class PapyrusRulersAndGridPreferencePage extends RulerGridPreferencePage implements IWorkbenchPropertyPage {
-
- private IProject project;
-
- public PapyrusRulersAndGridPreferencePage() {
- setPreferenceStore(null);
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement()
- */
- public IAdaptable getElement() {
- return project;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime.IAdaptable)
- */
- public void setElement(IAdaptable element) {
- project = (IProject)element.getAdapter(IResource.class);
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- IPreferenceStore store;
- if(project != null) {
- store = new ScopedPreferenceStore(new ProjectScope(project), getBundleId());
- } else {
- store = new ScopedPreferenceStore(new InstanceScope(), getBundleId());
- }
- return store;
- }
-
- /**
- * @return this bundle ID.
- */
- private String getBundleId() {
- return Activator.PLUGIN_ID;
- }
-}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/AbstractGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/AbstractGroup.java
index 0a6ac336c04..dfbfe516602 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/AbstractGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/AbstractGroup.java
@@ -19,7 +19,7 @@ import java.util.Set;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -92,12 +92,12 @@ public abstract class AbstractGroup extends Composite {
* Get the specified preference type associated with this preference page.
*
* @param preferenceType
- * an int representing the preference type to retrieve. It must be a value defined in {@link PreferenceConstantHelper}
+ * an int representing the preference type to retrieve. It must be a value defined in {@link PreferencesConstantsHelper}
*
* @return the preference constant used to store the given preference type.
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getElementConstant(key, preferenceType);
+ return PreferencesConstantsHelper.getElementConstant(key, preferenceType);
}
/**
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/BackgroundColor.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/BackgroundColor.java
index 5310a9612f1..7a622bbc66c 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/BackgroundColor.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/BackgroundColor.java
@@ -18,9 +18,9 @@ import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Messages;
import org.eclipse.papyrus.infra.gmfdiag.preferences.jface.preference.GradientFieldEditor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -75,13 +75,13 @@ public class BackgroundColor extends AbstractGroup {
Label useGradientLabel = new Label(useGradientCompo, SWT.NULL);
useGradientLabel.setText(Messages.AbstractPapyrusNodePreferencePage_Activate);
Composite useGradientFillEditorCompo = getEncapsulatedCompo(useGradientCompo);
- useGradientFillEditor = new BooleanFieldEditor(getPreferenceConstant(PreferenceConstantHelper.GRADIENT_POLICY), "", useGradientFillEditorCompo); //$NON-NLS-1$
+ useGradientFillEditor = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.GRADIENT_POLICY), "", useGradientFillEditorCompo); //$NON-NLS-1$
useGradientFillEditor.setPage(dialogPage);
addFieldEditor(useGradientFillEditor);
Composite gradientFillEditorCompo = getEncapsulatedCompo(fillColorGroup);
- gradientFillEditor = new GradientFieldEditor(getPreferenceConstant(PreferenceConstantHelper.COLOR_GRADIENT), gradientFillEditorCompo);
+ gradientFillEditor = new GradientFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.COLOR_GRADIENT), gradientFillEditorCompo);
gradientFillEditor.setPage(dialogPage);
gradientFillEditor.setEnabled(useGradientFillEditor.getBooleanValue());
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/ConnectionGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/ConnectionGroup.java
index 24743f10387..adad25c62b2 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/ConnectionGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/ConnectionGroup.java
@@ -20,8 +20,8 @@ import org.eclipse.gmf.runtime.notation.Smoothness;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.ComboFieldEditor;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Messages;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
@@ -111,7 +111,7 @@ public class ConnectionGroup extends AbstractGroup {
connectionGroup.setLayout(new GridLayout());
connectionGroup.setText(Messages.AbstractPapyrusLinkPreferencePage_Connection);
- ComboFieldEditor smoothnessComboFieldEditor = new ComboFieldEditor(getPreferenceConstant(PreferenceConstantHelper.SMOOTHNESS), Messages.AbstractPapyrusLinkPreferencePage_Smoothness, SMOOTHNESS_COMBOFIELDEDITOR_NAMES_AND_VALUES, connectionGroup);
+ ComboFieldEditor smoothnessComboFieldEditor = new ComboFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.SMOOTHNESS), Messages.AbstractPapyrusLinkPreferencePage_Smoothness, SMOOTHNESS_COMBOFIELDEDITOR_NAMES_AND_VALUES, connectionGroup);
addFieldEditor(smoothnessComboFieldEditor);
@@ -131,17 +131,17 @@ public class ConnectionGroup extends AbstractGroup {
jumpLinkGroup.setLayout(new GridLayout());
jumpLinkGroup.setText(Messages.AbstractPapyrusLinkPreferencePage_JUMPLINKS);
- jumpLinkStatusComboFieldEditor = new ComboFieldEditor(getPreferenceConstant(PreferenceConstantHelper.JUMPLINK_STATUS), JUMPLINK_STATUS_COMBOFIELDEDITOR_LABEL, JUMPLINK_STATUS_COMBOFIELDEDITOR_NAMES_AND_VALUES, jumpLinkGroup);
+ jumpLinkStatusComboFieldEditor = new ComboFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.JUMPLINK_STATUS), JUMPLINK_STATUS_COMBOFIELDEDITOR_LABEL, JUMPLINK_STATUS_COMBOFIELDEDITOR_NAMES_AND_VALUES, jumpLinkGroup);
jumpLinkStatusComboFieldEditor.setPage(dialogPage);
addFieldEditor(jumpLinkStatusComboFieldEditor);
- jumpLinkTypeComboFieldEditor = new ComboFieldEditor(getPreferenceConstant(PreferenceConstantHelper.JUMPLINK_TYPE), JUMPLINK_TYPE_COMBOFIELDEDITOR_LABEL, JUMPLINK_TYPE_COMBOFIELDEDITOR_NAMES_AND_VALUES, jumpLinkGroup);
+ jumpLinkTypeComboFieldEditor = new ComboFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.JUMPLINK_TYPE), JUMPLINK_TYPE_COMBOFIELDEDITOR_LABEL, JUMPLINK_TYPE_COMBOFIELDEDITOR_NAMES_AND_VALUES, jumpLinkGroup);
jumpLinkTypeComboFieldEditor.setPage(dialogPage);
addFieldEditor(jumpLinkTypeComboFieldEditor);
- jumpLinkReverseBooleanFieldEditor = new BooleanFieldEditor(getPreferenceConstant(PreferenceConstantHelper.JUMPLINK_REVERSE), JUMPLINK_REVERSE_BOOLEANFIELDEDITOR_LABEL, jumpLinkGroup);
+ jumpLinkReverseBooleanFieldEditor = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.JUMPLINK_REVERSE), JUMPLINK_REVERSE_BOOLEANFIELDEDITOR_LABEL, jumpLinkGroup);
jumpLinkReverseBooleanFieldEditor.setPage(dialogPage);
addFieldEditor(jumpLinkReverseBooleanFieldEditor);
@@ -158,17 +158,17 @@ public class ConnectionGroup extends AbstractGroup {
routingGroup.setLayout(new GridLayout());
routingGroup.setText(Messages.AbstractPapyrusLinkPreferencePage_Routing);
- routingStylesComboFieldEditor = new ComboFieldEditor(getPreferenceConstant(PreferenceConstantHelper.ROUTING_STYLE), ROUTING_STYLES_COMBOFIELDEDITOR_LABEL, ROUTING_STYLES_COMBOFIELDEDITOR_NAMES_AND_VALUES, routingGroup);
+ routingStylesComboFieldEditor = new ComboFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.ROUTING_STYLE), ROUTING_STYLES_COMBOFIELDEDITOR_LABEL, ROUTING_STYLES_COMBOFIELDEDITOR_NAMES_AND_VALUES, routingGroup);
routingStylesComboFieldEditor.setPage(dialogPage);
addFieldEditor(routingStylesComboFieldEditor);
- routingObstructionPolicyBooleanFieldEditor = new BooleanFieldEditor(getPreferenceConstant(PreferenceConstantHelper.ROUTING_POLICY_OBSTRUCTION), ROUTING_OBSTRUCTION_POLICY_BOOLEANFIELDEDITOR_LABEL, routingGroup);
+ routingObstructionPolicyBooleanFieldEditor = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.ROUTING_POLICY_OBSTRUCTION), ROUTING_OBSTRUCTION_POLICY_BOOLEANFIELDEDITOR_LABEL, routingGroup);
routingObstructionPolicyBooleanFieldEditor.setPage(dialogPage);
addFieldEditor(routingObstructionPolicyBooleanFieldEditor);
- routingDistancePolicyBooleanFieldEditor = new BooleanFieldEditor(getPreferenceConstant(PreferenceConstantHelper.ROUTING_POLICY_DISTANCE), ROUTING_DISTANCE_POLICY_BOOLEANFIELDEDITOR_LABEL, routingGroup);
+ routingDistancePolicyBooleanFieldEditor = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.ROUTING_POLICY_DISTANCE), ROUTING_DISTANCE_POLICY_BOOLEANFIELDEDITOR_LABEL, routingGroup);
routingDistancePolicyBooleanFieldEditor.setPage(dialogPage);
addFieldEditor(routingDistancePolicyBooleanFieldEditor);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DecorationGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DecorationGroup.java
index d593ff9e865..31af4f18536 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DecorationGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DecorationGroup.java
@@ -84,4 +84,10 @@ public class DecorationGroup extends AbstractGroup {
addFieldEditor(qualifiedname);
}
+
+ @Override
+ protected String getPreferenceConstant(int preferenceType) {
+ System.out.println(super.getPreferenceConstant(preferenceType));
+ return super.getPreferenceConstant(preferenceType);
+ }
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DimensionGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DimensionGroup.java
index 022a0080167..594e44a6334 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DimensionGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/DimensionGroup.java
@@ -15,8 +15,8 @@ package org.eclipse.papyrus.infra.gmfdiag.preferences.ui;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Messages;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
@@ -65,12 +65,12 @@ public class DimensionGroup extends AbstractGroup {
decorationGroup.setLayout(new GridLayout());
decorationGroup.setText(Messages.DimensionGroupName);
- widthFiedEditor = new IntegerFieldEditor(getPreferenceConstant(PreferenceConstantHelper.WIDTH), WIDTH_INTFIELDEDITOR_LABEL, decorationGroup);
+ widthFiedEditor = new IntegerFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.WIDTH), WIDTH_INTFIELDEDITOR_LABEL, decorationGroup);
widthFiedEditor.setPage(dialogPage);
addFieldEditor(widthFiedEditor);
- heightFiedEditor = new IntegerFieldEditor(getPreferenceConstant(PreferenceConstantHelper.HEIGHT), HEIGHT_INTFIELDEDITOR_LABEL, decorationGroup);
+ heightFiedEditor = new IntegerFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.HEIGHT), HEIGHT_INTFIELDEDITOR_LABEL, decorationGroup);
heightFiedEditor.setPage(dialogPage);
addFieldEditor(heightFiedEditor);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/FontGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/FontGroup.java
index 96d018ae320..6bf54fb1f9d 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/FontGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/FontGroup.java
@@ -14,9 +14,9 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Messages;
import org.eclipse.papyrus.infra.gmfdiag.preferences.jface.preference.FontFieldEditor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -45,6 +45,7 @@ public class FontGroup extends AbstractGroup {
**/
public FontGroup(Composite parent, String key, DialogPage dialogPage) {
super(parent, key, dialogPage);
+ System.out.println("FONT key = " + key);
createContent(parent);
}
@@ -58,7 +59,7 @@ public class FontGroup extends AbstractGroup {
Group fontGroup = new Group(parent, SWT.SHADOW_NONE);
fontGroup.setLayout(new GridLayout(1, true));
fontGroup.setText(FONT_GROUPBOX_LABEL);
- fontFieldEditor = new FontFieldEditor(getPreferenceConstant(PreferenceConstantHelper.FONT), fontGroup);
+ fontFieldEditor = new FontFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.FONT), fontGroup);
addFieldEditor(fontFieldEditor);
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LabelGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LabelGroup.java
index 815e3a76b9d..7a39d492129 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LabelGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LabelGroup.java
@@ -19,10 +19,10 @@ import java.util.TreeMap;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Activator;
import org.eclipse.papyrus.infra.gmfdiag.preferences.messages.Messages;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.CLabelBooleanFieldEditor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridLayout;
@@ -72,7 +72,7 @@ public class LabelGroup extends AbstractGroup {
group.setLayout(new GridLayout());
group.setText(Messages.LabelGroup_Labels_To_Display);
for(String role : myRoles.keySet()) {
- String key = PreferenceConstantHelper.getLabelElementConstant(getKey(), role, PreferenceConstantHelper.LABEL_VISIBILITY);
+ String key = PreferencesConstantsHelper.getLabelElementConstant(getKey(), role, PreferencesConstantsHelper.LABEL_VISIBILITY);
Image im = null;
String iconPath = myRoles.get(role);
if(iconPath != null && iconPath != "") { //$NON-NLS-1$
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LinkColorGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LinkColorGroup.java
index e862781d57e..142b71f8bdb 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LinkColorGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/LinkColorGroup.java
@@ -15,9 +15,9 @@ package org.eclipse.papyrus.infra.gmfdiag.preferences.ui;
import org.eclipse.gmf.runtime.diagram.ui.properties.internal.l10n.DiagramUIPropertiesImages;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Messages;
import org.eclipse.papyrus.infra.gmfdiag.preferences.jface.preference.ColorFieldEditor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -74,13 +74,13 @@ public class LinkColorGroup extends AbstractGroup {
toolbar.setLayout(new GridLayout(3, false));
Composite fontColorEditorCompo = getEncapsulatedCompo(toolbar);
- fontColorEditor = new ColorFieldEditor(getPreferenceConstant(PreferenceConstantHelper.COLOR_FONT), DiagramUIPropertiesImages.get(DiagramUIPropertiesImages.IMG_FONT_COLOR), fontColorEditorCompo);
+ fontColorEditor = new ColorFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.COLOR_FONT), DiagramUIPropertiesImages.get(DiagramUIPropertiesImages.IMG_FONT_COLOR), fontColorEditorCompo);
fontColorEditor.setPage(dialogPage);
addFieldEditor(fontColorEditor);
Composite lineColorEditorCompo = getEncapsulatedCompo(toolbar);
- lineColorEditor = new ColorFieldEditor(getPreferenceConstant(PreferenceConstantHelper.COLOR_LINE), DiagramUIPropertiesImages.get(DiagramUIPropertiesImages.IMG_LINE_COLOR), lineColorEditorCompo);
+ lineColorEditor = new ColorFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.COLOR_LINE), DiagramUIPropertiesImages.get(DiagramUIPropertiesImages.IMG_LINE_COLOR), lineColorEditorCompo);
lineColorEditor.setPage(dialogPage);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeColorGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeColorGroup.java
index 757a57126f5..8773bed4a82 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeColorGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeColorGroup.java
@@ -15,8 +15,8 @@ package org.eclipse.papyrus.infra.gmfdiag.preferences.ui;
import org.eclipse.gmf.runtime.diagram.ui.properties.internal.l10n.DiagramUIPropertiesImages;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.jface.preference.ColorFieldEditor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -59,7 +59,7 @@ public class NodeColorGroup extends LinkColorGroup {
super.createContent(parent);
Composite fillColorEditorCompo = getEncapsulatedCompo(getToolbar());
- fillColorEditor = new ColorFieldEditor(getPreferenceConstant(PreferenceConstantHelper.COLOR_FILL), DiagramUIPropertiesImages.get(DiagramUIPropertiesImages.IMG_FILL_COLOR), fillColorEditorCompo);
+ fillColorEditor = new ColorFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.COLOR_FILL), DiagramUIPropertiesImages.get(DiagramUIPropertiesImages.IMG_FILL_COLOR), fillColorEditorCompo);
fillColorEditor.setPage(dialogPage);
addFieldEditor(fillColorEditor);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeCompartmentGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeCompartmentGroup.java
index b8c70f9fe09..bac2da99fae 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeCompartmentGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/NodeCompartmentGroup.java
@@ -21,7 +21,7 @@ import java.util.Set;
import org.eclipse.gmf.runtime.common.ui.preferences.CheckBoxFieldEditor;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -84,12 +84,12 @@ public class NodeCompartmentGroup extends AbstractGroup {
gridData.horizontalSpan = 2;
group.setLayoutData(gridData);
- String compartmentVisibilityPreference = PreferenceConstantHelper.getCompartmentElementConstant(getKey(), compartment, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
+ String compartmentVisibilityPreference = PreferencesConstantsHelper.getCompartmentElementConstant(getKey(), compartment, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY);
String compartmentVisibilityLabel = "Show compartment";
Button showCompartmentButton = addCheckboxField(group, compartmentVisibilityPreference, compartmentVisibilityLabel);
if(this.compartmentsWithTitle.contains(compartment)) {
- String compartmentNameVisibilityPreference = PreferenceConstantHelper.getCompartmentElementConstant(getKey(), compartment, PreferenceConstantHelper.COMPARTMENT_NAME_VISIBILITY);
+ String compartmentNameVisibilityPreference = PreferencesConstantsHelper.getCompartmentElementConstant(getKey(), compartment, PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY);
String compartmentNameVisibilityLabel = "Show title";
Button showNameButton = addCheckboxField(group, compartmentNameVisibilityPreference, compartmentNameVisibilityLabel);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedCompartmentGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedCompartmentGroup.java
index c8027053a2d..d7899d772f4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedCompartmentGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedCompartmentGroup.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.eclipse.gmf.runtime.common.ui.preferences.CheckBoxFieldEditor;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -83,12 +83,12 @@ public class OrderedCompartmentGroup extends AbstractGroup {
gridData.horizontalSpan = 2;
group.setLayoutData(gridData);
- String compartmentVisibilityPreference = PreferenceConstantHelper.getCompartmentElementConstant(getKey(), compartmentName, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
+ String compartmentVisibilityPreference = PreferencesConstantsHelper.getCompartmentElementConstant(getKey(), compartmentName, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY);
String compartmentVisibilityLabel = "Show compartment";
Button showCompartmentButton = addCheckboxField(group, compartmentVisibilityPreference, compartmentVisibilityLabel);
if(this.compartmentsWithTitle.contains(compartmentName)) {
- String compartmentNameVisibilityPreference = PreferenceConstantHelper.getCompartmentElementConstant(getKey(), compartmentName, PreferenceConstantHelper.COMPARTMENT_NAME_VISIBILITY);
+ String compartmentNameVisibilityPreference = PreferencesConstantsHelper.getCompartmentElementConstant(getKey(), compartmentName, PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY);
String compartmentNameVisibilityLabel = "Show title";
Button showNameButton = addCheckboxField(group, compartmentNameVisibilityPreference, compartmentNameVisibilityLabel);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedLabelGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedLabelGroup.java
index f5aefe03a64..7f48655ef36 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedLabelGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/OrderedLabelGroup.java
@@ -21,10 +21,10 @@ import java.util.Map;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Activator;
import org.eclipse.papyrus.infra.gmfdiag.preferences.messages.Messages;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor.CLabelBooleanFieldEditor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridLayout;
@@ -92,7 +92,7 @@ public class OrderedLabelGroup extends AbstractGroup {
group.setLayout(new GridLayout());
group.setText(Messages.LabelGroup_Labels_To_Display);
for(String role : myRoles.keySet()) {
- String key = PreferenceConstantHelper.getLabelElementConstant(getKey(), role, PreferenceConstantHelper.LABEL_VISIBILITY);
+ String key = PreferencesConstantsHelper.getLabelElementConstant(getKey(), role, PreferencesConstantsHelper.LABEL_VISIBILITY);
Image im = null;
String iconPath = myRoles.get(role);
if(iconPath != null && iconPath != "") { //$NON-NLS-1$
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/RulersAndGridGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/RulersAndGridGroup.java
new file mode 100644
index 00000000000..1c7033d76ae
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/RulersAndGridGroup.java
@@ -0,0 +1,494 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.preferences.ui;
+
+import java.text.ParseException;
+import java.text.ParsePosition;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.gef.rulers.RulerProvider;
+import org.eclipse.gmf.runtime.common.ui.preferences.ComboFieldEditor;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.properties.internal.l10n.DiagramUIPropertiesImages;
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.LineStyleLabelProvider;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.UnitsConstants;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.UnitsConverterUtils;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.jface.preference.ColorFieldEditor;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.messages.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import com.ibm.icu.text.NumberFormat;
+
+/**
+ *
+ * This group provides the elements to manage the grid of a diagram
+ * Adapter code from the Preference Page Rulers And Grid
+ */
+@SuppressWarnings("restriction")
+public class RulersAndGridGroup extends AbstractGroup {
+
+ private int oldUnits = -1;
+
+ private String RULER_GROUP_LABEL = DiagramUIMessages.GridRulerPreferencePage_rulerGroup_label;
+
+ private String SHOW_RULERS_LABEL = DiagramUIMessages.GridRulerPreferencePage_showRulers_label;
+
+ private String RULER_UNITS_LABEL = DiagramUIMessages.GridRulerPreferencePage_rulerUnits_label;
+
+ private String RULER_UNITS_IN_LABEL = DiagramUIMessages.GridRulerPreferencePage_rulerUnits_inch_label;
+
+ private String RULER_UNITS_CM_LABEL = DiagramUIMessages.GridRulerPreferencePage_rulerUnits_cm_label;
+
+ private String RULER_UNITS_PIXEL_LABEL = DiagramUIMessages.GridRulerPreferencePage_rulerUnits_pixel_label;
+
+ private String GRID_GROUP_LABEL = DiagramUIMessages.GridRulerPreferencePage_gridGroup_label;
+
+ private String SHOW_GRID_LABEL = DiagramUIMessages.GridRulerPreferencePage_showGrid_label;
+
+ private String SNAP_TO_GRID_LABEL = DiagramUIMessages.GridRulerPreferencePage_snapToGrid_label;
+
+ private String SNAP_TO_GEOMETRY_LABEL = DiagramUIMessages.GridRulerPreferencePage_snapToGeometry_label;
+
+ private String GRID_SPACING_LABEL_INCHES = DiagramUIMessages.GridRulerPreferencePage_gridSpacing_label_inches;
+
+ private String GRID_SPACING_LABEL_CM = DiagramUIMessages.GridRulerPreferencePage_gridSpacing_label_cm;
+
+ private String GRID_SPACING_LABEL_PIXELS = DiagramUIMessages.GridRulerPreferencePage_gridSpacing_label_pixels;
+
+ protected String getPreferenceConstant(int preferenceType) {
+ return PreferencesConstantsHelper.getElementConstant(getKey(), preferenceType);
+ }
+
+ // Ruler Field Editors
+ private BooleanFieldEditor showRulers = null;
+
+ private ComboFieldEditor rulerUnits;
+
+ // Grid Field Editors
+ private BooleanFieldEditor showGrid = null;
+
+ private BooleanFieldEditor snapToGrid = null;
+
+ private BooleanFieldEditor snapToGeometry = null;
+
+ private DoubleFieldEditor gridSpacing = null;
+
+ private BooleanFieldEditor gridInFront = null;
+
+ private ComboFieldEditor gridStyle = null;
+
+ private Composite dblGroup = null;
+
+ private ColorFieldEditor gridColorEditor = null;
+
+ /**
+ *
+ * @param store
+ * the preference store to initialize
+ */
+ public static void initDefaults(IPreferenceStore store) {
+ //rulers and grid
+ // String defaultCountry = Locale.getDefault().getCountry();
+ // if(defaultCountry == null || defaultCountry.equals(Locale.US.getCountry()) || defaultCountry.equals(Locale.CANADA.getCountry())) {
+ // store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.RULER_UNITS), RulerProvider.UNIT_INCHES);
+ // } else {
+ // store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.RULER_UNITS), RulerProvider.UNIT_CENTIMETERS);
+ // }
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.RULER_UNITS), RulerProvider.UNIT_PIXELS);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.VIEW_RULER), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.VIEW_GRID), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.SNAP_TO_GRID), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.SNAP_TO_GEOMETRY), false);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.GRID_LINE_STYLE), Graphics.LINE_CUSTOM);
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.GRID_ORDER), false);
+ final int rgbValue = 50;
+ PreferenceConverter.setDefault(store, PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.GRID_LINE_COLOR), new org.eclipse.swt.graphics.RGB(rgbValue, rgbValue, rgbValue));
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.GRID_SPACING), 20);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * @param key
+ * @param dialogPage
+ */
+ public RulersAndGridGroup(final Composite parent, final String key, final DialogPage dialogPage) {
+ super(parent, key, dialogPage);
+ createContents(parent);
+ }
+
+ /**
+ *
+ * @param parent
+ */
+ public void createContents(final Composite parent) {
+ addRulerFields(parent);
+ addGridFields(parent);
+ }
+
+
+ private void addRulerFields(Composite parent) {
+
+ // Create a Group to hold the ruler fields
+ Group group = new Group(parent, SWT.NONE);
+ group.setText(RULER_GROUP_LABEL);
+
+ GridLayout gridLayout = new GridLayout(1, false);
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.horizontalSpan = 1;
+
+ // Add the fields to the group
+ showRulers = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.VIEW_RULER), SHOW_RULERS_LABEL, group);
+ addFieldEditor(showRulers);
+
+ rulerUnits = new ComboFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.RULER_UNITS), RULER_UNITS_LABEL, group, ComboFieldEditor.INT_TYPE_INDEXED, false, 0, 0, true);
+ addFieldEditor(rulerUnits);
+ rulerUnits.addIndexedItemToCombo(RULER_UNITS_IN_LABEL, RulerProvider.UNIT_INCHES);
+ rulerUnits.addIndexedItemToCombo(RULER_UNITS_CM_LABEL, RulerProvider.UNIT_CENTIMETERS);
+ rulerUnits.addIndexedItemToCombo(RULER_UNITS_PIXEL_LABEL, RulerProvider.UNIT_PIXELS);
+ final Combo rulerUnitsCombo = rulerUnits.getComboControl();
+ rulerUnitsCombo.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ //do nothing
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ updateUnits();
+ }
+ });
+ group.setLayout(gridLayout);
+ group.setLayoutData(gridData);
+
+ }
+
+ private void addGridFields(Composite parent) {
+
+ // Create a Group to hold the grid fields
+ Group group = new Group(parent, SWT.NONE);
+ group.setText(GRID_GROUP_LABEL);
+
+ GridLayout gridLayout = new GridLayout(2, true);
+
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.horizontalSpan = 1;
+
+ showGrid = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.VIEW_GRID), SHOW_GRID_LABEL, group);
+ addFieldEditor(showGrid);
+
+ snapToGrid = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.SNAP_TO_GRID), SNAP_TO_GRID_LABEL, group);
+ addFieldEditor(snapToGrid);
+
+ snapToGeometry = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.SNAP_TO_GEOMETRY), SNAP_TO_GEOMETRY_LABEL, group);
+ addFieldEditor(snapToGeometry);
+
+ gridInFront = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.GRID_ORDER), Messages.RulersAndGridGroup_GridInFront, group);
+ addFieldEditor(gridInFront);
+
+ addGridStyle(group);
+
+ addGridColor(group);
+
+ addGridSpacing(group);
+
+ group.setLayoutData(gridData);
+ group.setLayout(gridLayout);
+ }
+
+ private void addGridStyle(final Composite parent) {
+ final Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, true));
+ this.gridStyle = new ComboFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.GRID_LINE_STYLE), Messages.RulersAndGridGroup_GridStyle, composite, ComboFieldEditor.INT_TYPE_INDEXED, false, 0, 0, true);
+ this.gridStyle.addIndexedItemToCombo(LineStyleLabelProvider.LINE_STYLE_SOLID_STRING, Graphics.LINE_SOLID);
+ this.gridStyle.addIndexedItemToCombo(LineStyleLabelProvider.LINE_STYLE_DASH_STRING, Graphics.LINE_DASH);
+ this.gridStyle.addIndexedItemToCombo(LineStyleLabelProvider.LINE_STYLE_DOT_STRING, Graphics.LINE_DOT);
+ this.gridStyle.addIndexedItemToCombo(LineStyleLabelProvider.LINE_STYLE_DASH_DOT_STRING, Graphics.LINE_DASHDOT);
+ this.gridStyle.addIndexedItemToCombo(LineStyleLabelProvider.LINE_STYLE_DASH_DOT_DOT_STRING, Graphics.LINE_DASHDOTDOT);
+ this.gridStyle.addIndexedItemToCombo(LineStyleLabelProvider.LINE_STYLE_CUSTOM, Graphics.LINE_CUSTOM);
+ addFieldEditor(gridStyle);
+ }
+
+ private void addGridColor(final Composite parent) {
+ final Composite composite = new Composite(parent, SWT.NONE);
+ Label label = new Label(composite, SWT.NONE);
+
+ label.setText(Messages.RulersAndGridGroup_GridColor);
+ gridColorEditor = new ColorFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.GRID_LINE_COLOR), DiagramUIPropertiesImages.get(DiagramUIPropertiesImages.IMG_LINE_COLOR), composite);
+ addFieldEditor(gridColorEditor);
+ composite.setLayout(new GridLayout(2, true));
+ }
+
+
+
+ private void addGridSpacing(Composite parent) {
+
+ dblGroup = new Composite(parent, SWT.NONE);
+
+ GridLayout gridLayout = new GridLayout(2, false);
+
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.horizontalSpan = 2;
+
+ gridSpacing = new DoubleFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.GRID_SPACING), GRID_SPACING_LABEL_INCHES, dblGroup);
+ gridSpacing.setTextLimit(10);
+ addFieldEditor(gridSpacing);
+
+ updateUnits();
+
+ dblGroup.setLayoutData(gridData);
+ dblGroup.setLayout(gridLayout);
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.common.ui.preferences.AbstractPreferencePage#initHelp()
+ */
+ protected void initHelp() {
+ // TODO: Implement to support context help
+ }
+
+ /**
+ * The NumberFormatter.parse() could return a Long or Double
+ * We are storing all values related to the page setup as doubles
+ * so we call this function when ever we are getting values from
+ * the dialog.
+ *
+ * @param number
+ * @return
+ */
+ private Double forceDouble(Number number) {
+ if(!(number instanceof Double))
+ return new Double(number.doubleValue());
+ return (Double)number;
+ }
+
+ private void updateUnits() {
+
+ int units = getUnits();
+
+ switch(units) {
+ case RulerProvider.UNIT_INCHES:
+ gridSpacing.setLabelText(GRID_SPACING_LABEL_INCHES);
+ break;
+
+ case RulerProvider.UNIT_CENTIMETERS:
+ gridSpacing.setLabelText(GRID_SPACING_LABEL_CM);
+ break;
+
+ case RulerProvider.UNIT_PIXELS:
+ gridSpacing.setLabelText(GRID_SPACING_LABEL_PIXELS);
+ break;
+ }
+
+ gridSpacing.setStringValue(UnitsConverterUtils.convertUnits(oldUnits, units, gridSpacing.getStringValue()));
+ oldUnits = units;
+
+ dblGroup.layout();
+
+ }
+
+ private int getUnits() {
+ int units = rulerUnits.getComboControl().getSelectionIndex();
+
+ // IF no selection has been made
+ if(units == -1) {
+ // Read the preference store
+ units = 1;//FIXME;
+ oldUnits = units;
+ }
+ return units;
+ }
+
+ // private String convertUnits(int fromUnits, int toUnits) {
+ // String valueStr = gridSpacing.getStringValue();
+ // if(fromUnits == toUnits) {
+ // return valueStr;
+ // }
+ //
+ // //Double value = Double.valueOf( valueStr );
+ // NumberFormat numberFormatter = NumberFormat.getInstance();
+ // Double value = new Double(0.125);
+ // try {
+ // value = forceDouble(numberFormatter.parse(valueStr));
+ // } catch (ParseException e) {
+ // // Use the default
+ // }
+ // double pixelValue = 0;
+ //
+ // Display display = getDisplay();
+ //
+ // switch(fromUnits) {
+ // case RulerProvider.UNIT_INCHES:
+ // pixelValue = value.doubleValue() * display.getDPI().x;
+ // break;
+ // case RulerProvider.UNIT_CENTIMETERS:
+ // pixelValue = value.doubleValue() * display.getDPI().x / UnitsUtils.INCH2CM;
+ // break;
+ // case RulerProvider.UNIT_PIXELS:
+ // pixelValue = value.intValue();
+ // }
+ //
+ // double returnValue = 0;
+ //
+ // switch(toUnits) {
+ // case RulerProvider.UNIT_INCHES:
+ // returnValue = pixelValue / display.getDPI().x;
+ // break;
+ // case RulerProvider.UNIT_CENTIMETERS:
+ // returnValue = pixelValue * UnitsUtils.INCH2CM / display.getDPI().x;
+ // break;
+ // case RulerProvider.UNIT_PIXELS:
+ // returnValue = pixelValue;
+ // }
+ //
+ // return numberFormatter.format(returnValue);
+ // }
+
+
+ /**
+ *
+ * converts the current units used to a base unit value to be used (e.g. in validation)
+ *
+ * @param number
+ * Units to be converted to the base unit
+ * @return
+ */
+ private double convertToBase(double number) {
+
+ double returnValue = 0;
+ switch(getUnits()) {
+ case RulerProvider.UNIT_INCHES:
+ returnValue = number;
+ break;
+ case RulerProvider.UNIT_CENTIMETERS:
+ returnValue = number / UnitsConstants.INCH2CM;
+ break;
+ case RulerProvider.UNIT_PIXELS:
+ returnValue = number / getDisplay().getDPI().x;
+ }
+ return returnValue;
+ }
+
+ private class DoubleFieldEditor extends StringFieldEditor {
+
+ private double minValidValue = 00.009;
+
+ private double maxValidValue = 99.999;
+
+ public DoubleFieldEditor(String pref, String label, Composite parent) {
+ super(pref, label, parent);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.preference.StringFieldEditor#doCheckState()
+ */
+ protected boolean doCheckState() {
+ Text text = getTextControl();
+
+ if(text == null)
+ return false;
+
+ try {
+ NumberFormat numberFormatter = NumberFormat.getInstance();
+ ParsePosition parsePosition = new ParsePosition(0);
+ Number parsedNumber = numberFormatter.parse(text.getText(), parsePosition);
+
+ if(parsedNumber == null) {
+ showErrorMessage();
+ return false;
+ }
+
+ Double pageHeight = forceDouble(parsedNumber);
+ double number = pageHeight.doubleValue();
+ number = convertToBase(number);
+ if(number >= minValidValue && number <= maxValidValue && parsePosition.getIndex() == text.getText().length()) {
+ clearErrorMessage();
+ return true;
+ } else {
+ showErrorMessage();
+ return false;
+ }
+ } catch (NumberFormatException e1) {
+ showErrorMessage();
+ }
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.preference.StringFieldEditor#doLoadDefault()
+ */
+ protected void doLoadDefault() {
+ Text text = getTextControl();
+ if(text != null) {
+ double value = getPreferenceStore().getDefaultDouble(getPreferenceName());
+ NumberFormat numberFormatter = NumberFormat.getNumberInstance();
+ text.setText(numberFormatter.format(value));
+ }
+ valueChanged();
+ }
+
+ /*
+ * (non-Javadoc)
+ * Method declared on FieldEditor.
+ */
+ protected void doLoad() {
+ Text text = getTextControl();
+ if(text != null) {
+ double value = getPreferenceStore().getDouble(getPreferenceName());
+ NumberFormat numberFormatter = NumberFormat.getNumberInstance();
+ text.setText(numberFormatter.format(value));
+ }
+ }
+
+ protected void doStore() {
+ NumberFormat numberFormatter = NumberFormat.getInstance();
+ Double gridWidth;
+ try {
+ gridWidth = forceDouble(numberFormatter.parse(getTextControl().getText()));
+ getPreferenceStore().setValue(getPreferenceName(), gridWidth.doubleValue());
+ } catch (ParseException e) {
+ showErrorMessage();
+ }
+
+ }
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramBackgroundColor.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramBackgroundColor.java
index b1d211866b6..b4ebd32d316 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramBackgroundColor.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramBackgroundColor.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.BackgroundColor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -38,6 +38,6 @@ public class DiagramBackgroundColor extends BackgroundColor {
}
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getDiagramConstant(getKey(), preferenceType);
+ return PreferencesConstantsHelper.getDiagramConstant(getKey(), preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramConnectionGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramConnectionGroup.java
index 63ecd518ceb..adeea8d27b4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramConnectionGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramConnectionGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.ConnectionGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -39,6 +39,6 @@ public class DiagramConnectionGroup extends ConnectionGroup {
}
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getDiagramConstant(getKey(), preferenceType);
+ return PreferencesConstantsHelper.getDiagramConstant(getKey(), preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDecorationGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDecorationGroup.java
index d936311bdeb..8e1e89951c1 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDecorationGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDecorationGroup.java
@@ -18,7 +18,6 @@ import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.DecorationGroup;
import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
-// TODO: Auto-generated Javadoc
/**
* The Class DiagramDecorationGroupthat specialize Decoration group for the diagram level
*/
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDimensionGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDimensionGroup.java
index de502c5285a..dfe967e49b2 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDimensionGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramDimensionGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.DimensionGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class DiagramDimensionGroup extends DimensionGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getDiagramConstant(getKey(), preferenceType);
+ return PreferencesConstantsHelper.getDiagramConstant(getKey(), preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramFontGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramFontGroup.java
index c1da2dadbd7..6958bcf7f6e 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramFontGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramFontGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.FontGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class DiagramFontGroup extends FontGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getDiagramConstant(getKey(), preferenceType);
+ return PreferencesConstantsHelper.getDiagramConstant(getKey(), preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramLinkColorGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramLinkColorGroup.java
index aa8cc6fd78b..c9f0adadc4f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramLinkColorGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramLinkColorGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.LinkColorGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class DiagramLinkColorGroup extends LinkColorGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getDiagramConstant(getKey(), preferenceType);
+ return PreferencesConstantsHelper.getDiagramConstant(getKey(), preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramNodeColorGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramNodeColorGroup.java
index f4440e4786d..5cd417b0f30 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramNodeColorGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramNodeColorGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.NodeColorGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class DiagramNodeColorGroup extends NodeColorGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getDiagramConstant(getKey(), preferenceType);
+ return PreferencesConstantsHelper.getDiagramConstant(getKey(), preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramRulersAndGridGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramRulersAndGridGroup.java
new file mode 100644
index 00000000000..b4c5a83b9f5
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/diagram/DiagramRulersAndGridGroup.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.diagram;
+
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.RulersAndGridGroup;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ *
+ * @author vl222926
+ *
+ */
+public class DiagramRulersAndGridGroup extends RulersAndGridGroup {
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * @param key
+ * @param dialogPage
+ */
+ public DiagramRulersAndGridGroup(Composite parent, String key, DialogPage dialogPage) {
+ super(parent, key, dialogPage);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.RulersAndGridGroup#getPreferenceConstant(int)
+ *
+ * @param preferenceType
+ * @return
+ */
+ protected String getPreferenceConstant(int preferenceType) {
+ return PreferencesConstantsHelper.getDiagramConstant(getKey(), preferenceType);
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/dialog/AbstractPreferenceKeyDialog.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/dialog/AbstractPreferenceKeyDialog.java
index 1aa79b9fd94..6f44dee5bdb 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/dialog/AbstractPreferenceKeyDialog.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/dialog/AbstractPreferenceKeyDialog.java
@@ -23,8 +23,8 @@ import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.Activator;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
@@ -126,10 +126,10 @@ public class AbstractPreferenceKeyDialog extends org.eclipse.jface.dialogs.Statu
*/
public Image getColumnImage(Object element, int columnIndex) {
if(columnIndex == 0) {
- if(element.toString().startsWith(PreferenceConstantHelper.DIAGRAM_ELEMENT)) {
+ if(element.toString().startsWith(PreferencesConstantsHelper.DIAGRAM_ELEMENT)) {
return Activator.getPluginIconImage(Activator.PLUGIN_ID, "/icons/pref.gif");
}
- if(element.toString().startsWith(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX)) {
+ if(element.toString().startsWith(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX)) {
return Activator.getPluginIconImage(Activator.PLUGIN_ID, "/icons/diag.gif");
}
}
@@ -148,16 +148,16 @@ public class AbstractPreferenceKeyDialog extends org.eclipse.jface.dialogs.Statu
out = out.substring(out.indexOf(".") + 1, out.length()).toUpperCase();
}
if(columnIndex == 1) {
- if(element.toString().startsWith(PreferenceConstantHelper.DIAGRAM_ELEMENT)) {
+ if(element.toString().startsWith(PreferencesConstantsHelper.DIAGRAM_ELEMENT)) {
return "ELEMENT";
}
- if(element.toString().startsWith(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX)) {
+ if(element.toString().startsWith(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX)) {
return "DIAGRAM";
}
}
if(columnIndex == 2) {
- if(initialKey.startsWith(PreferenceConstantHelper.DIAGRAM_ELEMENT)) {
- out = initialKey.toString().replaceAll(PreferenceConstantHelper.DIAGRAM_ELEMENT, "");
+ if(initialKey.startsWith(PreferencesConstantsHelper.DIAGRAM_ELEMENT)) {
+ out = initialKey.toString().replaceAll(PreferencesConstantsHelper.DIAGRAM_ELEMENT, "");
// Reorganize display
if(out.indexOf(".") > 0) {
String beforePoint = out.substring(0, out.indexOf("."));
@@ -166,8 +166,8 @@ public class AbstractPreferenceKeyDialog extends org.eclipse.jface.dialogs.Statu
}
}
}
- if(initialKey.startsWith(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX)) {
- out = initialKey.toString().replaceAll(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX, "");
+ if(initialKey.startsWith(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX)) {
+ out = initialKey.toString().replaceAll(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX, "");
out = out.substring(0, out.indexOf("."));
}
}
@@ -205,10 +205,10 @@ public class AbstractPreferenceKeyDialog extends org.eclipse.jface.dialogs.Statu
public Object[] getElements(Object inputElement) {
ArrayList<String> result = new ArrayList<String>();
for(int i = 0; i < keys.length; i++) {
- if(keys[i].startsWith(PreferenceConstantHelper.DIAGRAM_PREFERENCE_PREFIX)) {
+ if(keys[i].startsWith(PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX)) {
result.add(keys[i]);
}
- if(keys[i].startsWith(PreferenceConstantHelper.DIAGRAM_ELEMENT)) {
+ if(keys[i].startsWith(PreferencesConstantsHelper.DIAGRAM_ELEMENT)) {
result.add(keys[i]);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorBackgroundColor.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorBackgroundColor.java
index 92ad3b765c5..013ef1d6970 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorBackgroundColor.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorBackgroundColor.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.BackgroundColor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class EditorBackgroundColor extends BackgroundColor {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getPapyrusEditorConstant(preferenceType);
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java
index efbeed08d6b..a52aab81add 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.ConnectionGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class EditorConnectionGroup extends ConnectionGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getPapyrusEditorConstant(preferenceType);
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDecorationGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDecorationGroup.java
index 1a2dc982b0a..e789b80b478 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDecorationGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDecorationGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.DecorationGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class EditorDecorationGroup extends DecorationGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getPapyrusEditorConstant(preferenceType);
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDimensionGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDimensionGroup.java
index f8f2cf92ce7..962d5c9539c 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDimensionGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorDimensionGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.DimensionGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class EditorDimensionGroup extends DimensionGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getPapyrusEditorConstant(preferenceType);
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorFontGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorFontGroup.java
index 5fb9adf3920..87fd235e3ca 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorFontGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorFontGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.FontGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class EditorFontGroup extends FontGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getPapyrusEditorConstant(preferenceType);
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorLinkColorGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorLinkColorGroup.java
index 3066fde767a..5d9e42b413d 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorLinkColorGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorLinkColorGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.LinkColorGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class EditorLinkColorGroup extends LinkColorGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getPapyrusEditorConstant(preferenceType);
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorNodeColorGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorNodeColorGroup.java
index c5b51a67abd..0e6326a96fc 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorNodeColorGroup.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorNodeColorGroup.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.NodeColorGroup;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.swt.widgets.Composite;
/**
@@ -43,6 +43,6 @@ public class EditorNodeColorGroup extends NodeColorGroup {
* @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
*/
protected String getPreferenceConstant(int preferenceType) {
- return PreferenceConstantHelper.getPapyrusEditorConstant(preferenceType);
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorRulersAndGridGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorRulersAndGridGroup.java
new file mode 100644
index 00000000000..35f0d469373
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorRulersAndGridGroup.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
+
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.RulersAndGridGroup;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * The Class EditorRulersAndGridGroup is the rulers and grid group specialized at the papyrus editor level.
+ */
+public class EditorRulersAndGridGroup extends RulersAndGridGroup {
+
+ /**
+ * Instantiates a new editor background color.
+ *
+ * @param parent
+ * the parent composite
+ * @param key
+ * the key of the preference
+ * @param dialogPage
+ * the dialog page
+ */
+ public EditorRulersAndGridGroup(Composite parent, String key, DialogPage dialogPage) {
+ super(parent, key, dialogPage);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.AbstractGroup#getPreferenceConstant(int)
+ */
+ protected String getPreferenceConstant(int preferenceType) {
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/utils/PreferenceConstantHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/utils/PreferenceConstantHelper.java
index 467878e69a7..42b109a99e6 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/utils/PreferenceConstantHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/utils/PreferenceConstantHelper.java
@@ -13,6 +13,8 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.preferences.utils;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
+
/**
* <p>
* A class that defines the available preference type available through Papyrus.
@@ -39,196 +41,147 @@ package org.eclipse.papyrus.infra.gmfdiag.preferences.utils;
* It also helps to retrieve the string used to store the preference type for a given element.
* </p>
*
+ * @deprecated use org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper
*/
+@SuppressWarnings("restriction")
+@Deprecated
public class PreferenceConstantHelper {
/**
* Prefix for preference for Papyrus Level editor
*/
- public static String PAPYRUS_EDITOR_PREFERENCE_PREFIX = "PAPYRUS_EDITOR"; //$NON-NLS-1$
+ public static String PAPYRUS_EDITOR_PREFERENCE_PREFIX = PreferencesConstantsHelper.PAPYRUS_EDITOR_PREFERENCE_PREFIX;
/**
* Prefix for preference for Diagram Level
*/
- public static String DIAGRAM_PREFERENCE_PREFIX = "DIAGRAM_"; //$NON-NLS-1$
+ public static String DIAGRAM_PREFERENCE_PREFIX = PreferencesConstantsHelper.DIAGRAM_PREFERENCE_PREFIX;
/**
* Prefix for preference for element Level
*/
- public static String DIAGRAM_ELEMENT = "ELEMENT_"; //$NON-NLS-1$
-
- private final static String COLOR = "color."; //$NON-NLS-1$
-
- private final static String GRADIENT = "gradient"; //$NON-NLS-1$
-
- private final static String POLICY = ".policy"; //$NON-NLS-1$
-
- private final static String JUMPLINK = "jumplink."; //$NON-NLS-1$
-
- private final static String ROUTING = "routing"; //$NON-NLS-1$
-
- private final static String ROUTING_POLICY = ROUTING + POLICY;
-
- private final static String COLOR_FILL_CONSTANT = COLOR + "fill"; //$NON-NLS-1$
-
- private final static String FONT_CONSTANT = "font"; //$NON-NLS-1$
-
- private final static String COLOR_FONT_CONSTANT = COLOR + FONT_CONSTANT;
-
- private final static String COLOR_LINE_CONSTANT = COLOR + "line"; //$NON-NLS-1$
-
- private final static String COLOR_GRADIENT_CONSTANT = COLOR + GRADIENT;
-
- private final static String GRADIENT_POLICY_CONSTANT = GRADIENT + POLICY;
-
- private final static String JUMPLINK_STATUS_CONSTANT = JUMPLINK + "status"; //$NON-NLS-1$
-
- private final static String JUMPLINK_REVERSE_CONSTANT = JUMPLINK + "reverse"; //$NON-NLS-1$
-
- private final static String JUMPLINK_TYPE_CONSTANT = JUMPLINK + "type"; //$NON-NLS-1$
+ public static String DIAGRAM_ELEMENT = PreferencesConstantsHelper.DIAGRAM_ELEMENT;
- private final static String ROUTING_POLICY_DISTANCE_CONSTANT = ROUTING_POLICY + ".distance"; //$NON-NLS-1$
-
- private final static String ROUTING_POLICY_OBSTRUCTION_CONSTANT = ROUTING_POLICY + ".obstruction"; //$NON-NLS-1$
-
- private final static String ROUTING_STYLE_CONSTANT = ROUTING + ".style"; //$NON-NLS-1$
-
- private final static String SMOOTHNESS_CONSTANT = "smoothness"; //$NON-NLS-1$
-
- private final static String SHADOW_CONSTANT = "shadow"; //$NON-NLS-1$
-
- private final static String ELEMENTICON_CONSTANT = "elementicon"; //$NON-NLS-1$
-
- private final static String QUALIFIEDNAME_CONSTANT = "qualifiedname"; //$NON-NLS-1$
-
- private final static String HEIGHT_CONSTANT = "height";//$NON-NLS-1$
-
- private final static String WIDTH_CONSTANT = "width"; //$NON-NLS-1$
-
- private final static String COMPARTMENT_VISIBILITY_CONSTANT = "compartment.visibility"; //$NON-NLS-1$
-
- private final static String COMPARTMENT_NAME_VISIBILITY_CONSTANT = "compartment_name.visibility"; //$NON-NLS-1$
-
- private final static String LABEL_VISIBILITY_CONSTANT = "label.visibility"; //$NON-NLS-1$
-
- private final static String LOCATION_X_CONSTANT = "location_x";//$NON-NLS-1$
-
- private final static String LOCATION_Y_CONSTANT = "location_y"; //$NON-NLS-1$
/**
* A preference of type COLOR FILL
*/
- public final static int COLOR_FILL = 0;
+ public final static int COLOR_FILL = PreferencesConstantsHelper.COLOR_FILL;
/**
* A preference of type FONT
*/
- public final static int FONT = COLOR_FILL + 1;
+ public final static int FONT = PreferencesConstantsHelper.FONT;
/**
* A preference of type COLOR FONT
*/
- public final static int COLOR_FONT = FONT + 1;
+ public final static int COLOR_FONT = PreferencesConstantsHelper.COLOR_FONT;
/**
* A preference of type COLOR LINE
*/
- public final static int COLOR_LINE = COLOR_FONT + 1;
+ public final static int COLOR_LINE = PreferencesConstantsHelper.COLOR_LINE;
/**
* A preference of type COLOR GRADIENT
*/
- public final static int COLOR_GRADIENT = COLOR_LINE + 1;
+ public final static int COLOR_GRADIENT = PreferencesConstantsHelper.COLOR_GRADIENT;
/**
* A preference of type GRADIENT POLICY
*/
- public final static int GRADIENT_POLICY = COLOR_GRADIENT + 1;
+ public final static int GRADIENT_POLICY = PreferencesConstantsHelper.GRADIENT_POLICY;
/**
* A preference of type JUMPLINK STATUS
*/
- public final static int JUMPLINK_STATUS = GRADIENT_POLICY + 1;
+ public final static int JUMPLINK_STATUS = PreferencesConstantsHelper.JUMPLINK_STATUS;
/**
* A preference of type JUMPLINK REVERSE
*/
- public final static int JUMPLINK_REVERSE = JUMPLINK_STATUS + 1;
+ public final static int JUMPLINK_REVERSE = PreferencesConstantsHelper.JUMPLINK_REVERSE;
/**
* A preference of type JUMPLINK TYPE
*/
- public final static int JUMPLINK_TYPE = JUMPLINK_REVERSE + 1;
+ public final static int JUMPLINK_TYPE = PreferencesConstantsHelper.JUMPLINK_TYPE;
/**
* A preference of type ROUTING POLICY DISTANCE
*/
- public final static int ROUTING_POLICY_DISTANCE = JUMPLINK_TYPE + 1;
+ public final static int ROUTING_POLICY_DISTANCE = PreferencesConstantsHelper.ROUTING_POLICY_DISTANCE;
/**
* A preference of type ROUTING POLICY OBSTRUCTION
*/
- public final static int ROUTING_POLICY_OBSTRUCTION = ROUTING_POLICY_DISTANCE + 1;
+ public final static int ROUTING_POLICY_OBSTRUCTION = PreferencesConstantsHelper.ROUTING_POLICY_OBSTRUCTION;
/**
* A preference of type ROUTING STYLE
*/
- public final static int ROUTING_STYLE = ROUTING_POLICY_OBSTRUCTION + 1;
+ public final static int ROUTING_STYLE = PreferencesConstantsHelper.ROUTING_STYLE;
/**
* A preference of type SMOOTHNESS
*/
- public final static int SMOOTHNESS = ROUTING_STYLE + 1;
+ public final static int SMOOTHNESS = PreferencesConstantsHelper.SMOOTHNESS;
/**
* A preference of type Shadow
*/
- public final static int SHADOW = SMOOTHNESS + 1;
+ public final static int SHADOW = PreferencesConstantsHelper.SHADOW;
/**
* A preference of type elementIcon
*/
- public final static int ELEMENTICON = SHADOW + 1;
+ public final static int ELEMENTICON = PreferencesConstantsHelper.ELEMENTICON;
/**
* A preference of type QualifiedName
*/
- public final static int QUALIFIEDNAME = ELEMENTICON + 1;
+ public final static int QUALIFIEDNAME = PreferencesConstantsHelper.QUALIFIEDNAME;
/**
* A preference of type height
*/
- public static final int HEIGHT = QUALIFIEDNAME + 1;
+ public static final int HEIGHT = PreferencesConstantsHelper.HEIGHT;
/**
* A preference of type width
*/
- public static final int WIDTH = HEIGHT + 1;
+ public static final int WIDTH = PreferencesConstantsHelper.WIDTH;
/**
* A preference of type compartment visibility
*/
- public static final int COMPARTMENT_VISIBILITY = WIDTH + 1;
+ public static final int COMPARTMENT_VISIBILITY = PreferencesConstantsHelper.COMPARTMENT_VISIBILITY;
/**
* A preference of type compartment visibility
*/
- public static final int COMPARTMENT_NAME_VISIBILITY = COMPARTMENT_VISIBILITY + 1;
+ public static final int COMPARTMENT_NAME_VISIBILITY = PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY;
/**
* A preference of type label visibility
*/
- public static final int LABEL_VISIBILITY = COMPARTMENT_NAME_VISIBILITY + 1;
+ public static final int LABEL_VISIBILITY = PreferencesConstantsHelper.LABEL_VISIBILITY;
/**
* A preference for label default location
*/
- public static final int LOCATION_X = LABEL_VISIBILITY + 1;
+ public static final int LOCATION_X = PreferencesConstantsHelper.LOCATION_X;
/**
* A preference for label default location
*/
- public static final int LOCATION_Y = LOCATION_X + 1;
+ public static final int LOCATION_Y = PreferencesConstantsHelper.LOCATION_Y;
+
+ /**
+ * A preference to diplay or not the rulers
+ */
+ public static final int SHOW_RULER = PreferencesConstantsHelper.VIEW_RULER;
/**
@@ -241,85 +194,7 @@ public class PreferenceConstantHelper {
* @return the constant used.
*/
public static String getConstant(String elementName, int preferenceType) {
- StringBuffer sb = new StringBuffer();
- sb.append(elementName);
- sb.append("."); //$NON-NLS-1$
-
- switch(preferenceType) {
- case COLOR_FILL:
- sb.append(COLOR_FILL_CONSTANT);
- break;
- case FONT:
- sb.append(FONT_CONSTANT);
- break;
- case COLOR_FONT:
- sb.append(COLOR_FONT_CONSTANT);
- break;
- case COLOR_LINE:
- sb.append(COLOR_LINE_CONSTANT);
- break;
- case COLOR_GRADIENT:
- sb.append(COLOR_GRADIENT_CONSTANT);
- break;
- case GRADIENT_POLICY:
- sb.append(GRADIENT_POLICY_CONSTANT);
- break;
- case JUMPLINK_STATUS:
- sb.append(JUMPLINK_STATUS_CONSTANT);
- break;
- case JUMPLINK_REVERSE:
- sb.append(JUMPLINK_REVERSE_CONSTANT);
- break;
- case JUMPLINK_TYPE:
- sb.append(JUMPLINK_TYPE_CONSTANT);
- break;
- case ROUTING_POLICY_DISTANCE:
- sb.append(ROUTING_POLICY_DISTANCE_CONSTANT);
- break;
- case ROUTING_POLICY_OBSTRUCTION:
- sb.append(ROUTING_POLICY_OBSTRUCTION_CONSTANT);
- break;
- case ROUTING_STYLE:
- sb.append(ROUTING_STYLE_CONSTANT);
- break;
- case SMOOTHNESS:
- sb.append(SMOOTHNESS_CONSTANT);
- break;
- case SHADOW:
- sb.append(SHADOW_CONSTANT);
- break;
- case ELEMENTICON:
- sb.append(ELEMENTICON_CONSTANT);
- break;
- case QUALIFIEDNAME:
- sb.append(QUALIFIEDNAME_CONSTANT);
- break;
- case HEIGHT:
- sb.append(HEIGHT_CONSTANT);
- break;
- case WIDTH:
- sb.append(WIDTH_CONSTANT);
- break;
- case COMPARTMENT_VISIBILITY:
- sb.append(COMPARTMENT_VISIBILITY_CONSTANT);
- break;
- case COMPARTMENT_NAME_VISIBILITY:
- sb.append(COMPARTMENT_NAME_VISIBILITY_CONSTANT);
- break;
- case LABEL_VISIBILITY:
- sb.append(LABEL_VISIBILITY_CONSTANT);
- break;
- case LOCATION_X:
- sb.append(LOCATION_X_CONSTANT);
- break;
- case LOCATION_Y:
- sb.append(LOCATION_Y_CONSTANT);
- break;
- default:
- break;
- }
-
- return sb.toString();
+ return PreferencesConstantsHelper.getConstant(elementName, preferenceType);
}
/**
@@ -331,7 +206,7 @@ public class PreferenceConstantHelper {
* @return the key for the element of a diagram
*/
public static String getElementConstant(String elementName, int preferenceType) {
- return DIAGRAM_ELEMENT + getConstant(elementName, preferenceType);
+ return PreferencesConstantsHelper.getElementConstant(elementName, preferenceType);
}
/**
@@ -345,8 +220,7 @@ public class PreferenceConstantHelper {
* @return the key for the element of a diagram
*/
public static String getCompartmentElementConstant(String elementName, String compartmentName, int preferenceType) {
- String tmp = getElementConstant(elementName, preferenceType);
- return tmp.replaceFirst("\\.", "_" + compartmentName + "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return PreferencesConstantsHelper.getCompartmentElementConstant(elementName, compartmentName, preferenceType);
}
/**
@@ -361,8 +235,7 @@ public class PreferenceConstantHelper {
* @return the key for the element of a diagram
*/
public static String getLabelElementConstant(String elementName, String labelRole, int preferenceType) {
- String tmp = getElementConstant(elementName, preferenceType);
- return tmp.replaceFirst("\\.", "_" + labelRole + "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return PreferencesConstantsHelper.getLabelElementConstant(elementName, labelRole, preferenceType);
}
/**
@@ -372,7 +245,7 @@ public class PreferenceConstantHelper {
* @return get the preference key at the papyrus editor level
*/
public static String getPapyrusEditorConstant(int preferenceType) {
- return getConstant(PAPYRUS_EDITOR_PREFERENCE_PREFIX, preferenceType);
+ return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
/**
@@ -384,7 +257,7 @@ public class PreferenceConstantHelper {
* @return the preference key at the diagram level
*/
public static String getDiagramConstant(String diagramKind, int preferenceType) {
- return DIAGRAM_PREFERENCE_PREFIX + getConstant(diagramKind, preferenceType);
+ return PreferencesConstantsHelper.getDiagramConstant(diagramKind, preferenceType);
}
}

Back to the top