1 11 package org.eclipse.ui.views.markers.internal; 12 13 14 import org.eclipse.jface.viewers.ITreeContentProvider; 15 import org.eclipse.jface.viewers.TreeViewer; 16 import org.eclipse.jface.viewers.Viewer; 17 18 24 public class MarkerTreeContentProvider implements ITreeContentProvider { 25 26 TreeViewer viewer; 27 28 boolean hierarchalMode = true; 29 30 private MarkerAdapter adapter; 31 32 35 MarkerTreeContentProvider() { 36 } 37 38 43 public Object [] getChildren(Object parentElement) { 44 if (parentElement instanceof MarkerNode) { 45 return ((MarkerNode) parentElement).getChildren(); 46 } 47 return Util.EMPTY_MARKER_ARRAY; 48 } 49 50 55 public Object getParent(Object element) { 56 if (element instanceof MarkerNode) { 57 return ((MarkerNode) element).getParent(); 58 } 59 return null; 60 } 61 62 67 public boolean hasChildren(Object element) { 68 if (element instanceof MarkerNode) { 69 return ((MarkerNode) element).getChildren().length > 0; 70 } 71 return false; 72 } 73 74 79 public Object [] getElements(Object inputElement) { 80 return adapter.getElements(); 81 } 82 83 88 public void dispose() { 89 } 91 92 98 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 99 this.viewer = (TreeViewer) viewer; 100 adapter = (MarkerAdapter) newInput; 101 102 } 103 } 104 | Popular Tags |