public Consent disabled() { // REVIEW this is no good as it lumps all the parameters together; I need to know which parameter is // disabled! return action.isProposedArgumentSetValid(target, parameters); }
@Override protected Consent checkValid() { return action.isProposedArgumentSetValid(target, null); }
@Override public void checkForValidity(final Context context) { final NakedObject[] parameters = getEntries(context); final NakedObject target = getTarget(context); final Consent consent = action.isProposedArgumentSetValid(target, parameters); error = consent.getReason(); }
@Override public void checkForValidity(final Context context) { final NakedObject[] parameters = getEntries(context); final NakedObject target = getTarget(context); final Consent consent = action.isProposedArgumentSetValid(target, parameters); error = consent.getReason(); }
private Consent canDropOntoObject(final NakedObject target, final NakedObject source) { final NakedObjectAction action = dropAction(source, target); if (action != null) { final Consent parameterSetValid = action.isProposedArgumentSetValid(target, new NakedObject[] { source }); parameterSetValid.setDescription("Execute '" + action.getName() + "' with " + source.titleString()); return parameterSetValid; } else { return setFieldOfMatchingType(target, source); } }
public Consent canDrop(final Content sourceContent) { NakedObjectAction action = actionFor(sourceContent); if (action == null) { return Veto.DEFAULT; } else { NakedObject source = sourceContent.getNaked(); final Consent parameterSetValid = action.isProposedArgumentSetValid(adapter, new NakedObject[] { source }); parameterSetValid.setDescription("Execute '" + action.getName() + "' with " + source.titleString()); return parameterSetValid; } }
private Object handleActionMethod( final Object[] args, final AuthenticationSession session, final NakedObject targetAdapter, final NakedObjectAction noa, final String memberName) { final Object[] underlyingArgs = new Object[args.length]; int i = 0; for (final Object arg : args) { underlyingArgs[i++] = underlying(arg); } final NakedObject[] argAdapters = new NakedObject[underlyingArgs.length]; int j = 0; for (final Object underlyingArg : underlyingArgs) { argAdapters[j++] = underlyingArg!=null?getRuntimeContext().adapterFor(underlyingArg):null; } final InteractionResult interactionResult = noa.isProposedArgumentSetValid(targetAdapter, argAdapters).getInteractionResult(); notifyListenersAndVetoIfRequired(interactionResult); if (getExecutionMode() == ExecutionMode.EXECUTE) { final NakedObject actionReturnNO = noa.execute(targetAdapter, argAdapters); return NakedObjectUtils.unwrap(actionReturnNO); } objectChangedIfRequired(targetAdapter); return null; }
private Object handleActionMethod( final Object[] args, final AuthenticationSession session, final NakedObject targetAdapter, final NakedObjectAction noa, final String memberName) { final Object[] underlyingArgs = new Object[args.length]; int i = 0; for (final Object arg : args) { underlyingArgs[i++] = underlying(arg); } final NakedObject[] argAdapters = new NakedObject[underlyingArgs.length]; int j = 0; for (final Object underlyingArg : underlyingArgs) { argAdapters[j++] = underlyingArg!=null?getRuntimeContext().adapterFor(underlyingArg):null; } final InteractionResult interactionResult = noa.isProposedArgumentSetValid(targetAdapter, argAdapters).getInteractionResult(); notifyListenersAndVetoIfRequired(interactionResult); if (getExecutionMode() == ExecutionMode.EXECUTE) { final NakedObject actionReturnNO = noa.execute(targetAdapter, argAdapters); return NakedObjectUtils.unwrap(actionReturnNO); } objectChangedIfRequired(targetAdapter); return null; }
private Object handleActionMethod( final Object[] args, final AuthenticationSession session, final NakedObject targetAdapter, final NakedObjectAction noa, final String memberName) { final Object[] underlyingArgs = new Object[args.length]; int i = 0; for (final Object arg : args) { underlyingArgs[i++] = underlying(arg); } final NakedObject[] argAdapters = new NakedObject[underlyingArgs.length]; int j = 0; for (final Object underlyingArg : underlyingArgs) { argAdapters[j++] = underlyingArg!=null?getRuntimeContext().adapterFor(underlyingArg):null; } final InteractionResult interactionResult = noa.isProposedArgumentSetValid(targetAdapter, argAdapters).getInteractionResult(); notifyListenersAndVetoIfRequired(interactionResult); if (getExecutionMode() == ExecutionMode.EXECUTE) { final NakedObject actionReturnNO = noa.execute(targetAdapter, argAdapters); return NakedObjectUtils.unwrap(actionReturnNO); } objectChangedIfRequired(targetAdapter); return null; }
if ((action != null) && action.isProposedArgumentSetValid(target, new NakedObject[] { source }).isAllowed()) { return action.execute(target, new NakedObject[] { source });