Package org.netbeans.modules.php.nette.validators

Examples of org.netbeans.modules.php.nette.validators.Validable


  public void changedUpdate(DocumentEvent e) {
    doEnablement();
  }

  private void doEnablement() {
    Validable classNameValidator = new NetteClassNameValidator();
    Validable componentNameValidator = new NetteComponentNameValidator();

    if (isFormTabSelected()) {
      if (!classNameValidator.validate(getFormClass())) {
        errorLabel.setIcon(errorIcon);
        setWarningText(NbBundle.getMessage(CreateComponentGeneratorPanel.class, "ERR_head_form_class"));
       
        dd.setValid(false);
      } else if (!componentNameValidator.validate(getFormName())) {
        errorLabel.setIcon(errorIcon);
        setWarningText(NbBundle.getMessage(CreateComponentGeneratorPanel.class, "ERR_head_form_name"));

        dd.setValid(false);
      } else {
        errorLabel.setIcon(null);
        errorLabel.setText("");

        dd.setValid(true);
      }
    } else {
      if (!classNameValidator.validate(getComponentClass())) {
        errorLabel.setIcon(errorIcon);
        setWarningText(NbBundle.getMessage(CreateComponentGeneratorPanel.class, "ERR_head_component_class"));

        dd.setValid(false);
      } else if (!componentNameValidator.validate(getComponentName())) {
        errorLabel.setIcon(errorIcon);
        setWarningText(NbBundle.getMessage(CreateComponentGeneratorPanel.class, "ERR_head_component_name"));

        dd.setValid(false);
      } else {
View Full Code Here


    changeSupport.removeChangeListener(cl);
  }

  public String getErrorMessage() {
    if (copyNetteCheckbox.isSelected()) {
      Validable emptyPathValidator = new NetteEmptyPathValidator();

      if (emptyPathValidator.validate(NetteOptions.getInstance().getNetteFile())) {
        return NbBundle.getMessage(NewNetteProjectPanel.class, "ERR_no_nette_file");
      }

      Validable loaderPathValidator = new NetteLoaderExistsValidator();

      if (!loaderPathValidator.validate(NetteOptions.getInstance().getNetteFile())) {
        return NbBundle.getMessage(NewNetteProjectPanel.class, "ERR_nette_file_not_exists");
      }
    }

    return null;
View Full Code Here

    NetteOptions.getInstance().setNetteFile(netteFileTextField.getText());
    NetteOptions.getInstance().setSandboxPath(sandboxPathTextField.getText());
  }

  boolean valid() {
    Validable sandboxPathValidator = new SandboxPathValidator();

    if (!isNetteFileValid()) {
      errorLabel.setIcon(errorIcon);
      errorLabel.setText(NbBundle.getMessage(NettePanel.class, "ERR_invalid_nette_file"));

      return false;
    } else if (!sandboxPathValidator.validate(sandboxPathTextField.getText())) {
      errorLabel.setIcon(errorIcon);
      errorLabel.setText(NbBundle.getMessage(NettePanel.class, "ERR_invalid_sandbox_folder"));

      return false;
    } else {
View Full Code Here

      return true;
    }
  }

  private boolean isNetteFileValid() {
    Validable loaderExistsValidator = new NetteLoaderExistsValidator();
    Validable emptyPathValidator = new NetteEmptyPathValidator();

    return loaderExistsValidator.validate(netteFileTextField.getText()) || emptyPathValidator.validate(netteFileTextField.getText());
  }
View Full Code Here

      createDefaultDirectoryStructure();
    }
  }

  private boolean isValidSandboxPath() {
    Validable sandboxPathValidator = new SandboxPathValidator();
    String sandboxPath = NetteOptions.getInstance().getSandboxPath();

    return sandboxPathValidator.validate(sandboxPath) && !sandboxPath.trim().isEmpty();
  }
View Full Code Here

TOP

Related Classes of org.netbeans.modules.php.nette.validators.Validable

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.