Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2016-12-13 05:32:03 -0500
committerLars Vogel2016-12-13 11:22:42 -0500
commit43b190a8d20a5d64e710a20e053f9a5ffcca9e5d (patch)
treea944b6cc84bdfe3fcc1d1a06efd50b9b10793095 /examples
parente6d5298ba875fab1aef01df4b2010d03328fdb44 (diff)
downloadeclipse.platform.swt-43b190a8d20a5d64e710a20e053f9a5ffcca9e5d.tar.gz
eclipse.platform.swt-43b190a8d20a5d64e710a20e053f9a5ffcca9e5d.tar.xz
eclipse.platform.swt-43b190a8d20a5d64e710a20e053f9a5ffcca9e5d.zip
Bug 509135 - Use varargs in ControlExample#getResourceString to match
MessageFormat.format Change-Id: Ib86415f8bf4d496dd19fe51f17c3f34d8d3305e4 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ColorTab.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java12
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java2
-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/TableTab.java2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java2
9 files changed, 15 insertions, 15 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java
index 9a12879e8e..68ee7abe99 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java
@@ -104,7 +104,7 @@ class BrowserTab extends Tab {
}
MessageBox dialog = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
String resourceString = (style & SWT.MOZILLA) != 0 ? "MozillaNotFound" : "WebKitNotFound";
- dialog.setMessage(ControlExample.getResourceString(resourceString, new String [] {e.getMessage()}));
+ dialog.setMessage(ControlExample.getResourceString(resourceString, e.getMessage()));
dialog.open();
}
@@ -209,7 +209,7 @@ class BrowserTab extends Tab {
public void widgetSelected(SelectionEvent e) {
if (errorMessage != null && tabFolder.getSelection()[0].getText().equals(getTabText())) {
MessageBox dialog = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
- dialog.setMessage(ControlExample.getResourceString("BrowserNotFound", new String [] {errorMessage}));
+ dialog.setMessage(ControlExample.getResourceString("BrowserNotFound", errorMessage));
dialog.open();
}
}
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 fe6cdd0c98..4d5f8a039a 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
@@ -108,7 +108,7 @@ class ColorTab extends Tab {
for (String columnTitle : columnTitles) {
TableColumn tableColumn = new TableColumn(colors, SWT.NONE);
tableColumn.setText(columnTitle);
- tableColumn.setToolTipText(ControlExample.getResourceString("Tooltip", new String [] {columnTitle}));
+ tableColumn.setToolTipText(ControlExample.getResourceString("Tooltip", columnTitle));
}
// fill in the Data. Put an empty line inbetween "Named" and "SWT" colors.
boolean emptyLineFlag=false;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
index 86b2c3960b..3e85e4c120 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
@@ -170,7 +170,7 @@ public class ControlExample {
* with the given arguments. If the key is not found,
* return the key.
*/
- static String getResourceString(String key, Object[] args) {
+ static String getResourceString(String key, Object... args) {
try {
return MessageFormat.format(getResourceString(key), args);
} catch (MissingResourceException e) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
index 40b564b884..8f19139699 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
@@ -151,7 +151,7 @@ class DialogTab extends Tab {
dialog.setText (ControlExample.getResourceString("Title"));
RGB result = dialog.open ();
textWidget.append (ControlExample.getResourceString("ColorDialog") + Text.DELIMITER);
- textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER);
+ textWidget.append (ControlExample.getResourceString("Result", "" + result) + Text.DELIMITER);
textWidget.append ("getRGB() = " + dialog.getRGB() + Text.DELIMITER);
textWidget.append ("getRGBs() =" + Text.DELIMITER);
RGB[] rgbs = dialog.getRGBs();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java
index d42a6e2117..2b4d63a507 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java
@@ -91,7 +91,7 @@ class MenuTab extends Tab {
MenuItem item = new MenuItem(menuBar, SWT.CASCADE);
item.setText(getMenuItemText("Cascade"));
if (imagesButton.getSelection()) item.setImage(instance.images[ControlExample.ciOpenFolder]);
- if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", new String[] {item.getText() }));
+ if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", item.getText() ));
hookListeners(item);
Menu dropDownMenu = new Menu(shell, SWT.DROP_DOWN | radioBehavior);
item.setMenu(dropDownMenu);
@@ -254,13 +254,13 @@ class MenuTab extends Tab {
if (acceleratorsButton.getSelection()) item.setAccelerator(SWT.MOD1 + SWT.MOD2 + 'P');
if (imagesButton.getSelection()) item.setImage(instance.images[ControlExample.ciClosedFolder]);
item.setEnabled(enabledButton.getSelection());
- if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", new String[] {item.getText() }));
+ if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", item.getText() ));
hookListeners(item);
}
if (separatorButton.getSelection()) {
item = new MenuItem(menu, SWT.SEPARATOR);
- if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", new String[] {item.getText() }));
+ if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", item.getText() ));
}
if (checkButton.getSelection()) {
@@ -269,7 +269,7 @@ class MenuTab extends Tab {
if (acceleratorsButton.getSelection()) item.setAccelerator(SWT.MOD1 + SWT.MOD2 + 'C');
if (imagesButton.getSelection()) item.setImage(instance.images[ControlExample.ciOpenFolder]);
item.setEnabled(enabledButton.getSelection());
- if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", new String[] {item.getText() }));
+ if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", item.getText() ));
hookListeners(item);
}
@@ -280,7 +280,7 @@ class MenuTab extends Tab {
if (imagesButton.getSelection()) item.setImage(instance.images[ControlExample.ciTarget]);
item.setSelection(true);
item.setEnabled(enabledButton.getSelection());
- if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", new String[] {item.getText() }));
+ if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", item.getText() ));
hookListeners(item);
item = new MenuItem(menu, SWT.RADIO);
@@ -302,7 +302,7 @@ class MenuTab extends Tab {
item.setMenu(subMenu);
item.setEnabled(enabledButton.getSelection());
hookListeners(subMenu);
- if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", new String[] {item.getText() }));
+ if (tooltipButton.getSelection()) item.setToolTipText(ControlExample.getResourceString("Tooltip", item.getText() ));
createMenuItems(subMenu, createSubSubMenu, false);
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
index 9e105b667b..910988eb5d 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
@@ -618,7 +618,7 @@ abstract class Tab {
dialog.setLayout(new GridLayout());
dialog.setText(ControlExample.getResourceString ("Edit_Event"));
Label label = new Label (dialog, SWT.NONE);
- label.setText (ControlExample.getResourceString ("Edit_Event_Fields", new String [] {EVENT_INFO[index].name}));
+ label.setText (ControlExample.getResourceString ("Edit_Event_Fields", EVENT_INFO[index].name));
Group group = new Group (dialog, SWT.NONE);
group.setLayout(new GridLayout(2, 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 dff36540b7..df0f02fd16 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
@@ -72,7 +72,7 @@ class TabFolderTab extends Tab {
for (int i = 0; i < TabItems1.length; i++) {
TabItem item = new TabItem(tabFolder1, SWT.NONE);
item.setText(TabItems1[i]);
- item.setToolTipText(ControlExample.getResourceString("Tooltip", new String [] {TabItems1[i]}));
+ item.setToolTipText(ControlExample.getResourceString("Tooltip", TabItems1[i]));
Text content = new Text(tabFolder1, SWT.WRAP | SWT.MULTI);
content.setText(ControlExample.getResourceString("TabItem_content") + ": " + i);
item.setControl(content);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
index 6387fcf93c..2801d3dc70 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
@@ -321,7 +321,7 @@ class TableTab extends ScrollableTab {
for (int i = 0; i < columnTitles.length; i++) {
TableColumn tableColumn = new TableColumn(table1, SWT.NONE);
tableColumn.setText(columnTitles[i]);
- tableColumn.setToolTipText(ControlExample.getResourceString("Tooltip", new String [] {columnTitles[i]}));
+ tableColumn.setToolTipText(ControlExample.getResourceString("Tooltip", columnTitles[i]));
if (headerImagesButton.getSelection()) tableColumn.setImage(instance.images [i % 3]);
}
table1.setSortColumn(table1.getColumn(0));
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
index c80619d1e9..965ca35b1b 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
@@ -325,7 +325,7 @@ class TreeTab extends ScrollableTab {
for (String columnTitle : columnTitles) {
TreeColumn treeColumn = new TreeColumn(tree1, SWT.NONE);
treeColumn.setText(columnTitle);
- treeColumn.setToolTipText(ControlExample.getResourceString("Tooltip", new String [] {columnTitle}));
+ treeColumn.setToolTipText(ControlExample.getResourceString("Tooltip", columnTitle));
}
tree1.setSortColumn(tree1.getColumn(0));
}

Back to the top