Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Yan2018-06-07 10:39:10 -0400
committerEric Williams2018-06-11 10:28:38 -0400
commit236d0050ed609b91d5ef0affc37b63cb959a6208 (patch)
treea7fc40c84783b484f455183fd70ce7cb33c6bf0c /examples
parentc04d5d8912dab6d6331a24d1e614667d28c8a6a3 (diff)
downloadeclipse.platform.swt-236d0050ed609b91d5ef0affc37b63cb959a6208.tar.gz
eclipse.platform.swt-236d0050ed609b91d5ef0affc37b63cb959a6208.tar.xz
eclipse.platform.swt-236d0050ed609b91d5ef0affc37b63cb959a6208.zip
Bug 267981 - SWT.Border Checkbox not working in ControlExample for the
DateTime Widget Disabled DROP_DOWN for TIME/CALENDAR styles, disabled BORDER check button for inapplicable widgets. Change-Id: Ia9695bb6a74c886cffaa01540e45e84e732e804b Signed-off-by: Xi Yan <xixiyan@redhat.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java13
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java21
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java15
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java3
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java12
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java2
7 files changed, 45 insertions, 23 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java
index a17ac1165d..5a0f1a1058 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java
@@ -13,10 +13,13 @@ package org.eclipse.swt.examples.controlexample;
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.events.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Widget;
/**
* <code>ButtonTab</code> is the class that
@@ -249,6 +252,6 @@ class ButtonTab extends AlignableTab {
arrowButton.setSelection ((button1.getStyle () & SWT.ARROW) != 0);
flatButton.setSelection ((button1.getStyle () & SWT.FLAT) != 0);
wrapButton.setSelection ((button1.getStyle () & SWT.WRAP) != 0);
- borderButton.setSelection ((button1.getStyle () & SWT.BORDER) != 0);
+ borderButton.setEnabled(false);
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java
index 4d98af757e..3baf54fb44 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java
@@ -11,9 +11,13 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.DateTime;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Widget;
class DateTimeTab extends Tab {
/* Example widgets and groups that contain them */
@@ -59,7 +63,6 @@ class DateTimeTab extends Tab {
if (mediumButton.getSelection ()) style |= SWT.MEDIUM;
if (longButton.getSelection ()) style |= SWT.LONG;
if (dropDownButton.getSelection ()) style |= SWT.DROP_DOWN;
- if (borderButton.getSelection ()) style |= SWT.BORDER;
/* Create the example widgets */
dateTime1 = new DateTime (dateTimeGroup, style);
@@ -138,7 +141,13 @@ class DateTimeTab extends Tab {
shortButton.setSelection ((dateTime1.getStyle () & SWT.SHORT) != 0);
mediumButton.setSelection ((dateTime1.getStyle () & SWT.MEDIUM) != 0);
longButton.setSelection ((dateTime1.getStyle () & SWT.LONG) != 0);
- dropDownButton.setSelection ((dateTime1.getStyle () & SWT.DROP_DOWN) != 0);
- borderButton.setSelection ((dateTime1.getStyle () & SWT.BORDER) != 0);
+ if ((dateTime1.getStyle() & SWT.DATE) != 0) {
+ dropDownButton.setEnabled(true);
+ dropDownButton.setSelection ((dateTime1.getStyle () & SWT.DROP_DOWN) != 0);
+ } else {
+ dropDownButton.setSelection(false);
+ dropDownButton.setEnabled(false);
+ }
+ borderButton.setEnabled(false);
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java
index f49c1eb0e8..c3a0bd93d9 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java
@@ -11,9 +11,16 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ExpandBar;
+import org.eclipse.swt.widgets.ExpandItem;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Widget;
class ExpandBarTab extends Tab {
/* Example widgets and groups that contain them */
@@ -147,7 +154,7 @@ class ExpandBarTab extends Tab {
Widget [] widgets = getExampleWidgets ();
if (widgets.length != 0){
verticalButton.setSelection ((widgets [0].getStyle () & SWT.V_SCROLL) != 0);
- borderButton.setSelection ((widgets [0].getStyle () & SWT.BORDER) != 0);
+ borderButton.setEnabled(false);
}
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java
index 3a7019b10d..5f4980c3fd 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java
@@ -79,7 +79,6 @@ class GroupTab extends Tab {
if (shadowInButton.getSelection ()) style |= SWT.SHADOW_IN;
if (shadowOutButton.getSelection ()) style |= SWT.SHADOW_OUT;
if (shadowNoneButton.getSelection ()) style |= SWT.SHADOW_NONE;
- if (borderButton.getSelection ()) style |= SWT.BORDER;
/* Create the example widgets */
group1 = new Group (groupGroup, style);
@@ -156,7 +155,7 @@ class GroupTab extends Tab {
shadowInButton.setSelection ((group1.getStyle () & SWT.SHADOW_IN) != 0);
shadowOutButton.setSelection ((group1.getStyle () & SWT.SHADOW_OUT) != 0);
shadowNoneButton.setSelection ((group1.getStyle () & SWT.SHADOW_NONE) != 0);
- borderButton.setSelection ((group1.getStyle () & SWT.BORDER) != 0);
+ borderButton.setEnabled(false);
if (!instance.startup) setTitleText ();
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java
index c101f29c0d..817aa21490 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java
@@ -13,9 +13,13 @@ package org.eclipse.swt.examples.controlexample;
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Widget;
abstract class RangeTab extends Tab {
/* Style widgets added to the "Style" group */
@@ -153,7 +157,7 @@ abstract class RangeTab extends Tab {
horizontalButton.setSelection ((widgets [0].getStyle () & SWT.HORIZONTAL) != 0);
verticalButton.setSelection ((widgets [0].getStyle () & SWT.VERTICAL) != 0);
}
- borderButton.setSelection ((widgets [0].getStyle () & SWT.BORDER) != 0);
+ borderButton.setEnabled(false);
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java
index df0f02fd16..d8abd547e3 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java
@@ -178,6 +178,6 @@ class TabFolderTab extends Tab {
super.setExampleWidgetState ();
topButton.setSelection ((tabFolder1.getStyle () & SWT.TOP) != 0);
bottomButton.setSelection ((tabFolder1.getStyle () & SWT.BOTTOM) != 0);
- borderButton.setSelection ((tabFolder1.getStyle () & SWT.BORDER) != 0);
+ borderButton.setEnabled(false);
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java
index 7f9be02e8a..802ddc72b1 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java
@@ -331,8 +331,8 @@ class ToolBarTab extends Tab {
flatButton.setSelection ((imageToolBar.getStyle () & SWT.FLAT) != 0);
wrapButton.setSelection ((imageToolBar.getStyle () & SWT.WRAP) != 0);
shadowOutButton.setSelection ((imageToolBar.getStyle () & SWT.SHADOW_OUT) != 0);
- borderButton.setSelection ((imageToolBar.getStyle () & SWT.BORDER) != 0);
rightButton.setSelection ((imageToolBar.getStyle () & SWT.RIGHT) != 0);
+ borderButton.setEnabled(false);
}
/**

Back to the top