1 11 package org.eclipse.ui.internal.dialogs; 12 13 import org.eclipse.jface.viewers.AbstractTreeViewer; 14 import org.eclipse.jface.viewers.ITreeContentProvider; 15 import org.eclipse.jface.viewers.Viewer; 16 import org.eclipse.jface.viewers.ViewerFilter; 17 import org.eclipse.ui.activities.WorkbenchActivityHelper; 18 import org.eclipse.ui.model.AdaptableList; 19 20 26 public class WizardActivityFilter extends ViewerFilter { 27 28 31 public boolean select(Viewer viewer, Object parentElement, Object element) { 32 Object [] children = ((ITreeContentProvider) ((AbstractTreeViewer) viewer) 33 .getContentProvider()).getChildren(element); 34 if (children.length > 0) { 35 return filter(viewer, element, children).length > 0; 36 } 37 38 if (parentElement.getClass().equals(AdaptableList.class)) { 39 return true; } 41 42 if (WorkbenchActivityHelper.filterItem(element)) { 43 return false; 44 } 45 46 return true; 47 } 48 } 49 | Popular Tags |