| commit | c6e0ff1d94568fc28e6193a5eedbb63a2756fa98 | [log] [tgz] |
|---|---|---|
| author | Bernd Kolb <b.kolb@kolbware.de> | Tue Mar 22 00:31:23 2011 +0100 |
| committer | Bernd Kolb <b.kolb@kolbware.de> | Tue Mar 22 00:31:23 2011 +0100 |
| tree | 8852d5bb25e9e42bc4dcb4ab36a71c8e7eff9412 | |
| parent | 27792504fad8d2d70108aeae424754ba3237ca5a [diff] |
Prevent user input via keyboard This commit prevents the user from entering something into the text field as this could currently lead to an exception Change-Id: I30cb8c0846c93a82119cfb54dc6e2fe76df23d4c
diff --git a/org.eclipse.example.calc/src/org/eclipse/example/calc/internal/ui/swt/CalculatorUI.java b/org.eclipse.example.calc/src/org/eclipse/example/calc/internal/ui/swt/CalculatorUI.java index 2961499..c943519 100644 --- a/org.eclipse.example.calc/src/org/eclipse/example/calc/internal/ui/swt/CalculatorUI.java +++ b/org.eclipse.example.calc/src/org/eclipse/example/calc/internal/ui/swt/CalculatorUI.java
@@ -82,6 +82,8 @@ display = new Text(shell, SWT.BORDER_SOLID | SWT.RIGHT); display.setLayoutData(gridData); display.setText("0"); + display.setEditable(false); + display.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); calculator.setClearText(true); }