Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.DirectoryDialog


    @Override
    public void selectionChanged(final ListDialogField<String> field) {
    }

    protected void browseForInstallDir() {
        final DirectoryDialog dialog = new DirectoryDialog(getShell());
        dialog.setFilterPath(fOtpHome.getText());
        dialog.setMessage(RuntimePreferenceMessages.addDialog_pickInstallationRoot);
        final String newPath = dialog.open();
        if (newPath != null) {
            fOtpHome.setText(newPath);
            final File f = new File(newPath);
            if (fName.getText().equals("")) {
                fName.setText(f.getName());
View Full Code Here


    private void createActionBars() {
        loadAction = new Action() {
            @Override
            public void run() {
                final DirectoryDialog dialog = new DirectoryDialog(PlatformUI
                        .getWorkbench().getDisplay().getActiveShell(), SWT.OPEN);
                dialog.setFilterPath(ResourcesPlugin.getWorkspace().getRoot()
                        .getLocation().toString());
                // dialog.setFilterExtensions(new String[] { "*.*" });
                dialog.setText("Load trace data...");
                final String selected = dialog.open();
                if (selected != null) {
                    task = new RunnableWithProgress("Load trace data...") {
                        @Override
                        public void doAction() {
                            TraceBackend.getInstance().loadFile(selected);
View Full Code Here

     * Method declared on ListEditor.
     * Creates a new path element by means of a directory dialog.
     */
    protected String getNewInputObject() {

        DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SHEET);
        if (dirChooserLabelText != null) {
      dialog.setMessage(dirChooserLabelText);
    }
        if (lastPath != null) {
            if (new File(lastPath).exists()) {
        dialog.setFilterPath(lastPath);
      }
        }
        String dir = dialog.open();
        if (dir != null) {
            dir = dir.trim();
            if (dir.length() == 0) {
        return null;
      }
View Full Code Here

     * @return File File or <code>null</code>.
     *
     */
    private File getDirectory(File startingDirectory) {

        DirectoryDialog fileDialog = new DirectoryDialog(getShell(), SWT.OPEN | SWT.SHEET);
        if (startingDirectory != null) {
      fileDialog.setFilterPath(startingDirectory.getPath());
    }
        else if (filterPath != null) {
          fileDialog.setFilterPath(filterPath.getPath());
        }
        String dir = fileDialog.open();
        if (dir != null) {
            dir = dir.trim();
            if (dir.length() > 0) {
        return new File(dir);
      }
View Full Code Here

      Button browse = new Button(pathGroup, SWT.PUSH);
      browse.setText("    Browse...    ");
      browse.addListener(SWT.Selection, new Listener() {
        @Override public void handleEvent(Event event) {
          DirectoryDialog dialog = new DirectoryDialog(getShell());
          dialog.setMessage("Select a folder for storing data collected by Rabbit.");

          String path = dialog.open();
          if (path != null) {
            storageText.setText(path);
          }
          setErrorMessage(null);
        }
View Full Code Here

    private void selectInFileSystem() {
        String file;
        if (defaultExtension == null) {
            // we want a folder
            DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.OPEN);
            file = dialog.open();
        } else {
            FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
            if (text != null) {
                dialog.setFileName(text.getText());
            }
            dialog.setFilterExtensions(new String[] {defaultExtension, "*"});
            file = dialog.open();           
        }
        if (file != null) {
            setFile(file);
        }
    }
View Full Code Here

      button1.addListener(SWT.Selection,
          new Listener() {

            @Override
            public void handleEvent(Event event) {
              DirectoryDialog fdialog = new DirectoryDialog(
                  comp.getShell(),
                  SWT.OPEN);
              String result = fdialog.open();
              if (result != null) {
                text1.setText(result);
              }

            }
View Full Code Here

    private void browse() {
        String selectedDirectory = null;
        String dirName = pathText.getText();

        DirectoryDialog dialog = new DirectoryDialog(getShell());
        dialog.setMessage("Select the Drools runtime directory.");
        dialog.setFilterPath(dirName);
        selectedDirectory = dialog.open();

        if (selectedDirectory != null) {
            pathText.setText(selectedDirectory);
        }
    }
View Full Code Here

            pathText.setText(selectedDirectory);
        }
    }

    private void createRuntime() {
        DirectoryDialog dialog = new DirectoryDialog(getShell());
        dialog.setMessage("Select the new Drools 6 runtime directory.");
        String selectedDirectory = dialog.open();

        if (selectedDirectory != null) {
            DroolsRuntimeManager.createDefaultRuntime(selectedDirectory);
            String version = Platform.getBundle("org.drools.eclipse").getVersion().toString();
            nameText.setText("Drools " + version + " runtime");
View Full Code Here

        }
        // server path field
        {
          m_serverPathField = new StringButtonDialogField(new IStringButtonAdapter() {
            public void changeControlPressed(DialogField field) {
              DirectoryDialog directoryDialog = new DirectoryDialog(getShell());
              directoryDialog.setFilterPath(m_serverPathField.getText());
              String newPath = directoryDialog.open();
              if (newPath != null) {
                m_serverPathField.setText(newPath);
              }
            }
          });
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.