Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2018-02-27 13:51:26 +0000
committervincent lorenzo2018-04-10 13:35:44 +0000
commit0761fc7ae10306ea1332b0ad6c1c98b71a68fa77 (patch)
treeb18b1e8a1f4b7708f9b7e6b13e34464203e329c2 /plugins/infra
parent56aba8678a385b09cb68723233e5aea76fc48bf9 (diff)
downloadorg.eclipse.papyrus-0761fc7ae10306ea1332b0ad6c1c98b71a68fa77.tar.gz
org.eclipse.papyrus-0761fc7ae10306ea1332b0ad6c1c98b71a68fa77.tar.xz
org.eclipse.papyrus-0761fc7ae10306ea1332b0ad6c1c98b71a68fa77.zip
Bug 531729: [Diagram] Explicit the preference used to draw common bendpoints on connectors
Change-Id: I2fec207b58a7098419b0ad86d7b6044f73d65aee Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java4
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties2
-rwxr-xr-x[-rw-r--r--]plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java8
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java48
4 files changed, 58 insertions, 4 deletions
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 008ea30b78b..78aabeb1b22 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
@@ -23,6 +23,10 @@ public class Messages extends NLS {
public static String ApplyValueOnPreferenceKeyDialog_ELEMENT;
+ public static String EditorConnectionGroup_ConnectionBendpoints;
+
+ public static String EditorConnectionGroup_DrawCommonBendpoint_EditorLabel;
+
public static String LabelGroup_Labels_To_Display;
public static String RulersAndGridGroup_GridColor;
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 3e0fced99b2..6fb1965cc30 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
@@ -4,6 +4,8 @@ RulersAndGridGroup_GridInFront=Grid In Front
RulersAndGridGroup_GridStyle=Grid Style
ApplyValueOnPreferenceKeyDialog_DIAGRAM=DIAGRAM
ApplyValueOnPreferenceKeyDialog_ELEMENT=ELEMENT
+EditorConnectionGroup_ConnectionBendpoints=Connection Bendpoints
+EditorConnectionGroup_DrawCommonBendpoint_EditorLabel=Draw Common Bendpoints
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/PapyrusAllDiagramsPreferencePage.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java
index eddc3fa29e3..4fe48c19827 100644..100755
--- 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
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2008 Atos Origin.
+ * Copyright (c) 2008, 2018 Atos Origin.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -10,6 +10,7 @@
* Thibault Landre (Atos Origin) - Initial API and implementation
* Patrick Tessier (CEA LIST)- modifications
* Fanch Bonnabesse (ALL4TEC) fanch.bonnabesse@alltec.net - Bug 419357
+ * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 531729
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.preferences.pages;
@@ -46,7 +47,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
/**
- * The default preference page all element of diagrams
+ * The default preference page all elements of diagrams
*
*/
public class PapyrusAllDiagramsPreferencePage extends AbstractPapyrusPreferencePage {
@@ -139,6 +140,9 @@ public class PapyrusAllDiagramsPreferencePage extends AbstractPapyrusPreferenceP
RestoreElementGroup.initDefaults(store);
ExternalReferenceGroup.initDefaults(store);
+
+ //the default value for the Draw connection point preference
+ store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.DRAW_CONNECTION_POINT),Boolean.FALSE);
}
});
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 f028b0a3344..80393344892 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
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2018 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,21 +9,33 @@
*
* Contributors:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 531729
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor;
import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.messages.Messages;
import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.ConnectionGroup;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
/**
- * The Class EditorConnectionGroup : ac onnection group specialized for the editor level
+ * The Class EditorConnectionGroup : a connection group specialized for the editor level
*/
public class EditorConnectionGroup extends ConnectionGroup {
/**
+ * the title of the boolean field editor used to edit the draw common bendpoints label
+ */
+ private static final String DRAW_COMMON_BENDPOINTS_EDITOR_LABEL = Messages.EditorConnectionGroup_DrawCommonBendpoint_EditorLabel;
+
+ /**
* Instantiates a new editor connection group.
*
* @param parent
@@ -46,4 +58,36 @@ public class EditorConnectionGroup extends ConnectionGroup {
protected String getPreferenceConstant(int preferenceType) {
return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType);
}
+
+
+
+ /**
+ * @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.ConnectionGroup#createContent(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ */
+ @Override
+ public void createContent(final Composite parent) {
+ super.createContent(parent);
+
+ // we are looking for the connection group created in the super class
+ Group group = null;
+ for (final Control current : parent.getChildren()) {
+ if (current instanceof Group && org.eclipse.papyrus.infra.gmfdiag.preferences.Messages.AbstractPapyrusLinkPreferencePage_Connection.equals(((Group) current).getText())) {
+ group = (Group) current;
+ break;
+ }
+ }
+
+ // we don't add this group in the super class, because this preference is currently applied on all links and for all diagrams
+ if (null != group) {
+ Group group1 = new Group(group, SWT.NONE);
+ group1.setText(Messages.EditorConnectionGroup_ConnectionBendpoints);
+ group1.setLayout(new GridLayout());
+ final BooleanFieldEditor drawConnectionBenpoints = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.DRAW_CONNECTION_POINT), DRAW_COMMON_BENDPOINTS_EDITOR_LABEL, group1);
+ addFieldEditor(drawConnectionBenpoints);
+ }
+ }
+
+
}

Back to the top