Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ResourceSelectionDialog


    button.setFont(parent.getFont());

    SelectionListener listener = new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {

        ResourceSelectionDialog dialog = new ResourceSelectionDialog(getShell(), currentContainer,
                "Selection Dialog");
        dialog.setTitle("Selection Dialog");
        dialog.setMessage("Please select a file:");
        dialog.open();
        Object[] result = dialog.getResult();
        if (result[0] != null) {
          IResource res = (IResource) result[0];
          text.setText(res.getProjectRelativePath().toOSString());
        }
View Full Code Here


    button.setFont(parent.getFont());

    SelectionListener listener = new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {

        ResourceSelectionDialog dialog = new ResourceSelectionDialog(getShell(), currentContainer,
                "Selection Dialog");
        dialog.setTitle("Selection Dialog");
        dialog.setMessage("Please select a file:");
        dialog.open();
        Object[] result = dialog.getResult();
        if (result[0] != null) {
          IResource res = (IResource) result[0];
          text.setText(res.getProjectRelativePath().toOSString());
        }
View Full Code Here

    butChooseArch.addSelectionListener(new SelectionListener() {
      public void widgetDefaultSelected(SelectionEvent e) {
      }

      public void widgetSelected(SelectionEvent e) {
        ResourceSelectionDialog dlg = new ResourceSelectionDialog(comp
            .getShell(), ResourcesPlugin.getWorkspace().getRoot(),
            "Please select an Acme File");
        dlg.setBlockOnOpen(true);
        dlg.setHelpAvailable(false);
        dlg.setMessage("Select the Acme file that describes"
            + " the architecture of the project");

        if (dlg.open() == ResourceSelectionDialog.OK) {
          for (Object obj : dlg.getResult()) {
            if (obj instanceof IFile) {
              IFile file = (IFile) obj;
              if (file.getFileExtension() != null) {
                for (AdlType type : adlTypes) {
                  if (file.getName() != null &&
                      file.getName().endsWith(type.filenameEnding)) {
                    acmeFileText.setText(file.getFullPath()
                        .toString());
                  }
                }
              }
            }
          }
        }
      }
    });
   
    Label supportedFormats = new Label(comp, SWT.NONE);
    String supportedFormatsText = "The following architecture description formats are supported:";
    for (AdlType type : adlTypes) {
      supportedFormatsText += "\n" + type.name + " (*." + type.filenameEnding + ")";
    }
    supportedFormats.setText(supportedFormatsText);
    gd = new GridData();
    gd.horizontalSpan = 3;
    supportedFormats.setLayoutData(gd);
   
   
    // Architecture Mapping selection...
       
    butArchMappingPresent = new Button(comp, SWT.CHECK);
    butArchMappingPresent.setText("Use architecture mapping file");   
    gd = new GridData();
    gd.verticalIndent = 15;
    gd.horizontalSpan = 3;
    butArchMappingPresent.setLayoutData(gd);
    butArchMappingPresent.addSelectionListener(new SelectionListener() {
      public void widgetDefaultSelected(SelectionEvent e) {
      }

      public void widgetSelected(SelectionEvent e) {
        boolean selected = butArchMappingPresent.getSelection();
        butChooseArchMapping.setEnabled(selected);
        archMappingFileText.setEnabled(selected);
      }

    });
   
    Label archMappingLabel = new Label(comp, SWT.NONE);
    archMappingLabel.setText("Architecture mapping:");
   
   
    archMappingFileText = new Text(comp, SWT.BORDER);
    archMappingFileText.setText(pref.getArchitectureMappingFilename());
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    archMappingFileText.setLayoutData(gd);

    butChooseArchMapping = new Button(comp, SWT.NONE);
    butChooseArchMapping.setText("Choose Architecture Mapping...");
    butChooseArchMapping.addSelectionListener(new SelectionListener() {
      public void widgetDefaultSelected(SelectionEvent e) {
      }

      public void widgetSelected(SelectionEvent e) {
        ResourceSelectionDialog dlg = new ResourceSelectionDialog(comp
            .getShell(), ResourcesPlugin.getWorkspace().getRoot(),
            "Please select an Architecture Mapping File");
        dlg.setBlockOnOpen(true);
        dlg.setHelpAvailable(false);
        dlg.setMessage("Select the Architecture Mapping file that maps"
            + " the architecture to the implementation");

        if (dlg.open() == ResourceSelectionDialog.OK) {
          for (Object obj : dlg.getResult()) {
            if (obj instanceof IFile) {
              IFile file = (IFile) obj;
              if (file.getFileExtension() != null
                  && file.getFileExtension().equals("xml")) {
                archMappingFileText.setText(file.getFullPath()
View Full Code Here

   * Prompts the user for a workspace location within the workspace and sets
   * the location as a String containing the workspace_loc variable or
   * <code>null</code> if no location was obtained from the user.
   */
  protected void handleWorkspaceLocationButtonSelected() {
    ResourceSelectionDialog dialog;
    dialog = new ResourceSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Select_a_resource_22);
    dialog.open();
    Object[] results = dialog.getResult();
    if (results == null || results.length < 1) {
      return;
    }
    IResource resource = (IResource)results[0];
    locationField.setText(newVariableExpression("workspace_loc", resource.getFullPath().toString())); //$NON-NLS-1$
View Full Code Here

  public String getCapabilityFilePath() {
    return capabilityFileText.getText();
  }

  private void handleBrowse() {
    ResourceSelectionDialog dialog = new ResourceSelectionDialog(
        getShell(), ResourcesPlugin.getWorkspace().getRoot(),
        "Select capability definition file");
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        capabilityFileText.setText(((IFile)result[0]).getRawLocation().toOSString());
        dialogChanged();
      }
    }
View Full Code Here

  }
 
  private void handleProjectBrowse() {
    ModelingProject model = null;
   
    ResourceSelectionDialog dialog = new ResourceSelectionDialog(getShell(),
        ResourcesPlugin.getWorkspace().getRoot(), "Select a modeling project");
   
    if (dialog.open() == ContainerSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        IFile res = (IFile) result[0];
       
        modelFileText.setText(res.getFullPath().toString());
       
View Full Code Here

    dialogChanged();
    setControl(container);
  }
 
  private void handleProjectBrowse() {
    ResourceSelectionDialog dialog =
      new ResourceSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), "Select a modeling project");
    if (dialog.open() == ContainerSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        IFile res = (IFile) result[0];
       
        projectPathText.setText(res.getFullPath().toString());
       
View Full Code Here

    resourceLocationBrowseButton = toolkit.createButton(client, "Browse", SWT.PUSH);
    resourceLocationBrowseButton.setEnabled(false);
    resourceLocationBrowseButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        ResourceSelectionDialog dialog = new ResourceSelectionDialog(
            PlatformUI.getWorkbench().getDisplay().getActiveShell(),
            ResourcesPlugin.getWorkspace().getRoot(),
            "Select the resource");
        if (dialog.open() == ContainerSelectionDialog.OK) {
          if (dialog.getResult().length == 1) {
            org.eclipse.core.resources.IResource selectedRes = (org.eclipse.core.resources.IResource) dialog.getResult()[0];
            ExternalResource resource = (ExternalResource) getSelectedResource();
            resource.setLocation(selectedRes.getFullPath().toOSString());
            resourceSectionPart.markStale();
            resourceSectionPart.markDirty();
          } else {
View Full Code Here

  /**
   * Uses the standard container selection dialog to choose the new value for
   * the container field.
   */
  private void handleBrowse() {
    ResourceSelectionDialog dialog =
      new ResourceSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), "Select an UML resource");
    if (dialog.open() == ContainerSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        this.umlResourceText.setText(((IResource) result[0]).getFullPath().toString());
        this.dialogChanged();
      } else {
        updateStatus("You may select only one resource.");
View Full Code Here

    dialogChanged();
    setControl(container);
  }
 
  private void handleProjectBrowse() {
    ResourceSelectionDialog dialog =
      new ResourceSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), "Select a modeling project");
    if (dialog.open() == ContainerSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      if (result.length == 1) {
        IFile res = (IFile) result[0];
       
        projectPathText.setText(res.getFullPath().toString());
       
View Full Code Here

TOP

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

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.