Package org.apache.cayenne.project.validator

Examples of org.apache.cayenne.project.validator.Validator


    /**
   * Validates project for possible conflicts and incomplete mappings.
   */
  public void performAction(ActionEvent e) {
    Validator val = getCurrentProject().getValidator();
    int validationCode = val.validate();

    // If there were errors or warnings at validation, display them
    if (validationCode >= ValidationDisplayHandler.WARNING) {
      ValidatorDialog.showDialog(Application.getFrame(), val);
    }
View Full Code Here


    public synchronized void performAction(ActionEvent e) {
        performAction(ValidationDisplayHandler.WARNING);
    }

    public synchronized void performAction(int warningLevel) {
        Validator val = getCurrentProject().getValidator();
        int validationCode = val.validate();

        // If no serious errors, perform save.
        if (validationCode < ValidationDisplayHandler.ERROR) {
            try {
                if (!saveAll()) {
View Full Code Here

            // mark project as unsaved
            project.setModified(true);
            projectController.setDirty(true);

            // show warning dialog
            ValidatorDialog.showDialog(frame, new Validator(project, project
                    .getLoadStatus()));
        }

    }
View Full Code Here

      p.setModified(true);
      assertTrue(p.isModified());     
    }
   
    public void testValidator() throws Exception {
        Validator v1 = p.getValidator();
        assertSame(p, v1.getProject());

        Validator v2 = p.getValidator();
        assertSame(p, v2.getProject());

        assertTrue(v1 != v2);
    }
View Full Code Here

        // non-derived DbEntities...

        // TODO: this is inefficient.. we need targeted validation
        // instead of doing it on the whole project

        Validator validator = ((ProjectController) getParent())
                .getProject()
                .getValidator();
        int validationCode = validator.validate();
        if (validationCode >= ValidationDisplayHandler.WARNING) {

            for (ValidationInfo nextProblem : validator.validationResults()) {
                Entity failedEntity = null;

                if (nextProblem.getValidatedObject() instanceof DbAttribute) {
                    DbAttribute failedAttribute = (DbAttribute) nextProblem
                            .getValidatedObject();
View Full Code Here

    /**
     * Creates an instance of Validator for validating this project.
     */
    public Validator getValidator() {
        return new Validator(this);
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.project.validator.Validator

Copyright © 2018 www.massapicom. 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.