Package org.apache.cayenne.project.validator

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


        problemsTable.setModel(new ValidatorTableModel());
    }

    private void showFailedObject() {
        if (problemsTable.getSelectedRow() >= 0) {
            ValidationInfo obj = (ValidationInfo) problemsTable.getModel().getValueAt(
                    problemsTable.getSelectedRow(),
                    0);
            ValidationDisplayHandler.getErrorMsg(obj).displayField(
                    getMediator(),
                    super.getParentEditor());
View Full Code Here


                int row,
                int column) {

            boolean error = false;
            if (value != null) {
                ValidationInfo info = (ValidationInfo) value;
                error = info.getSeverity() == ValidationInfo.ERROR;
                value = (error) ? "Error: " + info.getMessage() : "Warning: "
                        + info.getMessage();
            }

            setBackground(error ? ERROR_COLOR : WARNING_COLOR);
            return super.getTableCellRendererComponent(
                    table,
View Full Code Here

        int validationCode = validator.validate();
        if (validationCode >= ValidationDisplayHandler.WARNING) {

            Iterator it = validator.validationResults().iterator();
            while (it.hasNext()) {
                ValidationInfo nextProblem = (ValidationInfo) it.next();
                Entity failedEntity = null;

                if (nextProblem.getValidatedObject() instanceof DbAttribute) {
                    DbAttribute failedAttribute = (DbAttribute) nextProblem
                            .getValidatedObject();
                    failedEntity = failedAttribute.getEntity();
                }
                else if (nextProblem.getValidatedObject() instanceof DbRelationship) {
                    DbRelationship failedRelationship = (DbRelationship) nextProblem
                            .getValidatedObject();
                    failedEntity = failedRelationship.getSourceEntity();
                }
                else if (nextProblem.getValidatedObject() instanceof DbEntity) {
                    failedEntity = (Entity) nextProblem.getValidatedObject();
                }

                if (failedEntity == null) {
                    continue;
                }

                excludedTables.put(failedEntity.getName(), failedEntity);
                validationMessages.put(failedEntity.getName(), nextProblem.getMessage());
            }
        }

        // now do a pass through the tables and exclude derived
        Iterator tablesIt = tables.iterator();
View Full Code Here

        problemsTable.setModel(new ValidatorTableModel());
    }

    private void showFailedObject() {
        if (problemsTable.getSelectedRow() >= 0) {
            ValidationInfo obj = (ValidationInfo) problemsTable.getModel().getValueAt(
                    problemsTable.getSelectedRow(),
                    0);
            ValidationDisplayHandler.getErrorMsg(obj).displayField(
                    getMediator(),
                    super.getParentEditor());
View Full Code Here

                int row,
                int column) {

            boolean error = false;
            if (value != null) {
                ValidationInfo info = (ValidationInfo) value;
                error = info.getSeverity() == ValidationInfo.ERROR;
                value = (error) ? "Error: " + info.getMessage() : "Warning: "
                        + info.getMessage();
            }

            setBackground(error ? ERROR_COLOR : WARNING_COLOR);
            return super.getTableCellRendererComponent(
                    table,
View Full Code Here

*
*/
public class ValidationDisplayHandlerTest extends TestCase {

    public void testValidationInfo() throws Exception {
        ValidationInfo info = new ValidationInfo(-1, "123", null);
        ValidationDisplayHandler handler = new ConcreteErrorMsg(info);

        assertSame(info, handler.getValidationInfo());
    }
View Full Code Here

        assertSame(info, handler.getValidationInfo());
    }

    public void testMessage() throws Exception {
        String msg = "abc";
        ValidationInfo info = new ValidationInfo(-1, msg, null);
        ValidationDisplayHandler handler = new ConcreteErrorMsg(info);

        assertSame(msg, handler.getMessage());
    }
View Full Code Here

        assertSame(msg, handler.getMessage());
    }

    public void testSeverity() throws Exception {
        ValidationInfo info =
            new ValidationInfo(ValidationDisplayHandler.ERROR, null, null);
        ValidationDisplayHandler handler = new ConcreteErrorMsg(info);

        assertEquals(ValidationDisplayHandler.ERROR, handler.getSeverity());
    }
View Full Code Here

        assertEquals(ValidationDisplayHandler.ERROR, handler.getSeverity());
    }

    public void testDomain() throws Exception {
        ValidationInfo info =
            new ValidationInfo(ValidationDisplayHandler.ERROR, null, null);
        ValidationDisplayHandler handler = new ConcreteErrorMsg(info);

        DataDomain dom = new DataDomain("test");
        assertNull(handler.getDomain());
        handler.setDomain(dom);
View Full Code Here

TOP

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

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.