Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2016-06-16 00:38:34 -0400
committerAlexander Kurtakov2016-06-17 03:01:03 -0400
commitab85daa02672a6c50abbbf750a1c3ad46a1ad159 (patch)
tree1702991108db56f52c9558d60a955157ecb37998 /examples
parentd76a10187df9c9eab08a064757013c6fb32e5b94 (diff)
downloadeclipse.platform.swt-ab85daa02672a6c50abbbf750a1c3ad46a1ad159.tar.gz
eclipse.platform.swt-ab85daa02672a6c50abbbf750a1c3ad46a1ad159.tar.xz
eclipse.platform.swt-ab85daa02672a6c50abbbf750a1c3ad46a1ad159.zip
Bug 487493 - Use varargs in List#setItems
Fix warnings in tests and update examples/snippets to use the new shorter syntax. Change-Id: Ia37a4e1cfd78324938f61e1b3312b8866e377718 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java2
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet65.java2
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet75.java4
5 files changed, 7 insertions, 7 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
index 1822c9ab3c..cc1c382e14 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
@@ -225,10 +225,10 @@ public class ControlsWithAccessibleNamesExample {
// List list, overrideList;
list = new List(shell, SWT.SINGLE | SWT.BORDER);
- list.setItems(new String[] {"Item0", "Item1", "Item2"});
+ list.setItems("Item0", "Item1", "Item2");
overrideList = new List(shell, SWT.SINGLE | SWT.BORDER);
- overrideList.setItems(new String[] {"Item0", "Item1", "Item2"});
+ overrideList.setItems("Item0", "Item1", "Item2");
overrideList.setData("name", "List");
overrideList.setData("child", "List Item");
overrideList.getAccessible().addAccessibleListener(overrideAccessibleAdapter);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java
index 0feef15174..bdb8a9a4c5 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java
@@ -133,7 +133,7 @@ public class ControlsWithLabelsExample {
new Label(shell, SWT.NONE).setText("Label for List");
list = new List(shell, SWT.SINGLE | SWT.BORDER);
- list.setItems(new String[] {"Item0", "Item1", "Item2"});
+ list.setItems("Item0", "Item1", "Item2");
new Label(shell, SWT.NONE).setText("Label for Spinner");
spinner = new Spinner(shell, SWT.BORDER);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
index cba23d9256..77a8ee32c2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
@@ -1271,7 +1271,7 @@ private Control createWidget(int type, Composite parent, String prefix){
}
case LIST: {
List list = new List(parent, SWT.BORDER);
- list.setItems(new String[] {prefix+" Item a", prefix+" Item b", prefix+" Item c", prefix+" Item d"});
+ list.setItems(prefix+" Item a", prefix+" Item b", prefix+" Item c", prefix+" Item d");
return list;
}
case COMBO:{
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet65.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet65.java
index 917633b094..a890a68567 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet65.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet65.java
@@ -29,7 +29,7 @@ public static void main (String [] args) {
Label label = new Label (shell, SWT.WRAP);
label.setText ("This is a long text string that will wrap when the dialog is resized.");
List list = new List (shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- list.setItems (new String [] {"Item 1", "Item 2"});
+ list.setItems ("Item 1", "Item 2");
Button button1 = new Button (shell, SWT.PUSH);
button1.setText ("OK");
Button button2 = new Button (shell, SWT.PUSH);
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet75.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet75.java
index 0bf048f82f..71cb7d3a11 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet75.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet75.java
@@ -42,7 +42,7 @@ public static void main (String [] args) {
Button b2 = new Button (c1, SWT.PUSH);
b2.setText ("B2");
List l1 = new List (c1, SWT.SINGLE | SWT.BORDER);
- l1.setItems (new String [] {"L1"});
+ l1.setItems ("L1");
Button b3 = new Button (c1, SWT.PUSH);
b3.setText ("B&3");
Button b4 = new Button (c1, SWT.PUSH);
@@ -56,7 +56,7 @@ public static void main (String [] args) {
b6.setText ("B&6");
List l2 = new List (shell, SWT.SINGLE | SWT.BORDER);
- l2.setItems (new String [] {"L2"});
+ l2.setItems ("L2");
ToolBar tb1 = new ToolBar (shell, SWT.FLAT | SWT.BORDER);
ToolItem i1 = new ToolItem (tb1, SWT.RADIO);

Back to the top