Package org.eclipse.jdt.internal.ui.dialogs

Examples of org.eclipse.jdt.internal.ui.dialogs.StatusInfo


        /*
         * @see ISelectionValidator#validate(Object[])
         */
        public IStatus validate(Object[] selection) {
            String message= ""; //$NON-NLS-1$
            return new StatusInfo(IStatus.INFO, message);
        }
View Full Code Here


    this.fComponentContainerDialogField = new StringButtonDialogField(componentContainerAdaptor);
    this.fComponentContainerDialogField.setDialogFieldListener(componentContainerAdaptor);
    this.fComponentContainerDialogField.setLabelText(getComponentContainerLabel());
    this.fComponentContainerDialogField.setButtonLabel(NewWizardMessages.NewContainerWizardPage_container_button);
   
    this.fComponentContainerStatus = new StatusInfo();
    this.fComponentHTMLStatus = new StatusInfo();
    this.fComponentWODStatus = new StatusInfo();
    this.fComponentWOOStatus = new StatusInfo();
    this.fComponentAPIStatus = new StatusInfo();
   
    this.componentImageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin("org.objectstyle.wolips.wizards", "icons/wobuilder/WOComponentBundle.png");
   
    this.vComponentAPIEnabled = true;
    this.vComponentContainerRoot = null;
View Full Code Here

      }
        }
  }
 
  protected IStatus componentContainerChanged() {
    StatusInfo status = new StatusInfo();
   
    //fComponentContainerRoot = null;
    String str = getComponentContainerRootText();
    if (str.length() == 0) {
      status.setError(NewWizardMessages.NewContainerWizardPage_error_EnterContainerName);
      return status;
    }
    else if (str.endsWith(".wo")) {
      status.setError("A component cannot be created within another component");
      return status;
    }
   
    IPath path = new Path(str);
    IResource res = getWorkspaceRoot().findMember(path);
    if (res != null) {
      int resType = res.getType();
      if (resType == IResource.PROJECT || resType == IResource.FOLDER) {
        IProject proj = res.getProject();
        if (!proj.isOpen()) {
          status.setError(Messages.format(NewWizardMessages.NewContainerWizardPage_error_ProjectClosed, BasicElementLabels.getPathLabel(proj.getFullPath(), false)));
          return status;
        }
        IJavaProject jproject = JavaCore.create(proj);
       
        IPackageFragmentRoot fragmentRoot = jproject.getPackageFragmentRoot(res);
        if (res.exists()) {
          try {
            if (!proj.hasNature(JavaCore.NATURE_ID)) {
              if (resType == IResource.PROJECT) {
                status.setError(NewWizardMessages.NewContainerWizardPage_warning_NotAJavaProject);
              } else {
                status.setWarning(NewWizardMessages.NewContainerWizardPage_warning_NotInAJavaProject);
              }
              return status;
            }
            if (fragmentRoot.isArchive()) {
              status.setError(Messages.format(NewWizardMessages.NewContainerWizardPage_error_ContainerIsBinary, BasicElementLabels.getPathLabel(path, false)));
              return status;
            }
            // now throws a JavaModelException if not a source folder
            if (fragmentRoot.getKind() == IPackageFragmentRoot.K_BINARY) {
              status.setWarning(Messages.format(NewWizardMessages.NewContainerWizardPage_warning_inside_classfolder, BasicElementLabels.getPathLabel(path, false)));
            } else if (!jproject.isOnClasspath(fragmentRoot)) {
              status.setWarning(Messages.format(NewWizardMessages.NewContainerWizardPage_warning_NotOnClassPath, BasicElementLabels.getPathLabel(path, false)));
            }
          } catch (JavaModelException e) {
            // no problems. Just a standard components folder.
           
          } catch (CoreException e) {
            System.err.println(getClass().getName() + ".componentContainerChanged threw an exception.");
            e.printStackTrace(System.err);
            status.setWarning(NewWizardMessages.NewContainerWizardPage_warning_NotAJavaProject);
          }
        }
        return status;
      }
      status.setError(Messages.format(NewWizardMessages.NewContainerWizardPage_error_NotAFolder, BasicElementLabels.getPathLabel(path, false)));
      return status;
    }
    status.setError(Messages.format(NewWizardMessages.NewContainerWizardPage_error_ContainerDoesNotExist, BasicElementLabels.getPathLabel(path, false)));
    return status;
    }
View Full Code Here

    }
  }

  @Override
  protected IStatus superClassChanged() {
    StatusInfo superclassStatus = new StatusInfo();
    if (!DEFAULT_SUPERCLASS_NAME.equals(getSuperClass())) {
      if (getSuperClass() == null || getSuperClass().matches("\\s*")) {
        superclassStatus.setError("The super type must be assignable to " + DEFAULT_SUPERCLASS_NAME);
      }
      else if (getDefaultWOComponentType() == null) {
        superclassStatus.setError(DEFAULT_SUPERCLASS_NAME + " is not on the classpath");
      }
      else {
        try {
          IType type = getJavaProject().findType(getSuperClass());
          ITypeHierarchy typeHierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
          if (!JavaModelUtil.isSuperType(typeHierarchy, getDefaultWOComponentType(), type)) {
            superclassStatus.setError("The super type must be assignable to " + DEFAULT_SUPERCLASS_NAME);
          }
        } catch (JavaModelException e) {
          System.err.println(getClass().getName() + ".superClassChanged() Failed to determine superclass hierarchy.");
          e.printStackTrace(System.err);
          superclassStatus.setWarning("Unable to determine superclass hierarchy");
        }
      }
    }
    if (!superclassStatus.isError()) {
      IStatus status = super.superClassChanged();
      if (!superclassStatus.isWarning() && status.getSeverity() == (IStatus.ERROR | IStatus.WARNING)) {
        return status;
      }
    }
    return superclassStatus;
  }
View Full Code Here

    IStatus typeNameStatus = super.typeNameChanged();
   
    if (typeNameStatus.getSeverity() != IStatus.ERROR && getTypeName() != null && !getTypeName().matches("\\s*")) {
      if (getComponentContainer() == null) {
        if (typeNameStatus.getSeverity() != IStatus.WARNING) {
          typeNameStatus = new StatusInfo(IStatus.WARNING, "The component source folder is required");
        }
      }
      else {
        String componentName = getTypeName() + ".wo";
        try {
          for (IResource member : getComponentContainer().members()) {
            if (member.getName().equalsIgnoreCase(componentName)) {
              String typeName = "component";
              if (member.getType() == IResource.FILE) {
                typeName = "file";
              }
              typeNameStatus = new StatusInfo(IStatus.ERROR, "The component name matches an existing " + typeName);
            }
          }
        } catch (CoreException e) {
          System.err.println(getClass().getName() + ".typeNameChanged() failed to iterate members");
          e.printStackTrace(System.err);
View Full Code Here

  private void selectProject(){
    IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
   
    // required validator
    ISelectionStatusValidator validator = new ISelectionStatusValidator(){
      private IStatus fgErrorStatus= new StatusInfo(IStatus.ERROR, ""); //$NON-NLS-1$
      private IStatus fgOKStatus= new StatusInfo();
     
      public IStatus validate(Object[] selection){
        if(selection==null || selection.length != 1){
          return fgErrorStatus;
        }
View Full Code Here

 
  protected void updateOKStatus() {
    computeResult();

    if(null != getResult()) {
      updateStatus(new StatusInfo());
    } else {
      updateStatus(new StatusInfo(IStatus.ERROR, "")); //$NON-NLS-1$
    }
  }
View Full Code Here

  protected void updateOKStatus() {
    computeResult();

    if(null != getResult()) {
      updateStatus(new StatusInfo());
    } else {
      updateStatus(new StatusInfo(IStatus.ERROR, "")); //$NON-NLS-1$
    }
  }
View Full Code Here

  private Map fData; // page data

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

  public ProjectAndPreferencePage() {
    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

TOP

Related Classes of org.eclipse.jdt.internal.ui.dialogs.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.