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