Package org.netbeans.modules.php.api.validation

Examples of org.netbeans.modules.php.api.validation.ValidationResult


    @Override
    public String getErrorMessage() {
        if (getPanel().isSupportEnabled()) {
            // validate
            ValidationResult validationResult = new CustomizerValidator(phpModule)
                    .validate(getPanel().getAppDirectory())
                    .getResult();

            if (validationResult.hasErrors()) {
                return validationResult.getErrors().get(0).getMessage();
            }
        }

        return null;
    }
View Full Code Here


    public CustomizerValidator(PhpModule phpModule) {
        this.phpModule = phpModule;
    }

    public ValidationResult getResult() {
        return new ValidationResult(result);
    }
View Full Code Here

        init();
        initListeners();
    }

    public String getErrorMessage() {
        ValidationResult validationResult = new OptionsValidator()
                .validate(Laravel4Options.getInstance().getSkeleton())
                .getResult();

        if (validationResult.hasErrors()) {
            return validationResult.getErrors().get(0).getMessage();
        }

        return null;
    }
View Full Code Here

        return null;
    }

    public String getWarningMessage() {
        ValidationResult validationResult = new OptionsValidator()
                .validate(Laravel4Options.getInstance().getSkeleton())
                .getResult();

        if (validationResult.hasWarnings()) {
            return validationResult.getWarnings().get(0).getMessage();
        }

        return null;
    }
View Full Code Here

public class OptionsValidator {

    private final ValidationResult result = new ValidationResult();
   
    public ValidationResult getResult() {
        return new ValidationResult(result);
    }
View Full Code Here

    public boolean isValid() {
        // clean up
        panel.setError(" "); // NOI18N

        // validate
        ValidationResult validationResult = new OptionsValidator()
                .validate(panel.getSkeleton())
                .getResult();
        String warning = null;
        // get first message
        if (validationResult.hasErrors()) {
            for (ValidationResult.Message message : validationResult.getErrors()) {
                warning = message.getMessage();
                break;
            }
        } else if (validationResult.hasWarnings()) {
            for (ValidationResult.Message message : validationResult.getWarnings()) {
                warning = message.getMessage();
                break;
            }
        }
       
View Full Code Here

        sourceDirectory.createData("test.php");

        // existing directory
        YiiCustomizerValidator validator = new YiiCustomizerValidator()
                .validateDirectory(sourceDirectory, "myfolder");
        ValidationResult result = validator.getResult();
        assertFalse(result.hasErrors());
        assertFalse(result.hasWarnings());

        // not existing directory
        validator = new YiiCustomizerValidator()
                .validateDirectory(sourceDirectory, "dummy");
        result = validator.getResult();
        assertFalse(result.hasErrors());
        assertTrue(result.hasWarnings());

        // file
        validator = new YiiCustomizerValidator()
                .validateDirectory(sourceDirectory, "test.php");
        result = validator.getResult();
        assertFalse(result.hasErrors());
        assertTrue(result.hasWarnings());
    }
View Full Code Here

                .validateDirectory(sourceDirectory, panel.getExtPath())
                .validateDirectory(sourceDirectory, panel.getControllersPath())
                .validateDirectory(sourceDirectory, panel.getViewsPath())
                .validateDirectory(sourceDirectory, panel.getThemesPath())
                .validateDirectory(sourceDirectory, panel.getMessagesPath());
        ValidationResult result = validator.getResult();
        if (result.hasWarnings()) {
            isValid = false;
            errorMessage = result.getWarnings().get(0).getMessage();
            return;
        }

        // no problem
        isValid = true;
View Full Code Here

        }

        FuelPhpCustomizerValidator validator = new FuelPhpCustomizerValidator()
                .validateOilPath(sourceDirectory)
                .validateFuelDirectoryName(sourceDirectory, customizerPanel.getFuelName());
        ValidationResult result = validator.getResult();
        if (result.hasWarnings()) {
            isValid = false;
            errorMessage = result.getWarnings().get(0).getMessage();
            return;
        }

        // no problem
        isValid = true;
View Full Code Here

            String fuelName = FuelPhpPreferences.getFuelName(phpModule);
            if (sourceDirectory != null) {
                FuelPhpCustomizerValidator validator = new FuelPhpCustomizerValidator()
                        .validateFuelDirectoryName(sourceDirectory, fuelName)
                        .validateOilPath(sourceDirectory);
                ValidationResult result = validator.getResult();
                if (result.hasWarnings()) {
                    return;
                }

                // show notification displayer
                if (!FuelPhpPreferences.isEnabled(phpModule)) {
View Full Code Here

TOP

Related Classes of org.netbeans.modules.php.api.validation.ValidationResult

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.