1 11 package org.eclipse.debug.internal.ui.views.variables; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 import org.eclipse.core.runtime.IStatus; 15 import org.eclipse.core.runtime.Status; 16 import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer; 17 import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor; 18 import org.eclipse.swt.widgets.Composite; 19 import org.eclipse.ui.progress.UIJob; 20 21 25 public class VariablesViewer extends AsynchronousTreeViewer{ 26 27 private VariablesView fView; 28 29 private UIJob fRestoreJob = new UIJob("restore viewer state") { public IStatus runInUIThread(IProgressMonitor monitor) { 31 fView.restoreState(); 32 return Status.OK_STATUS; 33 } 34 }; 35 36 public VariablesViewer(Composite parent, int style, VariablesView view) { 37 super(parent, style); 38 fView = view; 39 fRestoreJob.setSystem(true); 40 } 41 42 protected void updateComplete(IAsynchronousRequestMonitor update) { 43 if (fView != null && !hasPendingUpdates()) { 44 fRestoreJob.schedule(); 45 fView.populateDetailPane(); 46 } 47 } 48 49 52 protected void handlePresentationFailure(IAsynchronousRequestMonitor update, IStatus status) { 53 fView.showMessage(status.getMessage()); 54 } 55 56 } 57 | Popular Tags |