Package org.eclipse.jdt.internal.ui.wizards

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();
      List<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


  }

  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

      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 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

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

                            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

                            new FileTreeContentProvider(true));
            dialog.setAllowMultiple(false);
            dialog.setTitle("MuClipse");
            dialog.setMessage("Select a mutated class");
            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(2).toString();
View Full Code Here

        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

                            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

        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

                            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

TOP

Related Classes of org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator

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.