1 11 package org.eclipse.debug.internal.ui.views.variables; 12 13 import org.eclipse.debug.internal.ui.DebugPluginImages; 14 import org.eclipse.debug.internal.ui.DebugUIPlugin; 15 import org.eclipse.debug.internal.ui.IDebugHelpContextIds; 16 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; 17 import org.eclipse.jface.action.Action; 18 import org.eclipse.jface.action.IAction; 19 import org.eclipse.swt.custom.BusyIndicator; 20 import org.eclipse.ui.PlatformUI; 21 22 28 public class ToggleLogicalStructureAction extends Action { 29 30 private VariablesView fView; 31 32 public ToggleLogicalStructureAction(VariablesView view) { 33 super(null, IAction.AS_CHECK_BOX); 34 setView(view); 35 setToolTipText(VariablesViewMessages.ToggleObjectBrowsersAction_1); 36 setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_SHOW_LOGICAL_STRUCTURE)); 37 setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_SHOW_LOGICAL_STRUCTURE)); 38 setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SHOW_LOGICAL_STRUCTURE)); 39 setId(DebugUIPlugin.getUniqueIdentifier() + ".ToggleObjectBrowsersAction"); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.VARIABLES_CONTENT_PROVIDERS_ACTION); 41 } 42 43 46 public void run() { 47 if (!getView().isAvailable()) { 48 return; 49 } 50 getView().setShowLogicalStructure(isChecked()); 51 BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable () { 52 public void run() { 53 getView().getViewer().refresh(); 54 } 55 }); 56 } 57 58 61 public void setChecked(boolean value) { 62 super.setChecked(value); 63 } 64 65 protected VariablesView getView() { 66 return fView; 67 } 68 69 protected void setView(VariablesView view) { 70 fView = view; 71 } 72 73 } 74 | Popular Tags |