1 11 package org.eclipse.ui.internal.progress; 12 13 import org.eclipse.jface.viewers.IStructuredContentProvider; 14 import org.eclipse.jface.viewers.Viewer; 15 16 20 public abstract class ProgressContentProvider implements 21 IProgressUpdateCollector, IStructuredContentProvider { 22 23 26 private boolean canShowDebug = false; 27 28 32 public ProgressContentProvider() { 33 ProgressViewUpdater.getSingleton().addCollector(this); 34 } 35 36 42 public ProgressContentProvider(boolean debug) { 43 this(); 44 canShowDebug = debug; 45 } 46 47 52 public Object [] getElements(Object inputElement) { 53 54 return ProgressManager.getInstance().getRootElements(debug()); 55 } 56 57 62 public void dispose() { 63 ProgressViewUpdater.getSingleton().removeCollector(this); 64 } 65 66 72 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 73 } 75 76 82 public boolean debug(){ 83 if(!canShowDebug) { 84 return false; 85 } 86 return ProgressViewUpdater.getSingleton().debug; 87 88 } 89 90 } 91 | Popular Tags |