Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/preferences/ui/LinkColorGroup.java')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/preferences/ui/LinkColorGroup.java90
1 files changed, 90 insertions, 0 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/preferences/ui/LinkColorGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/preferences/ui/LinkColorGroup.java
new file mode 100644
index 00000000000..e4ff387a1ca
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/preferences/ui/LinkColorGroup.java
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ * Copyright (c) 2009 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:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr
+ * Thibault Landre (Atos Origin)
+ *****************************************************************************/
+package org.eclipse.papyrus.preferences.ui;
+
+import org.eclipse.gmf.runtime.diagram.ui.properties.internal.l10n.DiagramUIPropertiesImages;
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.papyrus.preferences.Messages;
+import org.eclipse.papyrus.preferences.jface.preference.ColorFieldEditor;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+
+/**
+ * The Class LinkColorGroup contains editor to edit preference of link color
+ */
+public class LinkColorGroup extends AbstractGroup {
+
+ /** The font color editor. */
+ protected ColorFieldEditor fontColorEditor;
+
+ /** The line color editor. */
+ protected ColorFieldEditor lineColorEditor;
+
+ /** The toolbar. */
+ protected Group toolbar;
+
+ /**
+ * creation of a colorGroup Composite.
+ *
+ * @param parent
+ * the parent of the composite
+ * @param dialogPage
+ * to set the page in field editor
+ * @param title
+ * the title
+ */
+
+ public LinkColorGroup(Composite parent, String title, DialogPage dialogPage) {
+ super(parent, title, dialogPage);
+ createContent(parent);
+ }
+
+ /**
+ * Gets the toolbar.
+ *
+ * @return the group that contains editors
+ */
+ protected Group getToolbar() {
+ return toolbar;
+ }
+
+ /**
+ * Creates the content.
+ *
+ * @param parent
+ * the parent
+ */
+ protected void createContent(Composite parent) {
+ toolbar = new Group(parent, SWT.SHADOW_NONE);
+ toolbar.setText(Messages.AbstractPapyrusElementPreferencePage_Colors);
+ 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.setPage(dialogPage);
+
+ addFieldEditor(fontColorEditor);
+
+ Composite lineColorEditorCompo = getEncapsulatedCompo(toolbar);
+ lineColorEditor = new ColorFieldEditor(getPreferenceConstant(PreferenceConstantHelper.COLOR_LINE), DiagramUIPropertiesImages.get(DiagramUIPropertiesImages.IMG_LINE_COLOR), lineColorEditorCompo);
+
+ lineColorEditor.setPage(dialogPage);
+
+ addFieldEditor(lineColorEditor);
+ }
+
+}

Back to the top