|
@@ -130,7 +130,7 @@ public class Apple implements InvocationHandler {
|
130
|
130
|
* @return Output from method.invoke()
|
131
|
131
|
*/
|
132
|
132
|
private Object reflectMethod(final Object obj, final String className, final String methodName,
|
133
|
|
- final Class<?>[] classes, final Object... objects) {
|
|
133
|
+ final Class<?>[] classes, final Object[] objects) {
|
134
|
134
|
try {
|
135
|
135
|
final Class<?> clazz = className == null ? obj.getClass() : Class.forName(className);
|
136
|
136
|
final Method method = clazz.getMethod(methodName, classes == null ? new Class<?>[0]
|
|
@@ -153,7 +153,7 @@ public class Apple implements InvocationHandler {
|
153
|
153
|
* @return Output from method.invoke()
|
154
|
154
|
*/
|
155
|
155
|
private Object doAppleMethod(final String methodName, final Class<?>[] classes,
|
156
|
|
- final Object... objects) {
|
|
156
|
+ final Object[] objects) {
|
157
|
157
|
if (!isApple()) {
|
158
|
158
|
return null;
|
159
|
159
|
}
|
|
@@ -223,7 +223,7 @@ public class Apple implements InvocationHandler {
|
223
|
223
|
* only the foremost one
|
224
|
224
|
*/
|
225
|
225
|
public void requestForeground(final boolean allWindows) {
|
226
|
|
- doAppleMethod("requestForeground", new Class<?>[]{Boolean.TYPE}, allWindows);
|
|
226
|
+ doAppleMethod("requestForeground", new Class<?>[]{Boolean.TYPE}, new Object[]{allWindows});
|
227
|
227
|
}
|
228
|
228
|
|
229
|
229
|
/**
|
|
@@ -235,7 +235,7 @@ public class Apple implements InvocationHandler {
|
235
|
235
|
* until clicked on.
|
236
|
236
|
*/
|
237
|
237
|
public void requestUserAttention(final boolean isCritical) {
|
238
|
|
- doAppleMethod("requestUserAttention", new Class<?>[]{Boolean.TYPE}, isCritical);
|
|
238
|
+ doAppleMethod("requestUserAttention", new Class<?>[]{Boolean.TYPE}, new Object[]{isCritical});
|
239
|
239
|
}
|
240
|
240
|
|
241
|
241
|
/**
|
|
@@ -244,7 +244,7 @@ public class Apple implements InvocationHandler {
|
244
|
244
|
* @param menu the PopupMenu to attach to this application's Dock icon
|
245
|
245
|
*/
|
246
|
246
|
public void setDockMenu(final PopupMenu menu) {
|
247
|
|
- doAppleMethod("setDockMenu", new Class<?>[]{PopupMenu.class}, menu);
|
|
247
|
+ doAppleMethod("setDockMenu", new Class<?>[]{PopupMenu.class}, new Object[]{menu});
|
248
|
248
|
}
|
249
|
249
|
|
250
|
250
|
/**
|
|
@@ -263,7 +263,7 @@ public class Apple implements InvocationHandler {
|
263
|
263
|
* @param image The image to use
|
264
|
264
|
*/
|
265
|
265
|
public void setDockIconImage(final Image image) {
|
266
|
|
- doAppleMethod("setDockIconImage", new Class<?>[]{Image.class}, image);
|
|
266
|
+ doAppleMethod("setDockIconImage", new Class<?>[]{Image.class}, new Object[]{image});
|
267
|
267
|
}
|
268
|
268
|
|
269
|
269
|
/**
|
|
@@ -282,7 +282,7 @@ public class Apple implements InvocationHandler {
|
282
|
282
|
* @param badge textual label to affix to the Dock icon
|
283
|
283
|
*/
|
284
|
284
|
public void setDockIconBadge(final String badge) {
|
285
|
|
- doAppleMethod("setDockIconBadge", new Class<?>[]{String.class}, badge);
|
|
285
|
+ doAppleMethod("setDockIconBadge", new Class<?>[]{String.class}, new Object[]{badge});
|
286
|
286
|
}
|
287
|
287
|
|
288
|
288
|
/**
|
|
@@ -292,7 +292,7 @@ public class Apple implements InvocationHandler {
|
292
|
292
|
* @param menuBar to use when no other frames are active
|
293
|
293
|
*/
|
294
|
294
|
public void setDefaultMenuBar(final JMenuBar menuBar) {
|
295
|
|
- doAppleMethod("setDefaultMenuBar", new Class<?>[]{JMenuBar.class}, menuBar);
|
|
295
|
+ doAppleMethod("setDefaultMenuBar", new Class<?>[]{JMenuBar.class}, new Object[]{menuBar});
|
296
|
296
|
}
|
297
|
297
|
|
298
|
298
|
/**
|