Package org.eclipse.php.internal.ui.util

Examples of org.eclipse.php.internal.ui.util.StatusInfo


    applyDialogFont(composite);
    return composite;
  }

  private void doValidation() {
    StatusInfo status = new StatusInfo();

    String newName = fNameDialogField.getText();
    String newPath = fPathDialogField.getText();

    if (newPath.length() == 0) {
      status.setError("Enter PEAR path.");
    }

    if (newName.length() == 0 && newPath.length() > 0) {
      int lastIndex = WINDOWS ? newPath.lastIndexOf("\\") : newPath.lastIndexOf("/");
      if (lastIndex > 0) {
        newName = newPath.substring(lastIndex + 1).replace(' ', '_');
        fNameDialogField.setText(newName);
      }
    }

    if (newName.length() == 0) {
      status.setError("Enter library name.");
    } else {
      if (!Pattern.matches("^[a-zA-Z0-9_]+$", newName)) {
        status.setError("Name can only contain letters, numbers and underscores");
      } else if (fExistingNames.contains(newName)) {
        status.setError("An entry with the same name already exists");
      }
    }

    updateStatus(status);
  }
View Full Code Here


  @Override
  protected void validateSettings(Key changedKey, String oldValue,
      String newValue) {

    StatusInfo status = new StatusInfo();

    if (phpExes.getAllItems().length == 0) {
      status = new StatusInfo(StatusInfo.WARNING,
          "No PHP executable configured. Dependencies cannot be managed properly.");
    }

    if (buttonGroup != null && buttonGroup.isSelected(1)) {
      if (!validateScript(scriptField.getText())) {
        status = new StatusInfo(StatusInfo.WARNING,
            "The selected file is not a valid php script/archive.");
      }
    }

    fContext.statusChanged(status);
View Full Code Here

  }

  private void doSelectionChanged() {
    boolean isValidSelection = true;
    boolean canExtend = false;
    StatusInfo status = new StatusInfo();

    List selected = fVariablesList.getSelectedElements();
    int nSelected = selected.size();

    if (nSelected > 0) {
      fResultPaths = new Path[nSelected];
      for (int i = 0; i < nSelected; i++) {
        BPVariableElement curr = (BPVariableElement) selected.get(i);
        fResultPaths[i] = new Path(curr.getName());
        File file = curr.getPath().toFile();
        if (!file.exists()) {
          status.setError(NewWizardMessages.NewVariableEntryDialog_info_notexists);
          isValidSelection = false;
          break;
        }
        if (file.isDirectory()) {
          canExtend = true;
        }
      }
    } else {
      isValidSelection = false;
      status.setInfo(NewWizardMessages.NewVariableEntryDialog_info_noselection);
    }
    if (isValidSelection && nSelected > 1) {
      String str = Messages.format(
          NewWizardMessages.NewVariableEntryDialog_info_selected,
          String.valueOf(nSelected));
      status.setInfo(str);
    }
    // TODO now disable Extend button
    fCanExtend = nSelected == 1 && canExtend;
    fVariablesList.enableButton(0, fCanExtend);
View Full Code Here

            new String[] { type.getId(), type.getName(), "" }); //$NON-NLS-1$
    }
    fContextTypes = (String[][]) contexts.toArray(new String[contexts
        .size()][]);

    fValidationStatus = new StatusInfo();

    fContextTypeRegistry = registry;

    TemplateContextType type = fContextTypeRegistry.getContextType(template
        .getContextTypeId());
View Full Code Here

        getContextId(), getPattern(), isAutoInsertable);
    super.okPressed();
  }

  private void updateStatusAndButtons() {
    StatusInfo status = fValidationStatus;
    boolean isEmpty = fNameText != null
        && fNameText.getText().length() == 0;
    if (!fSuppressError && isEmpty) {
      status = new StatusInfo();
      status
          .setError(PreferencesMessages.EditTemplateDialog_error_noname);
    } else if (fNameText != null
        && !isValidTemplateName(fNameText.getText())) {
      status = new StatusInfo();
      status
          .setError(PreferencesMessages.EditTemplateDialog_error_invalidName);
    }
    updateStatus(status);
  }
View Full Code Here

  public NewVariableEntryDialog(Shell parent, IEnvironment environment) {
    super(parent);
    setTitle(NewWizardMessages.NewVariableEntryDialog_title);
    this.environment = environment;
    updateStatus(new StatusInfo(IStatus.ERROR, "")); //$NON-NLS-1$

    String[] buttonLabels = new String[] { NewWizardMessages.NewVariableEntryDialog_vars_extend, };

    VariablesAdapter adapter = new VariablesAdapter();
View Full Code Here

    }
    fContext.statusChanged(fTaskTagsStatus);
  }

  private IStatus validatePHPVersion() {
    return new StatusInfo();
  }
View Full Code Here

  private Map fData; // page data

  public static final String DATA_NO_LINK = "PropertyAndPreferencePage.nolink"; //$NON-NLS-1$

  public PropertyAndPreferencePage() {
    fBlockStatus = new StatusInfo();
    fBlockEnableState = null;
    fProject = null;
    fData = null;
  }
View Full Code Here

  protected void doStatusChanged() {
    if (!isProjectPreferencePage() || useProjectSettings()) {
      updateStatus(fBlockStatus);
    } else {
      updateStatus(new StatusInfo());
    }
  }
View Full Code Here

    fBinFolderNameLabel.setEnabled(useFolders);
    if (useFolders) {
      String srcName = fSrcFolderNameText.getText();
      String binName = fBinFolderNameText.getText();
      if (srcName.length() + binName.length() == 0) {
        updateStatus(new StatusInfo(
            IStatus.ERROR,
            PreferencesMessages.NewPHPProjectPreferencePage_folders_error_namesempty));
        return;
      }
      IWorkspace workspace = PHPUiPlugin.getWorkspace();
      IProject dmy = workspace.getRoot().getProject("project"); //$NON-NLS-1$

      IStatus status;
      IPath srcPath = dmy.getFullPath().append(srcName);
      if (srcName.length() != 0) {
        status = workspace.validatePath(srcPath.toString(),
            IResource.FOLDER);
        if (!status.isOK()) {
          String message = Messages
              .format(
                  PreferencesMessages.NewPHPProjectPreferencePage_folders_error_invalidsrcname,
                  status.getMessage());
          updateStatus(new StatusInfo(IStatus.ERROR, message));
          return;
        }
      }
      IPath binPath = dmy.getFullPath().append(binName);
      if (binName.length() != 0) {
        status = workspace.validatePath(binPath.toString(),
            IResource.FOLDER);
        if (!status.isOK()) {
          String message = Messages
              .format(
                  PreferencesMessages.NewPHPProjectPreferencePage_folders_error_invalidbinname,
                  status.getMessage());
          updateStatus(new StatusInfo(IStatus.ERROR, message));
          return;
        }
      }
      // IClasspathEntry entry= JavaCore.newSourceEntry(srcPath);
      // status= JavaConventions.validateClasspath(JavaCore.create(dmy),
      // new IClasspathEntry[] { entry }, binPath);
      // if (!status.isOK()) {
      // String message=
      // PreferencesMessages.NewJavaProjectPreferencePage_folders_error_invalidcp;
      // updateStatus(new StatusInfo(IStatus.ERROR, message));
      // return;
      // }
    }
    updateStatus(new StatusInfo()); // set to OK
  }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.ui.util.StatusInfo

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.