Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.SelectionStatusDialog


  /**
   * The user has pressed the add button. Opens the configuration selection dialog and adds the selected
   * configuration.
   */
  private void handleAddButtonPressed() {
    SelectionStatusDialog dialog;
    if (SpringCoreUtils.isEclipseSameOrNewer(3, 2)) {
      FilteredElementTreeSelectionDialog selDialog = new FilteredElementTreeSelectionDialog(SpringUIUtils
          .getStandardDisplay().getActiveShell(), new LabelProvider(), new NonJavaResourceContentProvider());
      selDialog.addFilter(new ConfigFileFilter(project.getConfigSuffixes()));
      selDialog.setValidator(new StorageSelectionValidator(true));
      selDialog.setInput(project.getProject());
      selDialog.setSorter(new JavaElementSorter());
      dialog = selDialog;
    }
    else {
      ElementTreeSelectionDialog selDialog = new ElementTreeSelectionDialog(SpringUIUtils.getStandardDisplay()
          .getActiveShell(), new LabelProvider(), new NonJavaResourceContentProvider());
      selDialog.addFilter(new ConfigFileFilter(project.getConfigSuffixes()));
      selDialog.setValidator(new StorageSelectionValidator(true));
      selDialog.setInput(project.getProject());
      selDialog.setSorter(new JavaElementSorter());
      dialog = selDialog;
    }
    dialog.setTitle(BeansUIPlugin.getResourceString(DIALOG_TITLE));
    dialog.setMessage(BeansUIPlugin.getResourceString(DIALOG_MESSAGE));
    if (dialog.open() == Window.OK) {
      Object[] selection = dialog.getResult();
      if (selection != null && selection.length > 0) {
        for (Object element : selection) {
          String config = null;
          if (element instanceof ZipEntryStorage) {
            ZipEntryStorage storage = (ZipEntryStorage) element;
View Full Code Here

TOP

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

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.