1 11 package org.eclipse.ui.internal.dialogs; 12 13 import java.util.ArrayList ; 14 15 import org.eclipse.jface.preference.PreferenceContentProvider; 16 import org.eclipse.ui.activities.WorkbenchActivityHelper; 17 18 23 public class FilteredPreferenceContentProvider extends PreferenceContentProvider { 24 25 29 public FilteredPreferenceContentProvider() { 30 } 32 33 36 public Object [] getChildren(Object parentElement) { 37 Object [] children = super.getChildren(parentElement); 38 ArrayList filteredChildren = new ArrayList (children.length); 39 for (int i = 0; i < children.length; i++) { 40 if (WorkbenchActivityHelper.filterItem(children[i])) 41 continue; 42 43 filteredChildren.add(children[i]); 44 } 45 return filteredChildren.toArray(); 46 } 47 48 49 52 public Object getParent(Object element) { 53 Object parent = super.getParent(element); 54 if (WorkbenchActivityHelper.filterItem(parent)) 55 return null; 56 return parent; 57 } 58 } 59 | Popular Tags |