diff options
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.java | 63 |
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(); + } } |