Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ContainerSelectionDialog


   */
  private class BrowseListener extends SelectionAdapter
  {
    public void widgetSelected(SelectionEvent e)
    {
      ContainerSelectionDialog dialog = new ContainerSelectionDialog(
          getShell(), getProject(), false, "Select a working folder");
      dialog.setValidator(new ISelectionValidator()
      {
        public String isValid(Object selection)
        {
          if (selection.toString().indexOf(getProjectPath()) == 0)
            return null;
          else
            return "Cannot select a folder in other projects";
        }
       
      });
      if (dialog.open() == ContainerSelectionDialog.OK)
      {
        Object[] result = dialog.getResult();
        if (result.length == 1)
        {
          String path = ((Path)result[0]).toString();
          path = path.substring(getProjectPath().length() + 1);
          m_WorkFolder.setText(path);
View Full Code Here


            String returnString = dialog.open();
            if (returnString != null) {
                outputLocation.setText(returnString);
            }
        } else {
            ContainerSelectionDialog dialog = new ContainerSelectionDialog(
                    getShell(),
                    ResourcesPlugin.getWorkspace().getRoot(),
                    false,
                    org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin
                            .getResourceString("page3.containerbox.title"));
            if (dialog.open() == ContainerSelectionDialog.OK) {
                Object[] result = dialog.getResult();
                if (result.length == 1) {
                    outputLocation.setText(((Path) result[0]).toOSString());
                }
            }
        }
View Full Code Here

  }

  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

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

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

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

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

      public void widgetDefaultSelected(SelectionEvent selectionevent) {
        widgetSelected(selectionevent);
      }

      public void widgetSelected(SelectionEvent selectionevent) {
        ContainerSelectionDialog containerDialog = new ContainerSelectionDialog(getEditorSite().getShell(), project, false, "Select the folder to write autogenerated files into.");
        containerDialog.open();
        Object[] selectedContainers = containerDialog.getResult();
        if (selectedContainers != null && selectedContainers.length > 0) {
          IPath selectedPath = (IPath) selectedContainers[0];
          IFolder selectedFolder = project.getParent().getFolder(selectedPath);
          IPath projectRelativePath = selectedFolder.getProjectRelativePath();
          EOGeneratorFormPage.this.getModel().setDestination(projectRelativePath.toPortableString());
        }
        destination.forceFocus();
      }
    });

    Label subclassDestinationLabel = toolkit.createLabel(pathsSection, "Subclass Destination:");
    subclassDestinationLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
    final Text subclassDestination = toolkit.createText(pathsSection, null);
    subclassDestination.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    _bindingContext.bindValue(SWTObservables.observeText(subclassDestination, SWT.Modify), BeansObservables.observeValue(_model, EOGeneratorModel.SUBCLASS_DESTINATION), null, null);

    Button subclassDestinationBrowse = toolkit.createButton(pathsSection, "Browse...", SWT.PUSH);
    subclassDestinationBrowse.addSelectionListener(new SelectionListener() {
      public void widgetDefaultSelected(SelectionEvent selectionevent) {
        widgetSelected(selectionevent);
      }

      public void widgetSelected(SelectionEvent selectionevent) {
        ContainerSelectionDialog containerDialog = new ContainerSelectionDialog(getEditorSite().getShell(), project, false, "Select the folder to generate customizable files into.");
        containerDialog.open();
        Object[] selectedContainers = containerDialog.getResult();
        if (selectedContainers != null && selectedContainers.length > 0) {
          IPath selectedPath = (IPath) selectedContainers[0];
          IFolder selectedFolder = project.getParent().getFolder(selectedPath);
          IPath projectRelativePath = selectedFolder.getProjectRelativePath();
          EOGeneratorFormPage.this.getModel().setSubclassDestination(projectRelativePath.toPortableString());
View Full Code Here

    public void widgetSelected(SelectionEvent event) {
      FileEditorInput editorInput = (FileEditorInput) getEditorInput();
      IFile eogenFile = editorInput.getFile();
      IProject project = eogenFile.getProject();
      ContainerSelectionDialog containerDialog = new ContainerSelectionDialog(getEditorSite().getShell(), project, false, "Select the EOModel to add.");
      containerDialog.open();
      Object[] selectedContainers = containerDialog.getResult();
      if (selectedContainers != null && selectedContainers.length > 0) {
        IPath selectedPath = (IPath) selectedContainers[0];
        IFolder selectedFolder = project.getParent().getFolder(selectedPath);
        IPath modelPath = selectedFolder.getLocation();
        EOModelReference eoModel = new EOModelReference(modelPath);
View Full Code Here

   * 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

   * Prompts the user for a working directory location within the workspace
   * and sets the working directory as a String containing the workspace_loc
   * variable or <code>null</code> if no location was obtained from the user.
   */
  protected void handleWorkspaceWorkingDirectoryButtonSelected() {
    ContainerSelectionDialog containerDialog;
    containerDialog = new ContainerSelectionDialog(
      getShell(),
      ResourcesPlugin.getWorkspace().getRoot(),
      false,
      ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_23);
    containerDialog.open();
    Object[] resource = containerDialog.getResult();
    String text= null;
    if (resource != null && resource.length > 0) {
      text= newVariableExpression("workspace_loc", ((IPath)resource[0]).toString()); //$NON-NLS-1$
    }
    if (text != null) {
View Full Code Here

     * 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

TOP

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

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.