Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.SelectionDialog.open()


              dialog.setTitle("Debug Type");
          } else {
              dialog.setTitle("Run Type");
          }
          //dialog.setMultipleSelection(false); TODO now part of the dialog constructor
          if (dialog.open() == Window.OK) { return (IType) dialog.getResult()[0]; //TODO out of range exception possible?
          return null;
      } catch(Exception e) {
        return null;
      }
    }
View Full Code Here


//        TypeSelectionDialog dialog = new TypeSelectionDialog(getShell(), getWizard().getContainer(), IJavaSearchConstants.TYPE,
//                scope);
        dialog.setTitle("Target Class Selection");
        dialog.setMessage("&Choose a type:");

        if (dialog.open() == Window.OK) { return (IType) dialog.getResult()[0]; }
        return null;
    }

}
View Full Code Here

       // TypeSelectionDialog dialog = new TypeSelectionDialog(getShell(), getWizard().getContainer(), IJavaSearchConstants.CLASS,
       //         scope);
        dialog.setTitle("Target Exception Selection");
        dialog.setMessage("&Choose an exception:");

        if (dialog.open() == Window.OK) {
            return (IType) dialog.getResult()[0];
        }
        return null;
    }
View Full Code Here

            return;
    }
       
        dialog.setTitle("Choose Main Type");
        dialog.setMessage("Choose Main Type");
        if (dialog.open() == Window.CANCEL) { return; }

        Object[] results = dialog.getResult();
        if ((results == null) || (results.length < 1)) { return; }
        IType type = (IType) results[0];
        if (type != null) {
View Full Code Here

  private void handlePackageBrowse() {
    IJavaProject javaProject = JavaCore.create(project);
    SelectionDialog dialog;
    try {
      dialog = JavaUI.createPackageDialog(getShell(), javaProject, 0);
      if (dialog.open() == SelectionDialog.OK) {
        Object[] result = dialog.getResult();
        if (result.length == 1) {
          packageText.setText(((IPackageFragment) result[0]).getElementName());
        }
      }
View Full Code Here

              IJavaElementSearchConstants.CONSIDER_CLASSES,
              false);
      dialog.setTitle("Class Under Test");
      dialog.setMessage("Test stubs will be generated for class:");
      dialog.setInitialSelections(new Object[]{m_classUnderTestField.getText()});
      if (dialog.open() == Window.OK) {
        handleSelectClassUnderTest((IJavaElement) dialog.getResult()[0]);
      }
    } catch (Throwable e) {
      DesignerPlugin.log(e);
    }
View Full Code Here

              IJavaElementSearchConstants.CONSIDER_CLASSES, false);

          dialog.setMessage("&Choose a type:");
          dialog.setBlockOnOpen(true);
          dialog.setTitle(dialogTitle);
          dialog.open();

          if ((dialog.getReturnCode() == Window.OK)
              && (dialog.getResult().length > 0)) {
            IType type = (IType) dialog.getResult()[0];
            text.setText(type.getFullyQualifiedName());
View Full Code Here

          designer.setSelectedWidget(list);
      }else{
        Shell parent = expandBar.getShell();
        try {
          SelectionDialog typeDialog = JavaUI.createTypeDialog(parent, new ProgressMonitorDialog(parent), VisualSwingPlugin.getCurrentProject().getProject(), IJavaElementSearchConstants.CONSIDER_CLASSES, false);
          if(typeDialog.open()==Window.OK){
            Object[] result = typeDialog.getResult();
            if(result!=null&&result.length>0){
              IType type = (IType) result[0];
              String className = type.getElementName();
              IPackageFragment packageFragment = type.getPackageFragment();
View Full Code Here

            filter

       );
        dialog.setTitle("Choose Class");
        dialog.setMessage("");
        if (dialog.open() == IDialogConstants.CANCEL_ID)
            return null;

        Object[] types= dialog.getResult();
        if (types == null || types.length == 0)
            return null;
View Full Code Here

          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

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.