1 11 package org.eclipse.debug.internal.ui.actions; 12 13 import org.eclipse.debug.internal.ui.DebugPluginImages; 14 import org.eclipse.debug.internal.ui.IDebugHelpContextIds; 15 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; 16 import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; 17 import org.eclipse.debug.internal.ui.views.variables.VariablesView; 18 import org.eclipse.debug.ui.IDebugUIConstants; 19 import org.eclipse.jface.action.Action; 20 import org.eclipse.ui.PlatformUI; 21 22 30 public class ToggleDetailPaneAction extends Action { 31 32 private VariablesView fVariablesView; 33 34 private String fOrientation; 35 36 public ToggleDetailPaneAction(VariablesView view, String orientation, String hiddenLabel) { 37 super("", AS_RADIO_BUTTON); setVariablesView(view); 39 setOrientation(orientation); 40 41 if (orientation == IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH) { 42 setText(ActionMessages.ToggleDetailPaneAction_1); setToolTipText(ActionMessages.ToggleDetailPaneAction_2); setDescription(ActionMessages.ToggleDetailPaneAction_3); setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_UNDER)); 46 setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_UNDER)); 47 setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_UNDER)); 48 } else if (orientation == IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_RIGHT) { 49 setText(ActionMessages.ToggleDetailPaneAction_4); setToolTipText(ActionMessages.ToggleDetailPaneAction_5); setDescription(ActionMessages.ToggleDetailPaneAction_6); setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_RIGHT)); 53 setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_RIGHT)); 54 setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_RIGHT)); 55 } else { 56 setText(hiddenLabel); 57 setToolTipText(ActionMessages.ToggleDetailPaneAction_8); setDescription(ActionMessages.ToggleDetailPaneAction_9); setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_HIDE)); 60 setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_HIDE)); 61 setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_HIDE)); 62 } 63 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.SHOW_DETAIL_PANE_ACTION); 64 } 65 66 69 public void run() { 70 getVariablesView().setDetailPaneOrientation(getOrientation()); 71 } 72 73 private VariablesView getVariablesView() { 74 return fVariablesView; 75 } 76 77 private void setVariablesView(VariablesView variablesView) { 78 fVariablesView = variablesView; 79 } 80 81 private void setOrientation(String orientation) { 82 fOrientation = orientation; 83 } 84 85 public String getOrientation() { 86 return fOrientation; 87 } 88 } 89 90 | Popular Tags |