Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-05-29 22:29:52 +0000
committerTom Schindl2014-05-29 22:29:52 +0000
commit1547501ce39011fbce7bc140cfa6b0478be02f6f (patch)
tree5f6db0eacd5c33b6b6a68af6cfaa1f86d78b1219 /experimental/swt
parent4e93a5ff850c42b6224f3f965bdb9c3f509c2483 (diff)
downloadorg.eclipse.efxclipse-1547501ce39011fbce7bc140cfa6b0478be02f6f.tar.gz
org.eclipse.efxclipse-1547501ce39011fbce7bc140cfa6b0478be02f6f.tar.xz
org.eclipse.efxclipse-1547501ce39011fbce7bc140cfa6b0478be02f6f.zip
support mnemonics
Diffstat (limited to 'experimental/swt')
-rw-r--r--experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Label.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Label.java b/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Label.java
index f0f897158..6cafeb2ef 100644
--- a/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Label.java
+++ b/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Label.java
@@ -29,6 +29,7 @@ public class Label extends Control {
private javafx.scene.control.Label control;
private Separator separator;
private Image image;
+ private String text = "";
public Label(Composite parent, int style) {
super(parent,style);
@@ -43,6 +44,7 @@ public class Label extends Control {
} else {
control = new javafx.scene.control.Label();
control.setWrapText((style & SWT.WRAP) == SWT.WRAP);
+ control.setMnemonicParsing(true);
return control;
}
}
@@ -79,7 +81,7 @@ public class Label extends Control {
public String getText () {
checkWidget ();
if ((style & SWT.SEPARATOR) != 0) return "";
- return notNullString(control.getText());
+ return text;
}
public void setAlignment (int alignment) {
@@ -108,7 +110,8 @@ public class Label extends Control {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
if ((style & SWT.SEPARATOR) != 0) return;
- control.setText(string);
+ this.text = string;
+ control.setText(Util.fixMnemonic(string));
}
public Image getImage () {

Back to the top