Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ViewerFilter


    private boolean evaluateIfTreeEmpty(Object input) {
        Object[] elements = fContentProvider.getElements(input);
        if (elements.length > 0) {
            if (fFilters != null) {
                for (int i = 0; i < fFilters.size(); i++) {
                    ViewerFilter curr = (ViewerFilter) fFilters.get(i);
                    elements = curr.filter(fViewer, input, elements);
                }
            }
        }
        return elements.length == 0;
    }
View Full Code Here


      }

      // filter the elements using provided ViewerFilters
      if (filters != null && filteredElements != null) {
        for (Iterator iter = filters.iterator(); iter.hasNext();) {
          ViewerFilter f = (ViewerFilter) iter.next();
          filteredElements = f.filter(list, parent, filteredElements);
          if (monitor != null)
            monitor.worked(ticks);
        }
      }
View Full Code Here

        final TableViewer viewer = new TableViewer(table);
        viewer.setContentProvider(new RepositoryTreeContentProvider());
        viewer.setLabelProvider(new RepositoryTreeLabelProvider(false));
        viewer.setFilters(new ViewerFilter[] {
            new ViewerFilter() {
                @Override
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    return (element instanceof RepositoryPlugin) && ((RepositoryPlugin) element).canWrite();
                }
            }
View Full Code Here

        viewer.setContentProvider(new ImportsExportsTreeContentProvider());
        viewer.setSorter(new ImportsAndExportsViewerSorter());
        viewer.setLabelProvider(new ImportsExportsTreeLabelProvider());
        viewer.setAutoExpandLevel(2);

        hideSelfImportsFilter = new ViewerFilter() {
            @Override
            public boolean select(Viewer viewer, Object parentElement, Object element) {
                if (element instanceof ImportPackage) {
                    return !((ImportPackage) element).isSelfImport();
                } else if (element instanceof RequiredBundle) {
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  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);
View Full Code Here

    mTableViewer.setUseHashlookup(false);

    // Note: The type style is considered as the default
    mTableViewer.setContentProvider(new TypeGroupedContentProvider(editor, mTableViewer));
   
    mTableViewer.setFilters(new ViewerFilter[]{new ViewerFilter() {

      // TODO: Improve this filter ... it is to sloooooooooow
    @Override
    public boolean select(Viewer viewer, Object parentElement,
        Object element) {
View Full Code Here

      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
      }
    });

    typeTree.setFilters(new ViewerFilter[] { new ViewerFilter() {
      @Override
      public boolean select(Viewer viewer, Object parentElement, Object element) {

        // check if the string from the filterText is contained in the type name
        Type type = (Type) element;
View Full Code Here

                treeViewer));
        treeViewer.setInput(projectRegistry);

        // Limit the projects view to only show Maps and Pages (and not go any deeper)
        ViewerFilter[] filters = new ViewerFilter[1];
        filters[0] = new ViewerFilter(){
            public boolean select( Viewer viewer, Object parentElement, Object element ) {
                if (element instanceof ProjectElement && parentElement instanceof Project) {
                    ProjectElement mapElement = (ProjectElement) element;
                    Project projectElement = (Project) parentElement;
View Full Code Here

     * Return the ViewerFilter object that maps to the current selection
     * index of the wrapped Combo
     * @return the currently selected FileFilter.
     */
    public ViewerFilter getSelectedFilter() {
        ViewerFilter vf = null;
        int idx = theCombo.getSelectionIndex();
        if( idx > -1 ) {
            vf = (ViewerFilter)filters.get( idx );
        }
        return vf;
View Full Code Here

     * issue.
     * @return A ViewFilter that filters out resources that should not
     * be visible in the selection dialog.
     */
    private ViewerFilter createPolicyFilter() {
        return new ViewerFilter() {
            public boolean select(
                    Viewer viewer,
                    Object parentElement,
                    Object element) {

View Full Code Here

TOP

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

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.