Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog


    });
    Button browseInputResource = new Button(inputResourceGroup, SWT.NONE);
    browseInputResource.setText("Browse ...");
    browseInputResource.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
                new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setTitle("Select input folder");
        dialog.setMessage("Select input folder");

        dialog.setInput(getProject().getProject());
        dialog.setInitialSelection(getWorkspaceRoot().findMember(inputText.getText()));
        if (dialog.open() == IDialogConstants.OK_ID) {
          IResource resource = (IResource) dialog.getFirstResult();
          if (resource != null) {
            String fileLoc = resource.getFullPath().toString();
            inputText.setText(fileLoc);
          }
        }
      }
    });

    recursivelyButton = new Button(inputResourceGroup, SWT.CHECK);
    recursivelyButton.setText("Recursively");
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false)
            .applyTo(recursivelyButton);
    recursivelyButton.addSelectionListener(new SelectionListener() {

      public void widgetSelected(SelectionEvent event) {
        updateLaunchConfigurationDialog();
      }

      public void widgetDefaultSelected(SelectionEvent event) {
      }
    });

   
   
    Label viewLabel = new Label(inputResourceGroup, SWT.NONE);
    viewLabel.setText("View Name:");
    viewText = new Text(inputResourceGroup, SWT.BORDER);
    GridDataFactory.swtDefaults().hint(250, SWT.DEFAULT).align(SWT.LEFT, SWT.CENTER)
            .grab(true, false).applyTo(viewText);
    viewText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent event) {
        updateLaunchConfigurationDialog();
      }
    });

    Group outputFolderGroup = new Group(composite, SWT.None);
    outputFolderGroup.setText("Output Folder:");
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false)
            .applyTo(outputFolderGroup);
    GridLayout outputFolderGroupLayout = new GridLayout(2, false);
    outputFolderGroup.setLayout(outputFolderGroupLayout);
    outputFolderText = new Text(outputFolderGroup, SWT.BORDER);
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false)
            .applyTo(outputFolderText);
    outputFolderText.addModifyListener(new ModifyListener() {

      public void modifyText(ModifyEvent event) {
        updateLaunchConfigurationDialog();
      }
    });

    Button browseOutputFolderButton = new Button(outputFolderGroup, SWT.NONE);
    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


    setErrorMessage(message);
    setPageComplete(message == null);
  }

  private void handleBrowse() {   
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select tarjet Project");
      dialog.setMessage("Select the target project for the new agent:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
            }
            catch(CoreException e1){
              return false;
            }   
          }
          return false;
        }
      });   
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IProject p = (IProject) result[0];
      projectText.setText(p.getName());
      selectedProject = p;
      dialogChanged();
    }
View Full Code Here

    setErrorMessage(message);
    setPageComplete(message == null);
  }

  private void handleBrowse() {   
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select target Project");
      dialog.setMessage("Select the target project for the new agent:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
            }
            catch(CoreException e1){
              return false;
            }   
          }
          return false;
        }
      });   
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IProject p = (IProject) result[0];
      projectText.setText(p.getName());
      selectedProject = p;
      dialogChanged();
    }
View Full Code Here

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

  private void handleBrowse() {   
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select target Capability");
      dialog.setMessage("Select the target capability file:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
              else{
                return false;
              }
            }
            catch(CoreException e1){
              return false;
            }
          }
          else{
            if(element instanceof IFile){
              IFile file = (IFile) element;
              try{
                if(file.getName().endsWith("capability.xml")){
                  return true;
                }
                else{
                  return false;
                }
              }
              catch(Exception e1){
                return false;
              }
            }
           
          }
          return true;
        }
      });
      dialog.setValidator(new ISelectionStatusValidator() {
       
        @Override
        public IStatus validate(Object[] selection) {
          if(selection.length == 1){
            if(selection[0] instanceof IFile){
              IFile fileSel = (IFile) selection[0];
              if(fileSel.getName().endsWith("capability.xml")){
                return ValidationStatus.ok();
              }
            }
          }
          return ValidationStatus.error("Invalid selection");
        }
      });
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IFile f = (IFile) result[0];
      capabilityFileText.setText(f.getRawLocation().toOSString());
      dialogChanged();
    }
  }
View Full Code Here

    dialogChanged();
    setControl(container);
  }
 
  private void handleBrowse() {   
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select target Project");
      dialog.setMessage("Select the target project for the new capabilites:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
            }
            catch(CoreException e1){
              return false;
            }   
          }
          return false;
        }
      });   
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IProject p = (IProject) result[0];
      projectText.setText(p.getName());
      selectedProject = p;
      dialogChanged();
    }
View Full Code Here

    setErrorMessage(message);
    setPageComplete(message == null);
  }

  private void handleBrowse() {   
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select target Project");
      dialog.setMessage("Select the target project for the new agent:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
            }
            catch(CoreException e1){
              return false;
            }   
          }
          return false;
        }
      });   
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IProject p = (IProject) result[0];
      projectText.setText(p.getName());
      selectedProject = p;
      dialogChanged();
    }
View Full Code Here

    }
  }
 
  private void handleBrowse() {
    fileList = new ArrayList<IFile>();
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select target Capability");
      dialog.setMessage("Select the target capability file:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
              else{
                return false;
              }
            }
            catch(CoreException e1){
              return false;
            }
          }
          else{
            if(element instanceof IFile){
              IFile file = (IFile) element;
              try{
                if(file.getName().endsWith("capability.xml")){
                  return true;
                }
                else{
                  return false;
                }
              }
              catch(Exception e1){
                return false;
              }
            }
           
          }
          return true;
        }
      });
      dialog.setValidator(new ISelectionStatusValidator() {
       
        @Override
        public IStatus validate(Object[] selection) {
          if(selection.length == 1){
            if(selection[0] instanceof IFile){
              IFile fileSel = (IFile) selection[0];
              if(fileSel.getName().endsWith("capability.xml")){
                return ValidationStatus.ok();
              }
            }
          }
          return ValidationStatus.error("Invalid selection");
        }
      });
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IFile f = (IFile) result[0];
      fileList.add(0, f);
      capabilityFileText.setText(f.getRawLocation().toOSString());
      dialogChanged();
     
View Full Code Here

    dialogChanged();
    setControl(container);
  }
 
  private void handleBrowse() {   
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select target Project");
      dialog.setMessage("Select the target project for the new capabilites:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
            }
            catch(CoreException e1){
              return false;
            }   
          }
          return false;
        }
      });   
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IProject p = (IProject) result[0];
      projectText.setText(p.getName());
      selectedProject = p;
      dialogChanged();
    }
View Full Code Here

    setErrorMessage(message);
    setPageComplete(message == null);
  }

  private void handleBrowse() {   
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select target Project");
      dialog.setMessage("Select the target project for the new agent:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
            }
            catch(CoreException e1){
              return false;
            }   
          }
          return false;
        }
      });   
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IProject p = (IProject) result[0];
      projectText.setText(p.getName());
      selectedProject = p;
      dialogChanged();
    }
View Full Code Here

    setControl(container);
  }
 
  private void handleBrowse() {
    fileList = new ArrayList<IFile>();
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
          getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
      dialog.setTitle("Select target Capability");
      dialog.setMessage("Select the target capability file:");
      dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
      dialog.setAllowMultiple(false);
      dialog.addFilter(new ViewerFilter() {       
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
          if(element instanceof IProject){
            IProject p = (IProject) element;
            try{
              if(p.hasNature(JadexProjectNature.NATURE_ID)){
                return true;
              }
              else{
                return false;
              }
            }
            catch(CoreException e1){
              return false;
            }
          }
          else{
            if(element instanceof IFile){
              IFile file = (IFile) element;
              try{
                if(file.getName().endsWith("capability.xml")){
                  return true;
                }
                else{
                  return false;
                }
              }
              catch(Exception e1){
                return false;
              }
            }
           
          }
          return true;
        }
      });
      dialog.setValidator(new ISelectionStatusValidator() {
       
        @Override
        public IStatus validate(Object[] selection) {
          if(selection.length == 1){
            if(selection[0] instanceof IFile){
              IFile fileSel = (IFile) selection[0];
              if(fileSel.getName().endsWith("capability.xml")){
                return ValidationStatus.ok();
              }
            }
          }
          return ValidationStatus.error("Invalid selection");
        }
      });
    if (dialog.open() == ResourceSelectionDialog.OK) {
      Object[] result = dialog.getResult();
      IFile f = (IFile) result[0];
      fileList.add(0, f);
      capabilityFileText.setText(f.getRawLocation().toOSString());
      dialogChanged();
      try {
View Full Code Here

TOP

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

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.