Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IStatus.matches()


    spinner.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        int index= spinner.getSelection();
        EnumValue value= domain.getValueByInteger(index);
        IStatus status= domain.validate(value);
        if (!status.matches(IStatus.ERROR))
          fOverlayStore.setValue(preference.getKey(), value.getIntValue());
        updateStatus(status);
      }
    });
View Full Code Here


    if (domain != null) {
      textControl.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
          String value= textControl.getText();
          IStatus status= domain.validate(value);
          if (!status.matches(IStatus.ERROR))
            fOverlayStore.setValue(preference.getKey(), value);
          updateStatus(domain);
        }
      });
    }
View Full Code Here

 
  private boolean updateStatusOnError(Domain domain) {
    Text textWidget= (Text)fDomains.get(domain);
    if (textWidget.isEnabled()) {
      IStatus status= domain.validate(textWidget.getText());
      if (status.matches(IStatus.ERROR)) {
        updateStatus(status);
        return true;
      }
    }
    return false;
View Full Code Here

   */
  public static IStatus getMostSevere(IStatus[] status) {
    IStatus max= null;
    for (int i= 0; i < status.length; i++) {
      IStatus curr= status[i];
      if (curr.matches(IStatus.ERROR)) {
        return curr;
      }
      if (max == null || curr.getSeverity() > max.getSeverity()) {
        max= curr;
      }
View Full Code Here

    checkBox.setLayoutData(gd);
    checkBox.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        boolean value= checkBox.getSelection();
        IStatus status= domain.validate(Boolean.valueOf(value));
        if (!status.matches(IStatus.ERROR))
          fOverlayStore.setValue(preference.getKey(), value);
        updateStatus(status);
      }
    });
View Full Code Here

  }

  void numberFieldChanged(Text textControl) {
    String number = textControl.getText();
    IStatus status = validatePositiveNumber(number);
    if (!status.matches(IStatus.ERROR))
      fOverlayStore.setValue((String) fTextFields.get(textControl), number);
    updateStatus(status);
  }

  /**
 
View Full Code Here

    {
      IJavaProject javaProject = m_object.getContext().getJavaProject();
      String sourceLevel = javaProject.getOption(JavaCore.COMPILER_SOURCE, true);
      String complianceLevel = javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
      IStatus status = JavaConventions.validateFieldName(name, sourceLevel, complianceLevel);
      if (status.matches(IStatus.ERROR)) {
        return status.getMessage();
      }
    }
    // check that name is unique
    {
View Full Code Here

    }

    protected void numberFieldChanged(Text textControl) {
        String number = textControl.getText();
        IStatus status = validatePositiveNumber(number);
        if (!status.matches(IStatus.ERROR))
            fOverlayStore.setValue((String) fTextFields.get(textControl), number);
        updateStatus(status);
    }

    protected IStatus validatePositiveNumber(String number) {
View Full Code Here

     * @see org.eclipse.search.ui.IReplacePage#performReplace()
     */
    public boolean performReplace() {
        try {
            IStatus status = NewSearchUI.runQueryInForeground(getContainer().getRunnableContext(), newQuery());
            if (status.matches(IStatus.CANCEL)) {
                return false;
            }
            if (!status.isOK()) {
                ErrorDialog.openError(getShell(), SearchMessages.TextSearchPage_replace_searchproblems_title,
                        SearchMessages.TextSearchPage_replace_runproblem_message, status);
View Full Code Here

      // }
    }
    IStatus status = op.getStatus();
    if (!status.isOK()) {
      ErrorDialog.openError(getShell(), "", null, status); //$NON-NLS-1$
      return !(status.matches(IStatus.ERROR));
    }
    return true;
  }

  public void addPages() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.