Examples of Veto


Examples of org.apache.aurora.scheduler.filter.SchedulingFilter.Veto

    this.hostAttributes = requireNonNull(hostAttributes);
  }

  @VisibleForTesting
  static Veto limitVeto(String limit) {
    return new Veto("Limit not satisfied: " + limit, Veto.MAX_SCORE);
  }
View Full Code Here

Examples of org.apache.aurora.scheduler.filter.SchedulingFilter.Veto

    return Veto.constraintMismatch("Constraint not satisfied: " + constraint);
  }

  @VisibleForTesting
  static Veto maintenanceVeto(String reason) {
    return new Veto("Host " + reason + " for maintenance", Veto.MAX_SCORE);
  }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Veto

        final Consent visibilityConsent = new Allow(new InteractionResult(new PropertyVisibilityEvent(employeeDO, null)));

        final InteractionResult usabilityInteractionResult = new InteractionResult(new PropertyUsabilityEvent(employeeDO, null));
        usabilityInteractionResult.advise("disabled", disabledFacet);
        final Consent usabilityConsent = new Veto(usabilityInteractionResult);

        context.checking(new Expectations() {
            {
                allowing(mockPasswordMember).getFacets(with(any(Filter.class)));
                will(returnValue(facets));
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Veto

        final Consent visibilityConsent = new Allow(new InteractionResult(new PropertyVisibilityEvent(employeeDO, null)));

        final InteractionResult usabilityInteractionResult = new InteractionResult(new PropertyUsabilityEvent(employeeDO, null));
        usabilityInteractionResult.advise("disabled", disabledFacet);
        final Consent usabilityConsent = new Veto(usabilityInteractionResult);

        context.checking(new Expectations() {
            {
                allowing(mockPasswordMember).getFacets(with(any(Filter.class)));
                will(returnValue(facets));
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Veto

    @Override
    public Consent disabled(final View view) {
        if (isEmpty(view)) {
            // TODO: move logic into Facets
            return new Veto("Field is empty");
        }
        // TODO: move logic into Facets
        return Allow.DEFAULT;
        // return new Allow(String.format("Copy value '%s' to clipboard",
        // field.getSelectedText()));
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Veto

                    invalidFields.append(parameterName);
                }
            }
            if (missingFields.length() > 0) {
                // TODO: move logic into Facet
                return new Veto(String.format("Fields needed: %s", missingFields));
            }
            if (invalidFields.length() > 0) {
                // TODO: move logic into Facet
                return new Veto(String.format("Invalid fields: %s", invalidFields));
            }

            final ActionContent actionContent = ((ActionContent) view.getContent());
            return actionContent.disabled();
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Veto

            }
            final FieldEditState fieldState = formState.createField(fieldName, newEntry);
            Consent consent = null;

            if (!parameters2.get(i).isOptional() && newEntry.equals("")) {
                consent = new Veto(parameters2.get(i).getName() + " required");
                formState.setError("Not all fields have been set");

            } else if (parameters2.get(i).getSpecification().getFacet(ParseableFacet.class) != null) {
                try {
                    final ParseableFacet facet = parameters2.get(i).getSpecification().getFacet(ParseableFacet.class);
                    Localization localization = IsisContext.getLocalization();
                    final String message = parameters2.get(i).isValid(object, newEntry, localization);
                    if (message != null) {
                        consent = new Veto(message);
                        formState.setError("Not all fields are valid");
                    }
                    final ObjectAdapter entry = facet.parseTextEntry(null, newEntry, localization);
                    fieldState.setValue(entry);
                } catch (final TextEntryParseException e) {
                    consent = new Veto(e.getMessage());
                    formState.setError("Not all fields are valid");
                }
            } else {
                fieldState.setValue(newEntry == null ? null : context.getMappedObject(newEntry));
            }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Veto

                ApplicationWorkspace.this.markDamaged();
            }

            @Override
            public Consent disabled(final View view) {
                return LookFactory.getInstalledLook() == look ? new Veto("Current look") : Allow.DEFAULT;
            }
        });
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Veto

                session.setCurrentSession(user);
            }

            @Override
            public Consent disabled(final View view) {
                return user.equals(currentUser) ? new Veto("Current user") : Allow.DEFAULT;
            }
        });
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Veto

            }
            final FieldEditState fieldState = formState.createField(fieldId, newEntry);

            Consent consent = null;
            if (field.isMandatory() && (newEntry.equals("") || newEntry.equals("NULL"))) {
                consent = new Veto(field.getName() + " required");
                formState.setError("Not all fields have been set");
            } else if (field.getSpecification().containsFacet(ParseableFacet.class)) {
                try {
                    final ParseableFacet facet = field.getSpecification().getFacet(ParseableFacet.class);
                    final ObjectAdapter originalValue = field.get(object);
                    Localization localization = IsisContext.getLocalization();
                    final ObjectAdapter newValue = facet.parseTextEntry(originalValue, newEntry, localization);
                    consent = ((OneToOneAssociation) field).isAssociationValid(object, newValue);
                    fieldState.setValue(newValue);
                } catch (final TextEntryParseException e) {
                    consent = new Veto(e.getMessage());
                    // formState.setError("Not all fields have been entered correctly");
                }

            } else {
                final ObjectAdapter associate = newEntry.equals("null") ? null : context.getMappedObject(newEntry);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.