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 NewWizardActivityFilter 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 if (parentElement.getClass().equals(AdaptableList.class)) 38 return true; 40 if (WorkbenchActivityHelper.filterItem(element)) 41 return false; 42 43 return true; 44 } 45 } 46 | Popular Tags |