Examples of TypedElementSelectionValidator


Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

        dialog.setSorter(new FileViewerSorter());
        //dialog.setInput(project);
        if(multiple) {
            dialog.setMessage("Select resources. Press CTRL or SHIFT" +
                    " to select multiple resources.");
            dialog.setValidator(new TypedElementSelectionValidator(
                    new Class[]{IFile.class, IFolder.class}, true));
            if(dialog.open() == Window.OK) {
                Object[] results = dialog.getResult();
                StringBuffer ret = new StringBuffer();
                if (results != null) {
                    for (int i = 0; i < results.length; i++) {
                        IResource rc = (IResource)results[i];
                        ret.append(rc.getFullPath().removeFirstSegments(1));
                        ret.append(";");
                    }
                    return ret.toString();
                   
                }
            }
        } else {
            dialog.setMessage("Select a .class file");
            dialog.setValidator(new TypedElementSelectionValidator(
                    new Class[]{IFile.class}, false));
            if(dialog.open() == Window.OK) {
                IResource rc = (IResource)dialog.getFirstResult();
                if (rc != null)
                    return rc.getFullPath().removeFirstSegments(1).toString();
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

                            new FileTreeContentProvider(true));
            dialog.setAllowMultiple(false);
            dialog.setTitle("MuClipse");
            dialog.setMessage("Select a folder");
            dialog.setInput(project);
            dialog.setValidator(new TypedElementSelectionValidator(
                    new Class[]{IFolder.class}, false));
            if(dialog.open() == Window.OK) {
                IResource rc = (IResource)dialog.getFirstResult();
                if (rc != null)
                    return rc.getFullPath().removeFirstSegments(1).toString();
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

        dialog.setSorter(new FileViewerSorter());
        //dialog.setInput(project);
        if(multiple) {
            dialog.setMessage("Select resources. Press CTRL or SHIFT" +
                    " to select multiple resources.");
            dialog.setValidator(new TypedElementSelectionValidator(
                    new Class[]{IFile.class, IFolder.class}, true));
            if(dialog.open() == Window.OK) {
                Object[] results = dialog.getResult();
                StringBuffer ret = new StringBuffer();
                if (results != null) {
                    for (int i = 0; i < results.length; i++) {
                        IResource rc = (IResource)results[i];
                        ret.append(rc.getFullPath().removeFirstSegments(1));
                        ret.append(";");
                    }
                    return ret.toString();
                   
                }
            }
        } else {
            dialog.setMessage("Select a .class file");
            dialog.setValidator(new TypedElementSelectionValidator(
                    new Class[]{IFile.class}, false));
            if(dialog.open() == Window.OK) {
                IResource rc = (IResource)dialog.getFirstResult();
                if (rc != null)
                    return rc.getFullPath().removeFirstSegments(1).toString();
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

                            new FileTreeContentProvider(false));
            dialog.setAllowMultiple(true);
            dialog.setTitle("MuClipse");
            dialog.setMessage("Select a java class");
            dialog.setInput(input);
            dialog.setValidator(new TypedElementSelectionValidator(
                    new Class[]{IFile.class}, true));
            if(dialog.open() == Window.OK) {
                Object[] rc = dialog.getResult();
                String toReturn = "";
                for (int i=0;i<rc.length;i++)
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

                            new FileTreeContentProvider(true));
            dialog.setAllowMultiple(false);
            dialog.setTitle("MuClipse");
            dialog.setMessage("Select a folder");
            dialog.setInput(project);
            dialog.setValidator(new TypedElementSelectionValidator(
                    new Class[]{IFolder.class}, false));
            if(dialog.open() == Window.OK) {
                IResource rc = (IResource)dialog.getFirstResult();
                if (rc != null)
                    return rc.getFullPath().removeFirstSegments(1).toString();
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

  private IFolder chooseComponentContainer(String title, String message, IPath initialPath) {
    //System.out.println("building choose componentContainer for " + initialPath.getDevice() + ":" + initialPath.getFileExtension());
    Class acceptedClasses[] = {
        IProject.class, IPackageFragmentRoot.class, IFolder.class
    };
    org.eclipse.ui.dialogs.ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false) {

      /**
       * @see org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator#isSelectedValid(java.lang.Object)
       */
      @Override
 
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

      IResource init = null;
      if (params.getRoot() != null) {
        init = wsroot.findMember(currProject.getName() + params.getRoot());
      }
      Class[] acceptedClasses = new Class[] { IProject.class, IFolder.class };
      ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false);
      IProject[] allProjects = wsroot.getProjects();
      ArrayList<IProject> rejectedElements = new ArrayList<IProject>(allProjects.length);
      for (int i = 0; i < allProjects.length; i++) {
        if (!allProjects[i].equals(currProject)) {
          rejectedElements.add(allProjects[i]);
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

        if(!init.exists()){
          init = null;
        }
      }
      Class[] acceptedClasses = new Class[] { IProject.class, IFolder.class };
      ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false);
      IProject[] allProjects = wsroot.getProjects();
      ArrayList rejectedElements = new ArrayList(allProjects.length);
      for (int i = 0; i < allProjects.length; i++) {
        if (!allProjects[i].equals(currProject)) {
          rejectedElements.add(allProjects[i]);
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

  }
 
  private void selectSourceFolder() {
    try {
      Class[] acceptedClasses = new Class[] { IJavaModel.class, IJavaProject.class, IPackageFragmentRoot.class };
      ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false);
     
      IPackageFragmentRoot init = null;
      IJavaProject project = JavaCore.create(getProject());
     
      IPackageFragmentRoot[] roots = project.getPackageFragmentRoots();
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

  }
 
  private IPackageFragmentRoot choosePackageRoot() {
    IJavaElement initElement= clazz.getFragmentRoot();
    Class<?>[] acceptedClasses= new Class<?>[] { IPackageFragmentRoot.class, IJavaProject.class };
    TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false) {
      public boolean isSelectedValid(Object element) {
        try {
          if (element instanceof IJavaProject) {
            IJavaProject jproject= (IJavaProject)element;
            IPath path= jproject.getProject().getFullPath();
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.