will(new CustomAction("returns first arg") { @Override public Object invoke(Invocation invocation) throws Throwable {
public CustomAction[] defineActions() { return new CustomAction[] { new CustomAction("double", EntityView.VIEW_SHOW), // return the object with the number doubled new CustomAction("xxx", EntityView.VIEW_EDIT), // change all text fields to 3 x's new CustomAction("clear", EntityView.VIEW_LIST) // remove all items }; }
public CustomAction[] defineActions() { return new CustomAction[] { new CustomAction("double", EntityView.VIEW_SHOW, "doubleUp"), // return the object with the number doubled new CustomAction("xxx", EntityView.VIEW_EDIT, "xxxChange"), // change all text fields to 3 x's new CustomAction("clear", EntityView.VIEW_LIST, "clearAll") // remove all items }; }
public CustomAction[] defineActions() { return new CustomAction[] { new CustomAction("double", EntityView.VIEW_SHOW), // return the object with the number doubled new CustomAction("xxx", EntityView.VIEW_EDIT), // change all text fields to 3 x's new CustomAction("clear", EntityView.VIEW_LIST) // remove all items }; }
public CustomAction[] defineActions() { return new CustomAction[] { new CustomAction("double", EntityView.VIEW_SHOW, "doubleUp"), // return the object with the number doubled new CustomAction("xxx", EntityView.VIEW_EDIT, "xxxChange"), // change all text fields to 3 x's new CustomAction("clear", EntityView.VIEW_LIST, "clearAll") // remove all items }; }
/** * @param ca * @return a copy of the supplied object */ public static CustomAction copy(CustomAction ca) { if (ca == null) { throw new IllegalArgumentException("action to copy must not be null"); } CustomAction togo = new CustomAction(ca.action, ca.viewKey, ca.methodName); togo.methodArgTypes = ca.methodArgTypes; return togo; }
JMenuItem copy = new JMenuItem( new CustomAction() );
/** * puts the parameter array as elements in the list * @param parameters A mutable list, will be cleared when the Action is invoked. */ public static Action captureParameters(final List<Object> parameters) { return new CustomAction("captures parameters") { public Object invoke(Invocation invocation) throws Throwable { parameters.clear(); parameters.addAll(Arrays.asList(invocation.getParametersAsArray())); return null; } }; }
CustomAction ca = new CustomAction(action, viewKey, method.getName()); try { ca.methodArgTypes = validateActionParamTypes(method.getParameterTypes(), method.getName()); } else if (method.getName().endsWith(ActionsExecutable.ACTION_METHOD_SUFFIX)) { String action = method.getName().substring(0, method.getName().length() - ActionsExecutable.ACTION_METHOD_SUFFIX.length()); CustomAction ca = new CustomAction(action, EntityView.VIEW_SHOW, method.getName()); try { ca.methodArgTypes = validateActionParamTypes(method.getParameterTypes(), method.getName());
will(new CustomAction("returns previous arg") { @Override public Object invoke(Invocation invocation) throws Throwable {
will(new CustomAction("Returns new BusinessObj instance") { @Override public Object invoke(Invocation invocation) throws Throwable {