Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Gabel2016-07-06 07:49:36 +0000
committerGerrit Code Review @ Eclipse.org2016-07-06 09:27:22 +0000
commitf2ee67595fc73d09ac839f2ede726605832e76b9 (patch)
tree663eae89afccf9c29312f2aa3e8954d464ad9eef /plugins/infra/properties
parentbebefef7da3db7d05c0042778211be4e9320edd5 (diff)
downloadorg.eclipse.papyrus-f2ee67595fc73d09ac839f2ede726605832e76b9.tar.gz
org.eclipse.papyrus-f2ee67595fc73d09ac839f2ede726605832e76b9.tar.xz
org.eclipse.papyrus-f2ee67595fc73d09ac839f2ede726605832e76b9.zip
Bug 497361: [Properties] Possibility to customize labels of BooleanRadio
editors trueLabel and falseLabel attibutes can be added in XWT declaration to override the default (true, false) labels. Change-Id: I2ddb694c87961846cc34184d5293eef281edc080 Signed-off-by: Sebastien Gabel <sebastien.gabel@esterel-technologies.com>
Diffstat (limited to 'plugins/infra/properties')
-rw-r--r--plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui/src/org/eclipse/papyrus/infra/properties/ui/widgets/BooleanRadio.java63
1 files changed, 62 insertions, 1 deletions
diff --git a/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui/src/org/eclipse/papyrus/infra/properties/ui/widgets/BooleanRadio.java b/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui/src/org/eclipse/papyrus/infra/properties/ui/widgets/BooleanRadio.java
index dc4a5395f27..dfc4b51ddb7 100644
--- a/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui/src/org/eclipse/papyrus/infra/properties/ui/widgets/BooleanRadio.java
+++ b/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui/src/org/eclipse/papyrus/infra/properties/ui/widgets/BooleanRadio.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2016 CEA LIST, Esterel Technologies SAS and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,9 +8,12 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Sebastien Gabel (Esterel Technologies SAS) - Bug 497361
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.properties.ui.widgets;
+import org.eclipse.papyrus.infra.widgets.editors.AbstractEditor;
import org.eclipse.swt.widgets.Composite;
/**
@@ -35,4 +38,62 @@ public class BooleanRadio extends AbstractPropertyEditor {
public BooleanRadio(Composite parent, int style) {
super(new org.eclipse.papyrus.infra.widgets.editors.BooleanRadio(parent, style));
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public org.eclipse.papyrus.infra.widgets.editors.BooleanRadio getEditor() {
+ AbstractEditor editor = super.getEditor();
+ if (editor instanceof org.eclipse.papyrus.infra.widgets.editors.BooleanRadio) {
+ return (org.eclipse.papyrus.infra.widgets.editors.BooleanRadio) editor;
+ }
+ return null;
+ }
+
+ /**
+ * Replaces the <b>true</b> String by the text given in parameter.
+ *
+ * @param label
+ * The text to display instead of <em>true</em>.
+ */
+ public void setTrueLabel(String label) {
+ org.eclipse.papyrus.infra.widgets.editors.BooleanRadio editor = getEditor();
+ if (editor != null) {
+ editor.setTrueLabel(label);
+ }
+ }
+
+ /**
+ * Gets the label associated to the <b>true</b> value.
+ *
+ * @return Return the label associated to the true value.
+ */
+ public String getTrueLabel() {
+ org.eclipse.papyrus.infra.widgets.editors.BooleanRadio editor = getEditor();
+ return getEditor() == null ? null : editor.getTrueLabel();
+ }
+
+ /**
+ * Replaces the <b>false</b> String by the text given in parameter.
+ *
+ * @param label
+ * The text to display instead of <em>false</em>.
+ */
+ public void setFalseLabel(String label) {
+ org.eclipse.papyrus.infra.widgets.editors.BooleanRadio editor = getEditor();
+ if (editor != null) {
+ editor.setFalseLabel(label);
+ }
+ }
+
+ /**
+ * Gets the label associated to the <b>false</b> value.
+ *
+ * @return Return the label associated to the false value.
+ */
+ public String getFalseLabel() {
+ org.eclipse.papyrus.infra.widgets.editors.BooleanRadio editor = getEditor();
+ return getEditor() == null ? null : editor.getFalseLabel();
+ }
}

Back to the top