Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.DirectoryDialog


            updateStatus(null);
        }
    }
   
    private void handleBrowse(){
        DirectoryDialog fileDialog = new DirectoryDialog(this.getShell());
        String dirName = fileDialog.open();
        if (dirName != null) {
            outputFolderTextBox.setText(dirName);
        }

    }
View Full Code Here


    Button lookupButton = new Button(container, SWT.NONE);
    lookupButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        Shell shell = Display.getDefault().getActiveShell();
        DirectoryDialog dlg = new DirectoryDialog(shell);

            dlg.setFilterPath(project.getLocation().toOSString());

            // Change the title bar text
            dlg.setText("Source Folder");

            // Customizable message displayed in the dialog
            dlg.setMessage("Select a folder");

            // Calling open() will open and run the dialog.
            // It will return the selected directory, or
            // null if user cancels
            String dir = dlg.open();
            if (dir != null) {
              // Set the text box to the new selection
              folderNameText.setText(dir);
            }
      }
View Full Code Here

  /**
   * Functionality for New button.
   * Shows a browser dialog to select a directory and returns that directory path.
   */
  protected String getNewInputObject() {
    DirectoryDialog dlg = new DirectoryDialog(getShell());
    final Text text = new Text(getShell(), SWT.BORDER);
    dlg.setFilterPath(text.getText());
    dlg.setText(Messages.LibraryPathListEditor_0);
    dlg.setMessage(Messages.LibraryPathListEditor_1);
    String dir = dlg.open();
    if(dir == null) {
      return null;
    }
    //remove white spaces
    dir = dir.trim();
View Full Code Here

      }
    });
  }

  protected void doAdd() {
    DirectoryDialog dialog = new DirectoryDialog(getShell());
    dialog.setMessage("Browse for the GWT installation:");
    String location = dialog.open();
    if (location != null) {
      File file = new File(location + File.separatorChar + Util.getGwtDevLibJarName());
      if (!file.exists()) {
        MessageDialog.openError(getShell(), "Invalid directory", "The directory doesn't contain '" + Util.getGwtDevLibJarName() + "' file.");
      } else {
View Full Code Here

  /**
   * Functionality for New button.
   * Shows a browser dialog to select a directory and returns that directory path.
   */
  protected String getNewInputObject() {
    DirectoryDialog dlg = new DirectoryDialog(getShell());
    final Text text = new Text(getShell(), SWT.BORDER);
    dlg.setFilterPath(text.getText());
    dlg.setText(Messages.IncludePathListEditor_0);
    dlg.setMessage(Messages.IncludePathListEditor_1);
    String dir = dlg.open();
    if(dir == null) {
      return null;
    }
    //remove white spaces
    dir = dir.trim();
View Full Code Here

    OneLineTextElement<String> element = new OneLineTextElement<String>(
        bndr.getBinding("outPut"));
    element.setSelector(new IFactory() {

      public Object getValue(Object context) {
        DirectoryDialog dialog = new DirectoryDialog(Display
            .getCurrent().getActiveShell(), SWT.SAVE);
        dialog.setMessage("Please choose path for import");

        String path = dialog.open();

        return path;
      }

      public String getName() {
View Full Code Here

    OneLineTextElement<String> element = new OneLineTextElement<String>(
        bndr.getBinding("outPut"));
    element.setSelector(new IFactory() {

      public Object getValue(Object context) {
        DirectoryDialog dialog = new DirectoryDialog(Display.getCurrent()
            .getActiveShell(),SWT.OPEN | SWT.READ_ONLY | SWT.DIALOG_TRIM);       
        dialog.setText("Please select path");
        // dialog.set

        String open = dialog.open();
        return open;
      }

      public String getName() {
        return "Browse...";
View Full Code Here

                  .getActiveShell(), SWT.OPEN);
              fd.setText("Select file");
              String open = ((FileDialog) fd).open();
              return open;
            } else {
              DirectoryDialog dd = new DirectoryDialog(Display
                  .getCurrent().getActiveShell(), SWT.SAVE);
              dd.setText("Store file");
              String choosenDir = dd.open();

              binding.setValue(fname, null);
              if (choosenDir == null) {
              }
              return choosenDir;// + File.pathSeparator + fname;
View Full Code Here

          res = file.open();
         
          break;

        case TYPE_FOLDER:
          DirectoryDialog folder = new DirectoryDialog(Display.getDefault().getActiveShell(), SWT.NULL);
          res = folder.open();
          break;
         
        default:
          break;
        }
View Full Code Here

          res = file.open();
         
          break;

        case TYPE_FOLDER:
          DirectoryDialog folder = new DirectoryDialog(Display.getDefault().getActiveShell(), SWT.NULL);
          res = folder.open();
          break;
         
        default:
          break;
        }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.DirectoryDialog

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.