Package org.eclipse.core.runtime

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


     */
    @Override
    protected IStatus containerChanged() {
        IStatus status = super.containerChanged();
        IPackageFragmentRoot root = getPackageFragmentRoot();
        if ((fTypeKind == ANNOTATION_TYPE || fTypeKind == ENUM_TYPE) && !status.matches(IStatus.ERROR)) {
            if (root != null && !JavaModelUtil.is50OrHigher(root.getJavaProject())) {
                // error as createType will fail otherwise (bug 96928)
                return new StatusInfo(IStatus.ERROR, Messages.format(NewWizardMessages.NewTypeWizardPage_warning_NotJDKCompliant, BasicElementLabels.getJavaElementName(root.getJavaProject().getElementName())));
            }
            if (fTypeKind == ENUM_TYPE) {
View Full Code Here


            return status;
        }

        IJavaProject project = root.getJavaProject();

        if ((fTypeKind == ANNOTATION_TYPE || fTypeKind == ENUM_TYPE) && !status.matches(IStatus.ERROR)) {
            if (!JavaModelUtil.is50OrHigher(project)) {
                // error as createType will fail otherwise (bug 96928)
                return new StatusInfo(IStatus.ERROR, Messages.format(NewWizardMessages.NewTypeWizardPage_warning_NotJDKCompliant, BasicElementLabels.getJavaElementName(project.getElementName())));
            }
            if (fTypeKind == ENUM_TYPE) {
View Full Code Here

  }

  private 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);
  }

  private IStatus validatePositiveNumber(String number) {
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

      NewSearchUI.runQueryInBackground(query);
    } else {
      IWorkbench _workbench = PlatformUI.getWorkbench();
      final IProgressService progressService = _workbench.getProgressService();
      final IStatus status = NewSearchUI.runQueryInForeground(progressService, query);
      boolean _matches = status.matches(((IStatus.ERROR + IStatus.INFO) + IStatus.WARNING));
      if (_matches) {
        ErrorDialog.openError(shell, "Search",
          ("Problems occurred while searching. " + "The affected files will be skipped."), status);
      }
    }
View Full Code Here

        updateStatus(status);
    }

    protected void updateStatus(final IStatus status0) {
        IStatus status = status0;
        if (!status.matches(IStatus.ERROR)) {
            for (final Text text : fNumberFields) {
                final IStatus s = validatePositiveNumber(text.getText());
                status = s.getSeverity() > status.getSeverity() ? s : status;
            }
        }
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

       * of the Search plug-in: the Interpreter verifies the method call and hence loads the
       * types used in the method signature, eventually triggering the loading of
       * a plug-in (in this case it would be ISearchQuery).
       */
      IStatus status= NewSearchUI.runQueryInForeground(progressService, (ISearchQuery)query);
      if (status.matches(IStatus.ERROR | IStatus.INFO | IStatus.WARNING)) {
        ErrorDialog.openError(getShell(), SearchMessages.Search_Error_search_title, SearchMessages.Search_Error_search_message, status);
      }
    }
  }

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

    combo.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        int index= combo.getSelectionIndex();
        EnumValue value= domain.getValueByIndex(index);
        IStatus status= domain.validate(value);
        if (!status.matches(IStatus.ERROR))
          fOverlayStore.setValue(preference.getKey(), value.getIntValue());
        updateStatus(status);
      }
    });
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.