aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2013-08-19 12:09:13 -0400
committerDani Megert2013-08-19 12:09:13 -0400
commit5595f0cf80ac6c3193367e6d76053dcca935bdf7 (patch)
tree2ce7784a246c28895f459694333040916c7ee16e
parent3d5654b4fd466151f23768143514408b61707bf3 (diff)
downloadeclipse.platform.ui-5595f0cf80ac6c3193367e6d76053dcca935bdf7.zip
eclipse.platform.ui-5595f0cf80ac6c3193367e6d76053dcca935bdf7.tar.gz
eclipse.platform.ui-5595f0cf80ac6c3193367e6d76053dcca935bdf7.tar.xz
Use vararg functionality
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PreferenceLinkArea.java3
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java7
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java21
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java2
4 files changed, 15 insertions, 18 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PreferenceLinkArea.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PreferenceLinkArea.java
index cdc671d..aa504af 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PreferenceLinkArea.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PreferenceLinkArea.java
@@ -65,8 +65,7 @@ public class PreferenceLinkArea extends Object {
result = NLS.bind(
WorkbenchMessages.PreferenceNode_NotFound, pageId);
} else {
- result = MessageFormat.format(message, (Object[]) new String[] { node
- .getLabelText() });
+ result = MessageFormat.format(message, node.getLabelText());
//Only add the selection listener if the node is found
pageLink.addSelectionListener(new SelectionAdapter() {
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
index eac1778..bd8db84 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
@@ -76,8 +76,7 @@ public class SelectAllHandler extends WidgetMethodHandler {
Runnable methodRunnable = new Runnable() {
public void run() {
try {
- methodToExecute.invoke(focusComponent,
- (Object[]) null);
+ methodToExecute.invoke(focusComponent);
// and back to the UI thread :-)
focusControl.getDisplay().asyncExec(
new Runnable() {
@@ -131,7 +130,7 @@ public class SelectAllHandler extends WidgetMethodHandler {
}
} else if (numParams == 0) {
// This is a no-argument selectAll method.
- methodToExecute.invoke(focusControl, (Object[]) null);
+ methodToExecute.invoke(focusControl);
focusControl.notifyListeners(SWT.Selection, null);
} else if (numParams == 1) {
@@ -139,7 +138,7 @@ public class SelectAllHandler extends WidgetMethodHandler {
final Method textLimitAccessor = focusControl.getClass()
.getMethod("getTextLimit", NO_PARAMETERS); //$NON-NLS-1$
final Integer textLimit = (Integer) textLimitAccessor
- .invoke(focusControl, (Object[]) null);
+ .invoke(focusControl);
final Object[] parameters = { new Point(0, textLimit
.intValue()) };
methodToExecute.invoke(focusControl, parameters);
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
index 93b964b..07aa0c99 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
@@ -96,8 +96,7 @@ public class WidgetMethodHandler extends AbstractHandler implements
Runnable methodRunnable = new Runnable() {
public void run() {
try {
- methodToExecute.invoke(focusComponent,
- (Object[]) null);
+ methodToExecute.invoke(focusComponent);
} catch (final IllegalAccessException e) {
// The method is protected, so do
// nothing.
@@ -139,7 +138,7 @@ public class WidgetMethodHandler extends AbstractHandler implements
} else {
- methodToExecute.invoke(focusControl, (Object[]) null);
+ methodToExecute.invoke(focusControl);
}
} catch (IllegalAccessException e) {
@@ -210,26 +209,26 @@ public class WidgetMethodHandler extends AbstractHandler implements
if (keyboardFocusManagerClass != null) {
// Use JRE 1.4 API
final Method keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod = keyboardFocusManagerClass
- .getMethod("getCurrentKeyboardFocusManager", (Class[]) null); //$NON-NLS-1$
+ .getMethod("getCurrentKeyboardFocusManager"); //$NON-NLS-1$
final Object keyboardFocusManager = keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod
- .invoke(keyboardFocusManagerClass, (Object[]) null);
+ .invoke(keyboardFocusManagerClass);
final Method keyboardFocusManagerGetFocusOwner = keyboardFocusManagerClass
- .getMethod("getFocusOwner", (Class[]) null); //$NON-NLS-1$
+ .getMethod("getFocusOwner"); //$NON-NLS-1$
final Object focusComponent = keyboardFocusManagerGetFocusOwner
- .invoke(keyboardFocusManager, (Object[]) null);
+ .invoke(keyboardFocusManager);
return focusComponent;
}
// Use JRE 1.3 API
final Class focusManagerClass = Class
.forName("javax.swing.FocusManager"); //$NON-NLS-1$
final Method focusManagerGetCurrentManagerMethod = focusManagerClass
- .getMethod("getCurrentManager", (Class[]) null); //$NON-NLS-1$
+ .getMethod("getCurrentManager"); //$NON-NLS-1$
final Object focusManager = focusManagerGetCurrentManagerMethod
- .invoke(focusManagerClass, (Object[]) null);
+ .invoke(focusManagerClass);
final Method focusManagerGetFocusOwner = focusManagerClass
- .getMethod("getFocusOwner", (Class[]) null); //$NON-NLS-1$
+ .getMethod("getFocusOwner"); //$NON-NLS-1$
final Object focusComponent = focusManagerGetFocusOwner
- .invoke(focusManager, (Object[]) null);
+ .invoke(focusManager);
return focusComponent;
}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
index 7b01f54..e76fa6d 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
@@ -398,7 +398,7 @@ public abstract class WorkbenchPart extends EventManager implements
if (!Util.equals(description, "")) { //$NON-NLS-1$
newTitle = MessageFormat
.format(
- WorkbenchMessages.WorkbenchPart_AutoTitleFormat, (Object[]) new String[] { name, description });
+ WorkbenchMessages.WorkbenchPart_AutoTitleFormat, name, description);
}
setTitle(newTitle);