Examples of WorkbenchContentProvider


Examples of org.eclipse.ui.model.WorkbenchContentProvider

        btnAdd.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                // IResource newFile = ResourcesPlugin.getWorkspace().getRoot();
                // if(newFile != null) {
                ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
                dialog.setValidator(new ISelectionStatusValidator() {
                    public IStatus validate(Object[] selection) {
                        if (selection.length > 0 && selection[0] instanceof IFile) {
                            return new Status(IStatus.OK, Plugin.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$
                        }
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

  private IFolder chooseFolder(String title, String message, IPath initialPath) {
    Class[] acceptedClasses= new Class[] { IContainer.class };
    ViewerFilter filter= new TypedViewerFilter(acceptedClasses, null);

    ILabelProvider lp= new WorkbenchLabelProvider();
    ITreeContentProvider cp= new WorkbenchContentProvider();

    ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), lp, cp);
    dialog.setTitle(title);
    dialog.setMessage(message);
    dialog.addFilter(filter);
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

    Button browseButton = new Button(composite, SWT.PUSH);
    browseButton.setText("Browse ...");
    browseButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
                new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setTitle("Select descriptor");
        dialog.setMessage("Select descriptor");
        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
        dialog.setInitialSelection(ResourcesPlugin.getWorkspace().getRoot().
                findMember(typeSystemText.getText()));
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

                                    String dialogTitle, String dialogMessage)
    {
        IResource resource = null;
       
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
                new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setTitle(dialogTitle);
        dialog.setMessage(dialogMessage);
        dialog.setInput(root);
        dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
        int buttonId = dialog.open();
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

    public static IResource getWorkspaceResourceElement (Shell shell)
    {
        IResource resource = null;
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
                new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setTitle("Select Cpe descriptor");
        dialog.setMessage("Select Cpe Xml descriptor file");
        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
        dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
        int buttonId = dialog.open();
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

    Button browseDescriptor = new Button(descriptorGroup, SWT.NONE);
    browseDescriptor.setText("Browse ...");
    browseDescriptor.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
                new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setTitle("Select descriptor");
        dialog.setMessage("Select descriptor");
        dialog.setInput(getWorkspaceRoot());
        dialog.setInitialSelection(getWorkspaceRoot().findMember(descriptorText.getText()));
        if (dialog.open() == IDialogConstants.OK_ID) {
          IResource resource = (IResource) dialog.getFirstResult();
          if (resource != null) {
            String fileLoc = resource.getFullPath().toString();
            descriptorText.setText(fileLoc);
          }
        }
      }
    });
   
    // Input Resource Group
    Group inputResourceGroup = new Group(projectComposite, SWT.None);
    inputResourceGroup.setText("Input Resource:");
   
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).
            grab(true, false).applyTo(inputResourceGroup);
   
    GridLayout inputResourceGroupLayout = new GridLayout(2, false);
    inputResourceGroup.setLayout(inputResourceGroupLayout);
   
    inputText = new Text(inputResourceGroup, SWT.BORDER);
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).
            grab(true, false).applyTo(inputText);
    inputText.addModifyListener(new ModifyListener() {
     
      public void modifyText(ModifyEvent event) {
        updateLaunchConfigurationDialog();
      }
    });
   
    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 or file");
        dialog.setMessage("Select input folder or file");
        dialog.setInput(getSelectedProject());
        dialog.setInitialSelection(getWorkspaceRoot().findMember(inputText.getText()));
        if (dialog.open() == IDialogConstants.OK_ID) {
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

  }
 
  protected void openProgramPathDialog(IProject project) {
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
        getShell(), new WorkbenchLabelProvider(),
        new WorkbenchContentProvider());
    dialog.setTitle(LangUIMessages.mainTab_ProgramPath_searchButton_title);
    dialog.setMessage(LangUIMessages.mainTab_ProgramPath_searchButton_message);
   
    dialog.setInput(project);
    dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

  static IPath showWorkspaceDirectorySelectionDialog(Shell shell, String initialPath, IProject project) {
    String currentPathText = initialPath.replaceAll("\"", "");
    URI uri = URI.create(currentPathText);
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell, new WorkbenchLabelProvider(),
        new WorkbenchContentProvider());
    IWorkspaceRoot workspaceRoot = workspaceRoot();
    dialog.setInput(project == null ? workspaceRoot : project);
    dialog.setComparator(new ResourceComparator(NAME));
    IResource container = null;
    if (uri.isAbsolute()) {
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

    int displayHeight= parent.getDisplay().getClientArea().height;
    return (displayHeight / fontHeight) > 50;
  }

    private ITreeContentProvider getResourceProvider(final int resourceType) {
        return new WorkbenchContentProvider() {
            public Object[] getChildren(Object o) {
              if (o instanceof IWorkspaceRoot) {
                HashSet projects= new HashSet();
                for (int i= 0; i < fInput.length; i++) {
                  IResource project= fInput[i].getProject();
View Full Code Here

Examples of org.eclipse.ui.model.WorkbenchContentProvider

                                     QualifiedName qualifiedEntityId,
                                     ProjectProvider projectProvider,
                                     PolicyNameValidator policyNameValidator) {

        super(parentShell, new WorkbenchLabelProvider(),
                new WorkbenchContentProvider());

        // Set the instance entities
        this.policyNameValidator = policyNameValidator;
        this.qualifiedEntityId = qualifiedEntityId;
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.