List of usage examples for org.apache.commons.lang.reflect MethodUtils invokeExactMethod
public static Object invokeExactMethod(Object object, String methodName, Object[] args, Class[] parameterTypes) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
Invoke a method whose parameter types match exactly the parameter types given.
This uses reflection to invoke the method obtained from a call to getAccessibleMethod()
.
From source file:org.eclipse.mylyn.internal.tasks.ui.TaskTrimWidget.java
private boolean contributeObjectActionsOld(IMenuManager manager) { try {/*w ww .ja va 2 s . c o m*/ MethodUtils.invokeExactMethod(ObjectActionContributorManager.getManager(), "contributeObjectActions", //$NON-NLS-1$ new Object[] { null, manager, activeTaskSelectionProvider }, new Class[] { IWorkbenchPart.class, IMenuManager.class, ISelectionProvider.class }); } catch (NoSuchMethodException e) { return false; } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } return true; }
From source file:org.eclipse.mylyn.internal.tasks.ui.TaskTrimWidget.java
private boolean contributeObjectActionsNew(IMenuManager manager) { try {/*from w w w . j ava 2 s .c o m*/ MethodUtils.invokeExactMethod(ObjectActionContributorManager.getManager(), "contributeObjectActions", //$NON-NLS-1$ new Object[] { null, manager, activeTaskSelectionProvider, Collections.EMPTY_SET }, new Class[] { IWorkbenchPart.class, IMenuManager.class, ISelectionProvider.class, Set.class }); } catch (NoSuchMethodException e) { return false; } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } return true; }