Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.FilteredTree


//            data.heightHint = SIZING_LISTS_HEIGHT;
//        }
        composite.setLayoutData(data);

        filteredTreeFilter = new PatternFilter();//new WizardPatternFilter();
      FilteredTree filterTree = new FilteredTree(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, filteredTreeFilter, true);
   
    final TreeViewer treeViewer = filterTree.getViewer();
    //treeViewer.setContentProvider(new WizardContentProvider());
    treeViewer.setContentProvider(new XVRWizardTreeContentProvider());
    treeViewer.setSorter(new XVRWizardTreeSorter());
    treeViewer.setLabelProvider(new WorkbenchLabelProvider());
    //treeViewer.setComparator(NewWizardCollectionComparator.INSTANCE);
    treeViewer.addSelectionChangedListener(this);

        ArrayList<Object> inputArray = new ArrayList<Object>();

        for (int i = 0; i < primaryWizards.length; i++) {
            inputArray.add(primaryWizards[i]);
        }

        boolean expandTop = false;

        if (wizardCategories != null) {
            if (wizardCategories.getParent() == null) {
                IWizardCategory [] children = wizardCategories.getCategories();
                for (int i = 0; i < children.length; i++) {
                    inputArray.add(children[i]);
                }
            } else {
                expandTop = true;
                inputArray.add(wizardCategories);
            }
        }

        // ensure the category is expanded.  If there is a remembered expansion it will be set later.
        if (expandTop) {
      treeViewer.setAutoExpandLevel(2);
    }

        AdaptableList input = new AdaptableList(inputArray);

        treeViewer.setInput(input);

    filterTree.setBackground(parent.getDisplay().getSystemColor(
        SWT.COLOR_WIDGET_BACKGROUND));

        treeViewer.getTree().setFont(parent.getFont());

        treeViewer.addDoubleClickListener(new IDoubleClickListener() {
View Full Code Here


  protected abstract ITreeContentProvider createContentProvider();

  @Override
  public Composite createContents(Composite p) {

    fTree = new FilteredTree(p, getStyles(), createPatternFilter(), true);
    fTree.getFilterControl().setMessage(getFilterMessage());
    fTree.setBackground(PlatformUI.getWorkbench().getDisplay()
        .getSystemColor(SWT.COLOR_WHITE));

    final TreeViewer viewer = fTree.getViewer();
View Full Code Here

  public static FilteredTree newFilteredTree(
      Composite parent, PatternFilter filter) {
    GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(parent);

    int style = SWT.VIRTUAL | SWT.V_SCROLL | SWT.H_SCROLL;
    @SuppressWarnings("deprecation")
    // Need this for Eclipse 3.4:
    FilteredTree tree = new FilteredTree(parent, style, filter);
    tree.setBackground(parent.getBackground());
    tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    // Make it look a bit nicer for us:
    GridLayout layout = (GridLayout) tree.getLayout();
    layout.verticalSpacing = 0;
    layout = (GridLayout) tree.getFilterControl().getParent().getLayout();
    layout.marginHeight = 5;
    layout.marginWidth = 5;

    TreeViewer viewer = tree.getViewer();
    viewer.setUseHashlookup(true);
    viewer.getTree().setHeaderVisible(true);
    expandOnDoubleClick(viewer);
    clearEmptySelection(viewer);
View Full Code Here

  @BeforeClass
  public static void beforeClass() {
    shell = new Shell(PlatformUI.getWorkbench().getDisplay());
    shell.setLayout(new FillLayout());
    tree = new FilteredTree(shell, SWT.NONE, new PatternFilter(), false);
  }
View Full Code Here

            data.heightHint = SIZING_LISTS_HEIGHT;
        }
        composite.setLayoutData(data);

        filteredTreeFilter = new WizardPatternFilter();
      FilteredTree filterTree = new FilteredTree(composite,
          SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, filteredTreeFilter);
   
    final TreeViewer treeViewer = filterTree.getViewer();
    treeViewer.setContentProvider(new WizardContentProvider());
    treeViewer.setLabelProvider(new WorkbenchLabelProvider());
    treeViewer.setComparator(NewWizardCollectionComparator.INSTANCE);
    treeViewer.addSelectionChangedListener(this);

        ArrayList inputArray = new ArrayList();

        for (int i = 0; i < primaryWizards.length; i++) {
            inputArray.add(primaryWizards[i]);
        }

        boolean expandTop = false;

        if (wizardCategories != null) {
            if (wizardCategories.getParent() == null) {
                IWizardCategory [] children = wizardCategories.getCategories();
                for (int i = 0; i < children.length; i++) {
                    inputArray.add(children[i]);
                }
            } else {
                expandTop = true;
                inputArray.add(wizardCategories);
            }
        }

        // ensure the category is expanded.  If there is a remembered expansion it will be set later.
        if (expandTop) {
      treeViewer.setAutoExpandLevel(2);
    }

        AdaptableList input = new AdaptableList(inputArray);

        treeViewer.setInput(input);

    filterTree.setBackground(parent.getDisplay().getSystemColor(
        SWT.COLOR_WIDGET_BACKGROUND));

        treeViewer.getTree().setFont(parent.getFont());

        treeViewer.addDoubleClickListener(new IDoubleClickListener() {
View Full Code Here

     * @param parent the parent <code>Composite</code>.
     */
    private void createFilteredTreeViewer(Composite parent) {
    PatternFilter filter = new ViewPatternFilter();
    int styleBits = SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
    filteredTree = new FilteredTree(parent, styleBits, filter);
    filteredTree.setBackground(parent.getDisplay().getSystemColor(
        SWT.COLOR_WIDGET_BACKGROUND));
   
    TreeViewer treeViewer = filteredTree.getViewer();
    Control treeControl = treeViewer.getControl();
View Full Code Here

    private void createTree(Composite parent) {
        labelProvider = new PresentationLabelProvider();
        // create a new tree with a custom pattern matcher that will allow
        // non-category elements to be returned in the event that their children
        // do not
        tree = new FilteredTree(parent, SWT.SINGLE | SWT.H_SCROLL
                | SWT.V_SCROLL | SWT.BORDER, new PatternFilter() {
           
            /* (non-Javadoc)
             * @see org.eclipse.ui.dialogs.PatternFilter#isParentMatch(org.eclipse.jface.viewers.Viewer, java.lang.Object)
             */
 
View Full Code Here

     *
     * @param parent
     */
    private void createFilteredTree(Composite parent){       
      // Create a FilteredTree for the categories and wizards
      FilteredTree filteredTree = new FilteredTree(parent, SWT.SINGLE | SWT.H_SCROLL
                  | SWT.V_SCROLL | SWT.BORDER, new WizardPatternFilter());
          viewer = filteredTree.getViewer();
          filteredTree.setFont(parent.getFont());

          viewer.setContentProvider(new WizardContentProvider());
          viewer.setLabelProvider(new WorkbenchLabelProvider());
          viewer.setComparator(DataTransferWizardCollectionComparator.INSTANCE);
         
View Full Code Here

  private void initializeViewer(Composite parent) {
    PatternFilter patternFilter = new PatternFilter();
    patternFilter.setIncludeLeadingWildcard(true);

    FilteredTree tree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, patternFilter, true);

    viewer = tree.getViewer();
    setupTreeContentProvider();

    viewer.setLabelProvider(new LaunchTreeLabelProvider(runnerModel));
    viewer.addDoubleClickListener(this);
    viewer.setInput(getViewSite());
View Full Code Here

        createButton(parent, chooseButton, "Choose folder to analyze", chooseAction);
        //end choose button

        PatternFilter patternFilter = new PatternFilter();

        FilteredTree filter = PyFilteredTree.create(parent, patternFilter, true);
        layoutData = new GridData();
        layoutData.grabExcessHorizontalSpace = true;
        layoutData.grabExcessVerticalSpace = true;
        layoutData.horizontalAlignment = GridData.FILL;
        layoutData.verticalAlignment = GridData.FILL;
        layoutData.horizontalSpan = 2;
        filter.setLayoutData(layoutData);

        viewer = filter.getViewer();
        onControlCreated.call(viewer);
        viewer.setContentProvider(new FileTreePyFilesProvider());
        viewer.setLabelProvider(new FileTreeLabelProvider());
        viewer.addFilter(new AllowValidPathsFilter());
View Full Code Here

TOP

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

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.