Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TreeViewer


  }

  protected TreeViewer createTreeViewer(Composite parent) {
    int style = SWT.BORDER | SWT.SINGLE;

    TreeViewer treeViewer = new TreeViewer(new Tree(parent, style));   
    treeViewer.setContentProvider(new WorkbenchContentProvider());
    treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
    treeViewer.setComparator(new NameSorter());
    treeViewer.addFilter(getFilter());   
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    treeViewer.setInput(workspaceRoot);
    IStructuredSelection preSelection = getPreSelection(_workspaceSelection);
    if (preSelection != null) {
      treeViewer.setSelection(preSelection);
    }
    return treeViewer;
  }
View Full Code Here


       
        schemaSection.setTextClient(schemaSectionToolBar);
       
       
       
        _treeViewer = new TreeViewer(tree);
        _treeViewer.setContentProvider(new WGASchemaDefinitionContentProvider());              
        _treeViewer.setLabelProvider(new WGASchemaDefinitionLabelProvider());       
        _treeViewer.setComparator(new ViewerComparator() {

            @Override
View Full Code Here

  }

  protected TreeViewer createTreeViewer(Composite parent) {
    int style = SWT.BORDER | (false ? SWT.MULTI : SWT.SINGLE);

    TreeViewer tableViewer = new TreeViewer(new Tree(parent, style));
    tableViewer.setContentProvider(new WorkbenchContentProvider());
    tableViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
    tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        updateOKStatus();
      }
    });

    tableViewer.setComparator(new NameSorter());
    tableViewer.addFilter((ViewerFilter) new WGADesignViewerFilter(null));
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    tableViewer.setInput(workspaceRoot);
    return tableViewer;
  }
View Full Code Here

  }

  protected TreeViewer createTreeViewer(Composite parent) {
    int style = SWT.BORDER | SWT.SINGLE;

    TreeViewer tableViewer = new TreeViewer(new Tree(parent, style));
    tableViewer.setContentProvider(new WorkbenchContentProvider());
    tableViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
    tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        updateOKStatus();
      }
    });

    tableViewer.setComparator(new NameSorter());
    tableViewer.addFilter((ViewerFilter) new WGADesignViewerFilter(_selectedProject));

    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    tableViewer.setInput(workspaceRoot);
    return tableViewer;
  }
View Full Code Here

      }
    }
  }

  private void expandNewsTableViewerGroups(boolean delayRedraw, ISelection oldSelection) {
    TreeViewer viewer = fNewsTableControl.getViewer();
    Tree tree = (Tree) viewer.getControl();

    /* Remember TopItem if required */
    TreeItem topItem = oldSelection.isEmpty() ? tree.getTopItem() : null;

    /* Expand All & Restore Selection with redraw false */
    if (delayRedraw)
      tree.getParent().setRedraw(false);
    try {
      viewer.expandAll();

      /* Restore selection if required */
      if (!oldSelection.isEmpty() && viewer.getSelection().isEmpty())
        viewer.setSelection(oldSelection, true);
      else if (topItem != null)
        tree.setTopItem(topItem);
    } finally {
      if (delayRedraw)
        tree.getParent().setRedraw(true);
View Full Code Here

    }
  }

  /* TODO This is a Workaround until Eclipse Bug #159586 is fixed */
  private void stableSetInputToNewsTable(Object input, ISelection oldSelection) {
    TreeViewer viewer = fNewsTableControl.getViewer();
    Tree tree = (Tree) viewer.getControl();

    /* Set Input & Restore Selection with redraw false */
    tree.getParent().setRedraw(false);
    try {
      fNewsTableControl.setPartInput(input);

      /* Restore selection if required */
      if (oldSelection != null) {
        fNewsTableControl.setBlockNewsStateTracker(true);
        try {
          viewer.setSelection(oldSelection);
        } finally {
          fNewsTableControl.setBlockNewsStateTracker(false);
        }
      }

View Full Code Here

    fFolderViewerContainer.setBackground(fParent.getDisplay().getSystemColor(SWT.COLOR_WHITE));

    Label separator = new Label(fFolderViewerContainer, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    fFolderViewer = new TreeViewer(fFolderViewerContainer, SWT.None);
    fFolderViewer.setAutoExpandLevel(2);
    fFolderViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    fFolderViewer.getTree().setData(ApplicationWorkbenchWindowAdvisor.FOCUSLESS_SCROLL_HOOK, new Object());

    fViewerHeight = fFolderViewer.getTree().getItemHeight() * 10 + 12;
View Full Code Here

    }
    fViewer.getTree().setFocus();
  }

  private void createViewer(Composite container) {
    fViewer = new TreeViewer(container, SWT.FULL_SELECTION | SWT.BORDER | SWT.SINGLE);
    fViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    /* Content Provider */
    fViewer.setContentProvider(new ITreeContentProvider() {
      public Object[] getElements(Object inputElement) {
View Full Code Here

    GridData lData = new GridData(GridData.FILL_BOTH);
    lData.grabExcessHorizontalSpace = true;
    lData.grabExcessVerticalSpace = true;
    mTree.setLayoutData(lData);

    mTreeViewer = new TreeViewer(mTree);
    mTreeViewer.setContentProvider(this);
    mTreeViewer.setLabelProvider(this);
    // mTreeViewer.setAutoExpandLevel(2);
    buildColumns();
  }
View Full Code Here

    fFolderViewerContainer.setBackground(fParent.getDisplay().getSystemColor(SWT.COLOR_WHITE));

    Label separator = new Label(fFolderViewerContainer, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    fFolderViewer = new TreeViewer(fFolderViewerContainer, SWT.None);
    fFolderViewer.setAutoExpandLevel(2);
    fFolderViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    fFolderViewer.getTree().setData(ApplicationWorkbenchWindowAdvisor.FOCUSLESS_SCROLL_HOOK, new Object());

    fViewerHeight = fFolderViewer.getTree().getItemHeight() * 10 + 12;
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.TreeViewer

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.