Search in sources :

Example 1 with State

use of org.eclipse.xtext.validation.AbstractDeclarativeValidator.State in project xtext-core by eclipse.

the class ValidatorTester method validator.

public T validator() {
    State s = validator.setMessageAcceptor(validator).getState();
    if (s.chain == null)
        s.chain = new BasicDiagnostic();
    validatorCalled = true;
    return validator;
}
Also used : State(org.eclipse.xtext.validation.AbstractDeclarativeValidator.State) BasicDiagnostic(org.eclipse.emf.common.util.BasicDiagnostic)

Example 2 with State

use of org.eclipse.xtext.validation.AbstractDeclarativeValidator.State in project ow by vtst.

the class ConfigurableValidationMessageAcceptor method isDisabled.

// **************************************************************************
// implements ValidationMessageAcceptor
/**
   * This function is called by every error(), warning(), info() method to check
   * whether the current check is disabled.
   * @return true if the current check is disabled.
   */
private boolean isDisabled() {
    State state = stateAccess.getState();
    if (state.currentObject == null)
        return false;
    ProjectConfiguration configuration = cache.get(state.currentObject.eResource());
    if (configuration == null)
        return false;
    return configuration.isDisabled(state.currentMethod);
}
Also used : State(org.eclipse.xtext.validation.AbstractDeclarativeValidator.State)

Example 3 with State

use of org.eclipse.xtext.validation.AbstractDeclarativeValidator.State in project xtext-core by eclipse.

the class XtextValidationTest method configureValidator.

private void configureValidator(XtextValidator validator, ValidationMessageAcceptor messageAcceptor, EObject currentObject) {
    State state = validator.setMessageAcceptor(messageAcceptor).getState();
    state.currentObject = currentObject;
    state.context = newHashMap();
}
Also used : State(org.eclipse.xtext.validation.AbstractDeclarativeValidator.State)

Aggregations

State (org.eclipse.xtext.validation.AbstractDeclarativeValidator.State)3 BasicDiagnostic (org.eclipse.emf.common.util.BasicDiagnostic)1