Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-11-14 04:58:31 -0500
committerNiraj Modi2019-11-19 03:00:01 -0500
commit7b627530c28727b3a02ceba26562f3002339ca13 (patch)
tree2e4a8469ea56f17da4c2a9c8a88fa8aedd264242 /examples
parentc81c2aa19577c43e63ccbca01bce9ac7920bad5d (diff)
downloadeclipse.platform.swt-7b627530c28727b3a02ceba26562f3002339ca13.tar.gz
eclipse.platform.swt-7b627530c28727b3a02ceba26562f3002339ca13.tar.xz
eclipse.platform.swt-7b627530c28727b3a02ceba26562f3002339ca13.zip
Bug 349112 - Allow setting alignment on CCombo text field
Change-Id: Id8bd5ebbb452f8f345c54c405a311091600db319 Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF2
-rw-r--r--examples/org.eclipse.swt.examples/pom.xml2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java30
3 files changed, 26 insertions, 8 deletions
diff --git a/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF
index fe1220e474..87d73bd575 100644
--- a/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.SWTStandaloneExampleSet.name
Bundle-SymbolicName: org.eclipse.swt.examples; singleton:=true
-Bundle-Version: 3.106.600.qualifier
+Bundle-Version: 3.106.700.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/examples/org.eclipse.swt.examples/pom.xml b/examples/org.eclipse.swt.examples/pom.xml
index bae768f91c..2e58a3d1e2 100644
--- a/examples/org.eclipse.swt.examples/pom.xml
+++ b/examples/org.eclipse.swt.examples/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.examples</artifactId>
- <version>3.106.600-SNAPSHOT</version>
+ <version>3.106.700-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java
index 064dd4d05d..237ab29917 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -14,12 +14,15 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.layout.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+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;
-class CComboTab extends Tab {
+class CComboTab extends AlignableTab {
/* Example widgets and groups that contain them */
CCombo combo1;
@@ -70,6 +73,9 @@ class CComboTab extends Tab {
if (flatButton.getSelection ()) style |= SWT.FLAT;
if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY;
if (borderButton.getSelection ()) style |= SWT.BORDER;
+ if (leftButton.getSelection ()) style |= SWT.LEFT;
+ if (centerButton.getSelection ()) style |= SWT.CENTER;
+ if (rightButton.getSelection ()) style |= SWT.RIGHT;
/* Create the example widgets */
combo1 = new CCombo (comboGroup, style);
@@ -129,5 +135,17 @@ class CComboTab extends Tab {
flatButton.setSelection ((combo1.getStyle () & SWT.FLAT) != 0);
readOnlyButton.setSelection ((combo1.getStyle () & SWT.READ_ONLY) != 0);
borderButton.setSelection ((combo1.getStyle () & SWT.BORDER) != 0);
+ leftButton.setSelection ((combo1.getStyle () & SWT.LEFT) != 0);
+ centerButton.setSelection ((combo1.getStyle () & SWT.CENTER) != 0);
+ rightButton.setSelection ((combo1.getStyle () & SWT.RIGHT) != 0);
+ }
+
+ @Override
+ void setExampleWidgetAlignment() {
+ int alignment = 0;
+ if (leftButton.getSelection ()) alignment = SWT.LEFT;
+ if (centerButton.getSelection ()) alignment = SWT.CENTER;
+ if (rightButton.getSelection ()) alignment = SWT.RIGHT;
+ combo1.setAlignment (alignment);
}
}

Back to the top