Examples of ElementTreeSelectionDialog


Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

    ISelectionStatusValidator validator = getContainerDialogSelectionValidator();
    ViewerFilter filter = getContainerDialogViewerFilter();
    ITreeContentProvider contentProvider = new WorkbenchContentProvider();
    ILabelProvider labelProvider = new DecoratingLabelProvider(new WorkbenchLabelProvider(), PlatformUI.getWorkbench()
        .getDecoratorManager().getLabelDecorator());
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, contentProvider);
    dialog.setValidator(validator);
    dialog.setTitle(WizardConstants.CONTAINER_SELECTION_DIALOG_TITLE);
    dialog.setMessage(WizardConstants.CONTAINER_SELECTION_DIALOG_DESC);
    dialog.addFilter(filter);
    String projectName = projectNameCombo.getText();;
    if (projectName==null || projectName.length()==0)
      return;
    IProject project = ResourcesPlugin.getWorkspace().getRoot().findMember(projectName).getProject();
    dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());

    if (project != null)
      dialog.setInitialSelection(project);
    if (dialog.open() == Window.OK) {
      Object element = dialog.getFirstResult();
      try {
        if (element instanceof IContainer) {
          IContainer container = (IContainer) element;
          folderText.setText(container.getFullPath().toString());
          model.put("JAVA_PACKAGE_FRAGMENT_ROOT", null);
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

            return null;
          }

        }
        ;
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new ProjectContentProvider());
        dialog.setTitle("Project Selection");
        dialog.setMessage("Select a project:");
        dialog.setComparator(new ViewerComparator());

        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());

        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null
              && dialog.getFirstResult() instanceof IProject

          )
          {
            IProject project = ((IProject) dialog.getFirstResult());
            setProject(project);
           
            //setProjectAndsearchModels(project);

            // selectScenarioButton.setEnabled(true);
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

            return null;
          }

        }
        ;
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new ProjectContentProvider());
        dialog.setTitle("Project Selection");
        dialog.setMessage("Select a project:");
        dialog.setComparator(new ViewerComparator());

        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());

        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null
              && dialog.getFirstResult() instanceof IProject

          )
          {
            IProject project = ((IProject) dialog.getFirstResult());
            setProject(project);

            // setProjectAndsearchModels(project);

            // selectScenarioButton.setEnabled(true);
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

    selectScenarioButton.addSelectionListener(new SelectionAdapter()
    {
      @Override
      public void widgetSelected(SelectionEvent e)
      {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
        dialog.setTitle("Scenario Selection");
        dialog.setMessage("Select a scenario:");
        dialog.setComparator(new ViewerComparator());
        dialog.addFilter(new FileExtensionFilter("script", "script2"));
        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot().getProject(fProjectText.getText()).getFolder("scenarios"));

        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null)
          {
            fScenarioText.setText(((IFile) dialog.getFirstResult()).getProjectRelativePath().toString());
            removeScenarioButton.setEnabled(true);
          }

        }
      }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

    selectCtPathButton.addSelectionListener(new SelectionAdapter()
    {
      @Override
      public void widgetSelected(SelectionEvent e)
      {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
        dialog.setTitle("20-Sim Model Selection");
        dialog.setMessage("Select a 20-Sim Model:");
        dialog.setComparator(new ViewerComparator());
        dialog.addFilter(new FileExtensionFilter("emx"));
        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot().getProject(fProjectText.getText()).getFolder("model_ct"));

        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null)
          {
            ctPath.setText(((IFile) dialog.getFirstResult()).getProjectRelativePath().toString());

          }
        }
      }
    });
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

              return super.hasChildren(element);
            }
          }
        }
        ;
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new ProjectContentProvider());
        dialog.setTitle("Project Selection");
        dialog.setMessage("Select a project:");
        dialog.setComparator(new ViewerComparator());
        dialog.addFilter(new ViewerFilter()
        {
          @Override
          public boolean select(Viewer viewer, Object parentElement,
              Object element)
          {
            try
            {
              return element instanceof IProject
                  && ((IProject) element).hasNature(IDestecsCoreConstants.NATURE);
            } catch (CoreException e)
            {
              return false;
            }
          }
        });

        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());

        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null
              && dialog.getFirstResult() instanceof IProject

          )
          {
            IProject project = ((IProject) dialog.getFirstResult());
            if (project == null)
            {
              // Show error
              return;
            }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

    selectArchitecturePathButton.addSelectionListener(new SelectionAdapter()
    {
      @Override
      public void widgetSelected(SelectionEvent e)
      {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
        dialog.setTitle("Architecture Selection");
        dialog.setMessage("Select an architecture:");
        dialog.setComparator(new ViewerComparator());
        dialog.addFilter(new FileExtensionFilter(true,"arch"));
        dialog.setValidator(new ISelectionStatusValidator()
        {
         
          public IStatus validate(Object[] selection)
          {
            if (selection.length == 1 && selection[0] instanceof IFile)
            {
              return Status.OK_STATUS;
            }
            else return new Status(IStatus.ERROR,DestecsDebugPlugin.PLUGIN_ID,"Invalid selection. Selection must be a file.");
             
          }
        });

        for (ILaunchConfigurationTab tab : getLaunchConfigurationDialog().getTabs())
        {
          if (tab instanceof CoSimLaunchConfigurationTab)
          {
            CoSimLaunchConfigurationTab cosimLaunchTab = (CoSimLaunchConfigurationTab) tab;
            IProject project = cosimLaunchTab.getProject();
            if (project != null)
            {
              dialog.setInput(project.getFolder("model_de/architectures"));
            }
          }
        }
        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null)
          {
            fArchitecturePathText.setText(((IFile) dialog.getFirstResult()).getProjectRelativePath().toString());

          }

        }
      }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

              return super.hasChildren(element);
            }
          }
        }
        ;
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new ProjectContentProvider());
        dialog.setTitle("Project Selection");
        dialog.setMessage("Select a project:");
        dialog.setComparator(new ViewerComparator());
        dialog.addFilter(new ViewerFilter()
        {
          @Override
          public boolean select(Viewer viewer, Object parentElement,
              Object element)
          {
            try
            {
              return element instanceof IProject
                  && ((IProject) element).hasNature(IDestecsCoreConstants.NATURE);
            } catch (CoreException e)
            {
              return false;
            }
          }
        });

        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());

        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null
              && dialog.getFirstResult() instanceof IProject

          )
          {
            IProject project = ((IProject) dialog.getFirstResult());
            if (project == null)
            {
              // Show error
              return;
            }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

    selectPathToConfigsButton.addSelectionListener(new SelectionAdapter()
    {
      @Override
      public void widgetSelected(SelectionEvent e)
      {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
        dialog.setTitle("Folder Selection");
        dialog.setMessage("Select a Folder:");
        dialog.setComparator(new ViewerComparator());
        dialog.addFilter(new FolderFilter());
        dialog.setValidator(new ISelectionStatusValidator()
        {
         
          public IStatus validate(Object[] selection)
          {
            if (selection.length == 1 && selection[0] instanceof IFolder)
            {
              return Status.OK_STATUS;
            }
            else return new Status(IStatus.ERROR,DestecsDebugPlugin.PLUGIN_ID,"Invalid selection. Selection must be a file.");
             
          }
        });

        if(fProjectText.getText() != null && !fProjectText.getText().trim().isEmpty() )
        {
          IProject project = getProject();
          dialog.setInput(project);
        }
         
       
        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null)
          {
            fPathToConfigsText.setText(((IFolder) dialog.getFirstResult()).getProjectRelativePath().toString());

          }

        }
      }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog

          {
            return false;
          }
        }
        ;
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), DebugUITools.newDebugModelPresentation(), new LaunchConfigContentProvider());
        dialog.setTitle("Base Launch Configuration Selection");
        dialog.setMessage("Select a launch configuration:");
        dialog.setComparator(new ViewerComparator());

        try
        {
          // see class: LaunchConfigurationFilteredTree and LaunchConfigurationView for launchconfig display
          dialog.setInput(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(getConfigurationType()));
        } catch (CoreException e1)
        {
          DestecsDebugPlugin.log(e1);
        }

        if (dialog.open() == Window.OK)
        {
          if (dialog.getFirstResult() != null
              && dialog.getFirstResult() instanceof ILaunchConfiguration

          )
          {
            fBaseLaunchConfigNameText.setText(((ILaunchConfiguration) dialog.getFirstResult()).getName());
          }

        }
      }
    });
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.