Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.SelectionDialog


     * @param selectedText the text that should be initially set as a filter
     */
    public static void doSelect(List<IPythonNature> pythonNatures, List<AbstractAdditionalTokensInfo> additionalInfo,
            String selectedText) {

        SelectionDialog dialog = GlobalsDialogFactory.create(getShell(), additionalInfo, selectedText);

        dialog.open();
        Object[] result = dialog.getResult();
        if (result != null && result.length > 0) {
            for (Object obj : result) {
                IInfo entry;
                if (obj instanceof AdditionalInfoAndIInfo) {
                    AdditionalInfoAndIInfo additional = (AdditionalInfoAndIInfo) obj;
View Full Code Here


                }
                return super.getText(element);
            }
        };

        SelectionDialog selectionDialog;
        if (selectMultiple) {
            selectionDialog = new ListSelectionDialog(workbenchWindow.getShell(), interpreters, contentProvider,
                    labelProvider, msg);
        } else {
View Full Code Here

        final Set<String> interpreterNamesToRestore = pathEditor.getInterpreterExeOrJarToRestoreAndClear();
        final IInterpreterInfo[] exesList = pathEditor.getExesList();

        if (!editorChanged && interpreterNamesToRestore.size() == 0) {
            IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            SelectionDialog listDialog = createChooseIntepreterInfoDialog(workbenchWindow, exesList,
                    "Select interpreters to be restored", true);

            int open = listDialog.open();
            if (open != ListDialog.OK) {
                return;
            }
            Object[] result = (Object[]) listDialog.getResult();
            if (result == null || result.length == 0) {
                return;

            }
            for (Object o : result) {
View Full Code Here

          searchScope = SearchEngine.createHierarchyScope(superTypeType);
        } else
          return null; //Error
      }
 
      SelectionDialog dialog =
        JavaUI.createTypeDialog(
          DozerPlugin.getActiveWorkbenchShell(),
          PlatformUI.getWorkbench().getProgressService(),
          searchScope,
          allowInterfaces?IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES:IJavaElementSearchConstants.CONSIDER_CLASSES,
          false);
      dialog.setTitle("Browse...");
      if (dialog.open() == Window.OK) {
        IType type = (IType) dialog.getResult()[0];
        return type.getFullyQualifiedName('$');
      }
    } catch (Exception e) {
      Logger.logException(e);
    }
View Full Code Here

    Button button = toolkit.createButton(composite, ClickPlugin.getString("action.browse"), SWT.PUSH);
    button.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(SelectionEvent evt){
        Shell shell = text.getShell();
        try {
          SelectionDialog dialog = JavaUI.createTypeDialog(
              shell,new ProgressMonitorDialog(shell),
              SearchEngine.createJavaSearchScope(new IJavaElement[]{project}),
              IJavaElementSearchConstants.CONSIDER_CLASSES,false);

          if(dialog.open() == SelectionDialog.OK){
            Object[] result = dialog.getResult();
            String className = ((IType)result[0]).getFullyQualifiedName();
            if(ClickUtils.isNotEmpty(packageName) && className.startsWith(packageName)){
              className = className.substring(packageName.length() + 1);
            }
            text.setText(className);
View Full Code Here

      public void widgetSelected(SelectionEvent evt){
        Shell shell = getShell();
        try {
          IJavaProject project = JavaCore.create(getProject());
         
          SelectionDialog dialog = JavaUI.createTypeDialog(
              shell, new ProgressMonitorDialog(shell),
              SearchEngine.createJavaSearchScope(new IJavaElement[]{project}),
              IJavaElementSearchConstants.CONSIDER_CLASSES,false);
         
          if(dialog.open()==SelectionDialog.OK){
            Object[] result = dialog.getResult();
            superClass.setText(((IType)result[0]).getFullyQualifiedName());
          }
        } catch(Exception ex){
          ClickPlugin.log(ex);
        }
View Full Code Here

      browseButton.setText(ClickPlugin.getString("action.browse"));
      browseButton.addSelectionListener(new SelectionAdapter(){
        public void widgetSelected(SelectionEvent evt){
          Shell shell = type.getShell();
          try {
            SelectionDialog dialog = JavaUI.createTypeDialog(
                shell,new ProgressMonitorDialog(shell),
                SearchEngine.createJavaSearchScope(new IJavaElement[]{JavaCore.create(getProject())}),
                IJavaElementSearchConstants.CONSIDER_CLASSES,false);
           
            if(dialog.open()==SelectionDialog.OK){
              Object[] result = dialog.getResult();
              type.setText(((IType)result[0]).getFullyQualifiedName());
            }
          } catch(Exception ex){
            ClickPlugin.log(ex);
          }
View Full Code Here

                //We just have one, so, no point in asking about which one should be there.
                interpreter = interpreters[0];
            }

            if (interpreter == null) {
                SelectionDialog listDialog = AbstractInterpreterPreferencesPage.createChooseIntepreterInfoDialog(
                        workbenchWindow, interpreters, "Select interpreter to be used.", false);

                int open = listDialog.open();
                if (open != ListDialog.OK || listDialog.getResult().length > 1) {
                    return null;
                }
                Object[] result = (Object[]) listDialog.getResult();
                if (result == null || result.length == 0) {
                    interpreter = interpreters[0];

                } else {
                    interpreter = ((IInterpreterInfo) result[0]);
View Full Code Here

    classSelectButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent evt) {
        Shell shell = classNameText.getShell();
        try {
          SelectionDialog dialog = JavaUI.createTypeDialog(shell, new ProgressMonitorDialog(shell),
              SearchEngine.createWorkspaceScope(), IJavaElementSearchConstants.CONSIDER_CLASSES, false);

          if (dialog.open() == SelectionDialog.OK) {
            Object[] result = dialog.getResult();
            String className = ((IType) result[0]).getFullyQualifiedName();
            IJavaProject containerProject = ((IType) result[0]).getJavaProject();

            if (className != null) {
              classNameText.setText(className);
View Full Code Here

    classSelectButton.setLayoutData(data);
    classSelectButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent evt) {
        Shell shell = classNameText.getShell();
        try {
          SelectionDialog dialog = JavaUI.createTypeDialog(shell, new ProgressMonitorDialog(shell),
              SearchEngine.createWorkspaceScope(), IJavaElementSearchConstants.CONSIDER_CLASSES, false);

          if (dialog.open() == SelectionDialog.OK) {
            Object[] result = dialog.getResult();
            String className = ((IType) result[0]).getFullyQualifiedName();
           
            if (className != null) {
              classNameText.setText(className);
            }
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.