Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.SelectionDialog


    try {
      IResource sourceContainer = ResourcesPlugin.getWorkspace().getRoot().findMember(
          new Path(getSourceFolder()));
      IJavaProject javaProject = JDTUtil.getJavaProject(sourceContainer.getProject().getName());
     
      SelectionDialog dialog = JavaUI.createPackageDialog(dialogParrentShell, javaProject, 0);
      dialog.setTitle("Package selection");
      dialog.setMessage("&Choose a package:");
     
      if (dialog.open() == SelectionDialog.OK) {
        Object[] selectedPackages = dialog.getResult();
        if (selectedPackages.length == 1) {
          m_packageNameText.setText(((IPackageFragment) selectedPackages[0]).getElementName());
        }
      }
    } catch (JavaModelException e) {
View Full Code Here


   * Package access for callbacks.
   * @param testngType - one of TestNGLaunchConfigurationConstants
   */
  void handleSearchButtonSelected(LaunchType testngType) {
    Object[] types = new Object[0];
    SelectionDialog dialog = null;

    IJavaProject selectedProject = getSelectedProject();
    if (selectedProject == null) {
      MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
          "No project", "Please select a project");
      return;
    }

    try {
      switch(testngType) {
        case CLASS:
          types = TestSearchEngine.findTests(getLaunchConfigurationDialog(),
              new Object[] {m_selectedProject}, Filters.SINGLE_TEST);
          dialog = TestSelectionDialog.createTestTypeSelectionDialog(getShell(), m_selectedProject,
              types, Filters.SINGLE_TEST);
          break;
        case METHOD:
          types = TestSearchEngine.findMethods(getLaunchConfigurationDialog(),
              new Object[] {m_selectedProject}, m_classSelector.getText());
          dialog = TestSelectionDialog.createMethodSelectionDialog(getShell(), m_selectedProject,
              types);
          break;
        case PACKAGE:
          types = TestSearchEngine.findPackages(getLaunchConfigurationDialog(),
              new Object[] {m_selectedProject});
          dialog = TestSelectionDialog.createPackageSelectionDialog(getShell(), m_selectedProject,
              types);
          break;
        default:
          throw new IllegalArgumentException(UNKNOWN_CONSTANT + testngType);
      }
    }
    catch(InterruptedException e) {
      TestNGPlugin.log(e);
    }
    catch(InvocationTargetException e) {
      TestNGPlugin.log(e.getTargetException());
    }
    dialog.setBlockOnOpen(true);
    dialog.setTitle(ResourceUtil.getString("TestNGMainTab.testdialog.title")); //$NON-NLS-1$
    if(dialog.open() == Window.CANCEL) {
      return;
    }

    Object[] results = dialog.getResult();
    if((results == null) || (results.length < 1)) {
      return;
    }
    Object type = results[0];

View Full Code Here

      }
      else {
        scope = IJavaElementSearchConstants.CONSIDER_CLASSES;
      }

      SelectionDialog dialog = JavaUI.createTypeDialog(getConfigEditor().getSite().getShell(), PlatformUI
          .getWorkbench().getProgressService(), null, scope, false, filter);
      dialog.setTitle(Messages.getString("AbstractNamespaceDetailsPart.TYPE_SELECTION_DIALOG_TITLE")); //$NON-NLS-1$

      if (dialog.open() == Window.OK) {
        IType type = (IType) dialog.getResult()[0];
        String newValue = type.getFullyQualifiedName('$');
        editAttribute(attr, newValue);
      }
    }
    catch (JavaModelException e) {
View Full Code Here

        filter = filter.replace('$', '.');
        try {
          int scope = IJavaElementSearchConstants.CONSIDER_CLASSES;

          SelectionDialog dialog = JavaUI.createTypeDialog(getShell(), PlatformUI.getWorkbench()
              .getProgressService(), null, scope, false, filter);
          dialog.setTitle(Messages.getString("NewBeanWizardPage.SELECT_TYPE_DIALOG_TITLE")); //$NON-NLS-1$

          if (dialog.open() == Window.OK) {
            IType type = (IType) dialog.getResult()[0];
            String newValue = type.getFullyQualifiedName('$');
            classText.setText(newValue);
            updateAttribute(BeansSchemaConstants.ATTR_CLASS, newValue);
          }
        }
View Full Code Here

      }
    }
  }

  private void handleJavaConfigButtonPressed() {
    SelectionDialog dialog = createFilteredTypesDialog();
    if (dialog != null && dialog.open() == Window.OK) {
      Object[] selection = dialog.getResult();
      if (selection != null && selection.length > 0) {
        for (Object element : selection) {
          String config = null;
          if (element instanceof IType) {
            IType type = (IType) element;
View Full Code Here

      hasUserMadeChanges = true;
    }
  }
 
  private SelectionDialog createFilteredTypesDialog() {
    SelectionDialog dialog = null;
    IJavaProject javaProj = JdtUtils.getJavaProject(project.getProject());
    if (javaProj != null) {
      IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { javaProj });
      Set<IType> annotatedTypes =org.springframework.ide.eclipse.core.java.JdtUtils.searchForJavaConfigs(scope);
      final Set<String> filteredResults = new HashSet<String>();
      for (IType type : annotatedTypes) {
        filteredResults.add(type.getPackageFragment().getElementName() + "/" + type.getTypeQualifiedName('.'));
      }
      try {
        dialog = JavaUI.createTypeDialog(SpringUIUtils.getStandardDisplay().getActiveShell(), PlatformUI.getWorkbench()
            .getProgressService(), scope, IJavaElementSearchConstants.CONSIDER_ALL_TYPES, true, "**",
            new TypeSelectionExtension() {
              @Override
              public ITypeInfoFilterExtension getFilterExtension() {
                return new ITypeInfoFilterExtension() {
                  public boolean select(ITypeInfoRequestor typeInfoRequestor) {
                    StringBuffer buffer = new StringBuffer();
                    buffer.append(typeInfoRequestor.getPackageName()).append('/');
                    String enclosingName = typeInfoRequestor.getEnclosingName();
                    if (enclosingName.length() > 0) {
                      buffer.append(enclosingName).append('.');
                    }
                    buffer.append(typeInfoRequestor.getTypeName());
                    return filteredResults.contains(buffer.toString());
                  }
                };
              }
            });
        dialog.setTitle(BeansUIPlugin.getResourceString(DIALOG_TITLE));
        dialog.setMessage(BeansUIPlugin.getResourceString(DIALOG_MESSAGE));
      } catch (JavaModelException e) {
        StatusHandler.log(new Status(IStatus.ERROR, BeansUIPlugin.PLUGIN_ID,
            "An error occurred while opening dialog.", e));
      }
    }
View Full Code Here

        IType superType = project.findType("javafx.scene.Parent");
       
        if( superType != null ) {
          IJavaSearchScope searchScope = SearchEngine.createStrictHierarchyScope(project, superType, true, false, null);   
         
          SelectionDialog dialog = JavaUI.createTypeDialog(getShell(), PlatformUI.getWorkbench().getProgressService(), searchScope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, "");
          dialog.setTitle("Find Preloader");
          if (dialog.open() == Window.OK) {
            IType type = (IType) dialog.getResult()[0];
            return type;
         
        }
      } catch (JavaModelException e) {
        // TODO Auto-generated catch block
View Full Code Here

        IType superType = project.findType("javafx.scene.Parent");
       
        if( superType != null ) {
          IJavaSearchScope searchScope = SearchEngine.createStrictHierarchyScope(project, superType, true, false, null);   
         
          SelectionDialog dialog = JavaUI.createTypeDialog(getShell(), PlatformUI.getWorkbench().getProgressService(), searchScope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, "");
          dialog.setTitle("Find Preloader");
          if (dialog.open() == Window.OK) {
            IType type = (IType) dialog.getResult()[0];
            return type;
         
        }
      } catch (JavaModelException e) {
        // TODO Auto-generated catch block
View Full Code Here

    try {
      IType superType = project.findType( "javafx.application.Preloader" );

      IJavaSearchScope searchScope = SearchEngine.createStrictHierarchyScope( project, superType, true, false, null );

      SelectionDialog dialog = JavaUI.createTypeDialog( parent, PlatformUI.getWorkbench().getProgressService(), searchScope,
          IJavaElementSearchConstants.CONSIDER_CLASSES, false, "" );
      dialog.setTitle( "Find Preloader" );
      if ( dialog.open() == Window.OK ) {
        IType type = (IType) dialog.getResult()[0];
        return type.getFullyQualifiedName( '$' );
      }
    }
    catch ( JavaModelException e ) {
      // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of org.eclipse.ui.dialogs.SelectionDialog

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.