Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.DirectoryDialog


      pathText.setText(selectedDirectory);
    }
  }
 
  private void createRuntime() {
    DirectoryDialog dialog = new DirectoryDialog(getShell());
    dialog.setMessage("Select the new jBPM runtime directory.");
    String selectedDirectory = dialog.open();
   
    if (selectedDirectory != null) {
      JBPMRuntimeManager.createDefaultRuntime(selectedDirectory);
      nameText.setText("jBPM runtime");
      pathText.setText(selectedDirectory);
View Full Code Here


   
    private void findRepository() {
    String selectedDirectory = null;
    String dirName = urlText.getText();

    DirectoryDialog dialog = new DirectoryDialog(getShell());
    dialog.setMessage("Select the jBPM service repository");
    dialog.setFilterPath(dirName);
    selectedDirectory = dialog.open();
   
    if (selectedDirectory != null) {
      urlText.setText(selectedDirectory);
    }
    }
View Full Code Here

    IResource resource = (IResource) dialog.getFirstResult();
    return (resource == null) ? null : resource.getFullPath();
  }

  static String showFileSystemDirectorySelectionDialog(Shell shell, String filterPath) {
    DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN | SWT.APPLICATION_MODAL);
    if (filterPath != null && filterPath.trim().length() != 0) {
      dialog.setFilterPath(filterPath);
    }
    dialog.setMessage(selectFileSystemDirectory);
    return dialog.open();
  }
View Full Code Here

        new StructuredSelection(audioFolder.members()[0]), true);
    return null;
  }

  private String openFolderDialog(IWorkbenchWindow window) {
    DirectoryDialog dialog = new DirectoryDialog(window.getShell(),
        SWT.OPEN);
    dialog.setText(Messages.OpenFolderHandler_dialog_text);
    return dialog.open();
  }
View Full Code Here

    }
    super.okPressed();
  }

  private String openFolderDialog(Shell shell) {
    DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN);
    dialog.setText(Messages.AudioTagTitleAreaDialog_dialog_text);
    return dialog.open();
  }
View Full Code Here

  }

  private void makeActions() {
    actionAddRepository = new Action() {
      public void run() {
        DirectoryDialog dialog = new DirectoryDialog(getShell());
        dialog.setMessage("Choose a repository");
        String directory = dialog.open();
        if (directory != null) {
          File repositoryDirectory = new File(directory);
          BundleRepositoryPersister persister = new BundleRepositoryPersister(repositoryDirectory);
          if (persister.checkRepository()) {
            addRepositoryPath(directory);
            contentProvider.refresh();
            viewer.refresh();
          } else {
            if (!directoryIsEmpty(repositoryDirectory)) {
              if (!MessageDialog.openQuestion(getShell(), "Directory is not empty",
                  "The selected directory is not empty.\nCreating a repository will delete all files in this directory.\n" +
                  "Are you sure to continue?")) {
                return;
              }
            }
            NewRepositoryDialog newDialog = new NewRepositoryDialog(getShell(), directory);
            if (newDialog.open() == IDialogConstants.OK_ID) {
              Deployer deployer = new Deployer(repositoryDirectory);
              try {
                deployer.create(newDialog.getProfileName());
                addRepositoryPath(directory);
                contentProvider.refresh();
                viewer.refresh();
              } catch (IOException e) {
                MessageDialog.openError(getShell(), "Add repository", "Could not create repository\n" + e.getMessage());
                e.printStackTrace();
              }
            }
          }
        }
      }

      private boolean directoryIsEmpty(File directory) {
        File[] files = directory.listFiles();
        return files == null || files.length == 0;
      }
    };
    actionAddRepository.setText("Add Repository...");
    actionAddRepository.setToolTipText("Add a repository to the view");
    actionAddRepository.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
        ISharedImages.IMG_TOOL_NEW_WIZARD));

    actionAddBundle = new Action() {
      public void run() {
        FileDialog dialog = new FileDialog(getShell(), SWT.OPEN | SWT.MULTI);
        dialog.setFilterNames(new String[] { "OSGi Bundle (*.jar)"});
        dialog.setFilterExtensions(new String[] { "*.jar" });
        dialog.setText("Choose a bundle");
        if (dialog.open() != null) {
          ISelection selection = viewer.getSelection();
          TreeObject selectedItem = (TreeObject) ((IStructuredSelection) selection).getFirstElement();
          ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(getShell());
          try {
            String[] files = dialog.getFileNames();
            String path = dialog.getFilterPath();
            for (int i = 0; i < files.length; i++) {
              files[i] = path + File.separatorChar + files[i];
            }
            progressDialog.run(true, false, new BundleDeployJob(getRepositoryLocation(selectedItem), files));
            viewer.refresh();
View Full Code Here

    browse.setText("Browse...");
    browse.setLayoutData(createGridData(fillHorizontal, colSpan, wHint));

    browse.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        DirectoryDialog directoryDialog = new DirectoryDialog(getShell(), SWT.SINGLE);

        directoryDialog.setFilterPath("C:/");
        directoryDialog.setMessage(message);

        String selectedDirectory = directoryDialog.open();
        textarea.setText(selectedDirectory);
      }
    });
    return browse;
View Full Code Here

    }

    // javadoc inherited.
    protected String showDialog() {
        if (dialog == null) {
            dialog = new DirectoryDialog(getShell(), SWT.NONE);
        }
        if (title != null) {
            dialog.setText(title);
        }
        // Attempt to set the initial selection to the value typed in (only
View Full Code Here

        LogsView.instance.addItem("Could not start server!");
        HLog.netlogger.fatal("Unable to start server. Big issue here...",ex);
      }
    }
     if(e.getSource().equals(addItem)){
        DirectoryDialog dd = new DirectoryDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
        try {
          HFiles.getInstance().add(dd.open());
          refreshTree();
        } catch (DocumentException e1) {
          HLog.doclogger.fatal("The document seems to be corrupted after adding item",e1);
        } catch (IOException e2) {
          HLog.doclogger.error("Could not read important info from disk",e2);
View Full Code Here

    if (a1 != null)
      {
      // Keep previous dialog -> Keep memory of last directory
      if (_dd == null)
        {
        _dd = new DirectoryDialog(parent);
        }

      String fndir = _dd.open();

      if (fndir != null)
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.