Examples of ContainerSelectionDialog


Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

    browseOutputFolderButton.setText("Browse ...");
    browseOutputFolderButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        String currentContainerString = outputFolderText.getText();
        IContainer currentContainer = getContainer(currentContainerString);
        ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
                currentContainer, false, "Select output folder");
        dialog.showClosedProjects(false);
        dialog.open();
        Object[] results = dialog.getResult();
        if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
          IPath path = (IPath) results[0];
          String containerName = path.toOSString();
          outputFolderText.setText(containerName);
        }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

    }
    fileText.setText(defaultNewName);
  }

  void handleBrowse() {
    ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin
            .getWorkspace().getRoot(), false, "Select a containing folder");
    if (dialog.open() == ContainerSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        containerText.setText(((Path) result[0]).toOSString());
      }
    }
  }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

   * Uses the standard container selection dialog to choose the new value for
   * the container field.
   */

  private void handleBrowse() {
    ContainerSelectionDialog dialog = new ContainerSelectionDialog(
        getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
        "Select new file container");
    if (dialog.open() == ContainerSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        containerText.setText(((Path) result[0]).toString());
      }
    }
  }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

     * Browse dialog to select project for copy.
     *
     * Returns null if the dialog was canceled.
     */
    public String getProjectDialog(String title) {
        ContainerSelectionDialog dialog = new ContainerSelectionDialog(
            getShell(), null, false, title);

        dialog.open();
        Object[] result = dialog.getResult();

        if (result == null || result.length == 0) {
            return null;
        }

View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

            IPath path = new Path(folderName);
            container = Environment.getContainer(path);
        }

        if (_workspaceOnly) {
            ContainerSelectionDialog dialog = new ContainerSelectionDialog(
                    getShell(), container, false, "Select the Ptolemy home");

            if (dialog.open() == Window.OK) {
                IPath result = (IPath) dialog.getResult()[0];
                return result.toOSString();
            } else {
                return null;
            }
        } else {
View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

   *         defaultValue if nothing was selected (or "cancel" button was
   *         pressed...)
   */
  public static String selectProject(Shell parentShell, String defaultValue) {
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    ContainerSelectionDialog dialog = new ContainerSelectionDialog(
        parentShell, workspaceRoot, false, "Select new file container");
    if (dialog.open() == ContainerSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        return ((Path) result[0]).toString();
      }
    }
    return defaultValue;
View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

        outputLocation.setText(returnString);
      }
    } else {
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();

      ContainerSelectionDialog dialog = new ContainerSelectionDialog(
          getShell(), root, false, CodegenWizardPlugin
              .getResourceString("page3.containerbox.title"));
      if (dialog.open() == ContainerSelectionDialog.OK) {
        Object[] result = dialog.getResult();
        if (result.length == 1) {
          Path path = ((Path) result[0]);
          // append to the workspace path
          if (root.exists(path)) {
            outputLocation.setText(root.getLocation().append(path)
View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

        outputFolderTextBox.setText(returnString);
      }
    } else {
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();

      ContainerSelectionDialog dialog = new ContainerSelectionDialog(
          getShell(), root, false, CodegenWizardPlugin
              .getResourceString("page3.containerbox.title"));
      if (dialog.open() == ContainerSelectionDialog.OK) {
        Object[] result = dialog.getResult();
        if (result.length == 1) {
          Path path = ((Path) result[0]);
          // append to the workspace path
          if (root.exists(path)) {
            outputFolderTextBox.setText(root.getLocation().append(
View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

   * Uses the standard container selection dialog to choose the new value for
   * the container field.
   */

  private void handleBrowse() {
    ContainerSelectionDialog dialog = new ContainerSelectionDialog(
        getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
        "Select new file container");
    if (dialog.open() == ContainerSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        containerText.setText(((Path) result[0]).toString());
      }
    }
  }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog

  }

  private void chooseWebappDir() {
    IProject project = ResourcesPlugin.getWorkspace().getRoot()
        .getProject(fProjText.getText());
    ContainerSelectionDialog dialog = new ContainerSelectionDialog(
        getShell(), project, false, "Select Web Application Directory");
    dialog.setTitle("Folder Selection");
    if (project != null) {
      IPath path = project.getFullPath();
      dialog.setInitialSelections(new Object[] { path });
    }
    dialog.showClosedProjects(false);
    dialog.open();
    Object[] results = dialog.getResult();
    if ((results != null) && (results.length > 0)
        && (results[0] instanceof IPath)) {
      IPath path = (IPath) results[0];
      path = path.removeFirstSegments(1);
      String containerName = path.makeRelative().toString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.