Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Pun2017-06-28 20:08:22 +0000
committerAlexander Kurtakov2017-06-29 18:51:38 +0000
commite822f9099b3e2072ae16f085fb77ea00d61117fa (patch)
treed8baca7f19ba9cfcceefe963f377b74606039683 /examples
parent18326ae5bb99e1bc2fe12f7d3b1b1b678c9b97b5 (diff)
downloadeclipse.platform.swt-e822f9099b3e2072ae16f085fb77ea00d61117fa.tar.gz
eclipse.platform.swt-e822f9099b3e2072ae16f085fb77ea00d61117fa.tar.xz
eclipse.platform.swt-e822f9099b3e2072ae16f085fb77ea00d61117fa.zip
Bug 518900 - Show alpha values in ControlExample's color tab
Colortab now shows alpha values. Change-Id: I95a6b8f93948556362fb00f74f5a87df6b8ff4d1 Signed-off-by: Ian Pun <ipun@redhat.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/examples_control.properties2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java5
2 files changed, 3 insertions, 4 deletions
diff --git a/examples/org.eclipse.swt.examples/src/examples_control.properties b/examples/org.eclipse.swt.examples/src/examples_control.properties
index ea82da6e03..5d32eafdc2 100644
--- a/examples/org.eclipse.swt.examples/src/examples_control.properties
+++ b/examples/org.eclipse.swt.examples/src/examples_control.properties
@@ -268,7 +268,7 @@ MozillaNotFound = Cannot use SWT.MOZILLA style: {0}\nSee http://www.eclipse.or
WebKitNotFound = Cannot use SWT.WEBKIT style: {0}\nSee http://www.eclipse.org/swt/faq.php#howusewebkit for more information.
ColorTitle_0 = Name
ColorTitle_1 = Type
-ColorTitle_2 = RGB
+ColorTitle_2 = RGBA
ColorTitle_3 = Color
Header_Foreground_Color = Header Foreground Color
Header_Background_Color = Header Background Color \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java
index c7afd94ff9..f8003c050a 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java
@@ -184,10 +184,9 @@ class ColorTab extends Tab {
}
String getRGBcolor(int id){
- String result;
Color color = display.getSystemColor(id);
- result = "("+color.getRed() + "," + color.getGreen() + "," + color.getBlue()+")";
- return result;
+ return String.format("(%d,%d,%d,%d)", color.getRed(), color.getGreen(),
+ color.getBlue(), color.getAlpha());
}
@Override

Back to the top