diff options
author | Alexander Kurtakov | 2016-12-14 13:01:54 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2016-12-14 13:01:54 +0000 |
commit | 88c6ff9c59f4e0512cb3710f7bce1fd5d15a284b (patch) | |
tree | 7ec0d6f0a1c05c43d05a70d9da06d79035eb1c98 /examples | |
parent | d9b31e6df892a7a85d8bc3f53306df35c402aec7 (diff) | |
download | eclipse.platform.swt-88c6ff9c59f4e0512cb3710f7bce1fd5d15a284b.tar.gz eclipse.platform.swt-88c6ff9c59f4e0512cb3710f7bce1fd5d15a284b.tar.xz eclipse.platform.swt-88c6ff9c59f4e0512cb3710f7bce1fd5d15a284b.zip |
Bug 509135 - Use varargs in ControlExample#getResourceString to matchI20161214-1005
MessageFormat.format
Fix warnings in code using the method.
Change-Id: Ib8ac199d325d90ee89d82fa9f7b3de8c7d921264
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'examples')
3 files changed, 14 insertions, 14 deletions
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 8f19139699..aa7cbd7065 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 @@ -175,7 +175,7 @@ class DialogTab extends Tab { dialog.setText (ControlExample.getResourceString("Title")); String result = dialog.open (); textWidget.append (ControlExample.getResourceString("DirectoryDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER + Text.DELIMITER); + textWidget.append (ControlExample.getResourceString("Result", "" + result) + Text.DELIMITER + Text.DELIMITER); directoryDialogResult = result; return; } @@ -191,7 +191,7 @@ class DialogTab extends Tab { dialog.setText (ControlExample.getResourceString("Title")); String result = dialog.open(); textWidget.append (ControlExample.getResourceString("FileDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER); + textWidget.append (ControlExample.getResourceString("Result", "" + result) + Text.DELIMITER); textWidget.append ("getFilterIndex() =" + dialog.getFilterIndex() + Text.DELIMITER); textWidget.append ("getFilterPath() =" + dialog.getFilterPath() + Text.DELIMITER); textWidget.append ("getFileName() =" + dialog.getFileName() + Text.DELIMITER); @@ -216,7 +216,7 @@ class DialogTab extends Tab { dialog.setText (ControlExample.getResourceString("Title")); FontData result = dialog.open (); textWidget.append (ControlExample.getResourceString("FontDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER); + textWidget.append (ControlExample.getResourceString("Result", "" + result) + Text.DELIMITER); textWidget.append ("getFontList() =" + Text.DELIMITER); FontData [] fonts = dialog.getFontList (); if (fonts != null) { @@ -239,7 +239,7 @@ class DialogTab extends Tab { dialog.setText(ControlExample.getResourceString("Title")); PrinterData result = dialog.open (); textWidget.append (ControlExample.getResourceString("PrintDialog") + Text.DELIMITER); - textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER); + textWidget.append (ControlExample.getResourceString("Result", "" + result) + Text.DELIMITER); if (result != null) { textWidget.append ("printerData.scope = " + (result.scope == PrinterData.PAGE_RANGE ? "PAGE_RANGE" : result.scope == PrinterData.SELECTION ? "SELECTION" : "ALL_PAGES") + Text.DELIMITER); textWidget.append ("printerData.startPage = " + result.startPage + Text.DELIMITER); @@ -268,28 +268,28 @@ class DialogTab extends Tab { */ switch (result) { case SWT.OK: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.OK"})); + textWidget.append (ControlExample.getResourceString("Result", "SWT.OK")); break; case SWT.YES: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.YES"})); + textWidget.append (ControlExample.getResourceString("Result", "SWT.YES")); break; case SWT.NO: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.NO"})); + textWidget.append (ControlExample.getResourceString("Result", "SWT.NO")); break; case SWT.CANCEL: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.CANCEL"})); + textWidget.append (ControlExample.getResourceString("Result", "SWT.CANCEL")); break; case SWT.ABORT: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.ABORT"})); + textWidget.append (ControlExample.getResourceString("Result", "SWT.ABORT")); break; case SWT.RETRY: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.RETRY"})); + textWidget.append (ControlExample.getResourceString("Result", "SWT.RETRY")); break; case SWT.IGNORE: - textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.IGNORE"})); + textWidget.append (ControlExample.getResourceString("Result", "SWT.IGNORE")); break; default: - textWidget.append(ControlExample.getResourceString("Result", new String [] {"" + result})); + textWidget.append(ControlExample.getResourceString("Result", "" + result)); break; } textWidget.append (Text.DELIMITER + Text.DELIMITER); 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 2b4d63a507..897d1cce6c 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 @@ -288,7 +288,7 @@ class MenuTab extends Tab { if (acceleratorsButton.getSelection()) item.setAccelerator(SWT.MOD1 + SWT.MOD2 + '2'); if (imagesButton.getSelection()) item.setImage(instance.images[ControlExample.ciTarget]); 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); } 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 965ca35b1b..6fd29a076f 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 @@ -356,7 +356,7 @@ class TreeTab extends ScrollableTab { for (int i = 0; i < columnTitles.length; i++) { TreeColumn treeColumn = new TreeColumn(tree2, SWT.NONE); treeColumn.setText(columnTitles[i]); - treeColumn.setToolTipText(ControlExample.getResourceString("Tooltip", new String [] {columnTitles[i]})); + treeColumn.setToolTipText(ControlExample.getResourceString("Tooltip", columnTitles[i])); if (headerImagesButton.getSelection()) treeColumn.setImage(instance.images [i % 3]); } } |