Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.CheckedTreeSelectionDialog


 
  @SuppressWarnings("rawtypes")
  public static CheckedTreeSelectionDialog createMulti(Shell parent,
      String title, String message, Class[] filter,
      Object input, List selectedElements) {
    CheckedTreeSelectionDialog diag = new CheckedTreeSelectionDialog(parent,
        new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
   
    configure(diag, title, message);
   
    if (filter.length > 0) {
      diag.addFilter(new TypedViewerFilter(filter));
    }
   
    diag.setInput(input);
   
    if (selectedElements != null) {
      diag.setInitialElementSelections(selectedElements);
    }
    return diag;
  }
View Full Code Here


          IResource resource = project.findMember((String)path);
          if (resource != null && resource instanceof IFolder) {
            folders.add((IFolder) resource);
          }
        }
        CheckedTreeSelectionDialog dialog = ResourceDialog.createMulti(
            pathViewer.getTable().getShell(),
            "Namespace Paths",
            "Select folders:",
            new Class[] {IFolder.class},
            project, folders);

        if (dialog.open() == Dialog.OK) {
          namespace.clear();
          for (Object result : dialog.getResult()) {
            if (result instanceof IFolder) {
              namespace.add(((IFolder)result).getProjectRelativePath().toString());
            }
          }
        }
View Full Code Here

                final IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(currentProjName);
                if (proj == null) {
                    return;
                }
               
                CheckedTreeSelectionDialog dialog = new CheckedTreeSelectionDialog(parent.getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
                dialog.setInput(proj.getWorkspace().getRoot());
                dialog.addFilter(new ClojureElementViewerFilter(proj));
               
                if (sourceFilesViewer.getInput() != null) {
                    dialog.setInitialSelections(
                            ((List<?>)sourceFilesViewer.getInput()).toArray());
                }
                dialog.setTitle("Evaluate Clojure source file(s)");
                dialog.open();
               
                List<IFile> selectedFiles = new ArrayList<IFile>();
                Object[] dialogResult = dialog.getResult();
                if (dialogResult != null) {
                  for (Object o : dialogResult) {
                      if (o instanceof IFile) {
                          selectedFiles.add((IFile)o);
                      }
View Full Code Here

  }

  private void handleScanButtonPressed() {
    ScannedFilesContentProvider contentProvider = new ScannedFilesContentProvider(
        "xml");
    CheckedTreeSelectionDialog dialog = new CheckedTreeSelectionDialog(
        SpringUIUtils.getStandardDisplay().getActiveShell(),
        new ScannedFilesLabelProvider(), contentProvider) {

      @Override
      protected Control createDialogArea(Composite parent) {
        Composite composite = (Composite) super
            .createDialogArea(parent);
        Label note = new Label(composite, SWT.WRAP);
        note.setText(Activator.getResourceString(SCAN_NOTE_LABEL));
        note.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        return composite;
      }
    };
    dialog.setTitle(Activator.getResourceString(DIALOG_TITLE));
    dialog.setMessage(Activator.getResourceString(DIALOG_MESSAGE));
    dialog.addFilter(new ConfigFileFilter(new String[] { "xml" }));
    dialog.setValidator(new FileSelectionValidator(true));
    dialog.setInput(element);
    dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
    dialog.setInitialSelections(contentProvider.getElements(project
        .getProject()));

    if (dialog.open() == ElementTreeSelectionDialog.OK) {
      Object[] selection = dialog.getResult();
      if (selection != null && selection.length > 0) {
        for (int i = 0; i < selection.length; i++) {
          IFile file = (IFile) selection[i];
          IWebflowConfig config = new WebflowConfig(project);
          config.setResource(file);
View Full Code Here

    configsTable.setFocus();
  }

  protected void handleScanButtonPressed() {
    ScannedFilesContentProvider contentProvider = new ScannedFilesContentProvider(suffixesText.getText());
    CheckedTreeSelectionDialog dialog = new CheckedTreeSelectionDialog(SpringUIUtils.getStandardDisplay()
        .getActiveShell(), new ScannedFilesLabelProvider(), contentProvider) {

      @Override
      protected Control createDialogArea(Composite parent) {
        Composite composite = (Composite) super.createDialogArea(parent);
        Label note = new Label(composite, SWT.WRAP);
        note.setText(BeansUIPlugin.getResourceString(SCAN_NOTE_LABEL));
        note.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        return composite;
      }
    };
    dialog.setTitle(BeansUIPlugin.getResourceString(DIALOG_TITLE));
    dialog.setMessage(BeansUIPlugin.getResourceString(DIALOG_MESSAGE));
    dialog.addFilter(new ScannedFilesFilter(project.getConfigSuffixes()));
    dialog.setValidator(new ScannedFilesValidator(true));
    dialog.setInput(project.getProject());
    dialog.setSorter(new JavaElementSorter());
    dialog.setInitialSelections(contentProvider.getElements(project.getProject()));

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

TOP

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

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.