1 11 package org.eclipse.debug.internal.ui.views.memory; 12 13 import org.eclipse.debug.internal.ui.DebugPluginImages; 14 import org.eclipse.debug.internal.ui.DebugUIMessages; 15 import org.eclipse.debug.internal.ui.IDebugHelpContextIds; 16 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; 17 import org.eclipse.debug.ui.IDebugUIConstants; 18 import org.eclipse.jface.action.Action; 19 import org.eclipse.ui.PlatformUI; 20 21 class ViewPaneOrientationAction extends Action 22 { 23 private MemoryView fView; 24 private int fOrientation; 25 26 ViewPaneOrientationAction(MemoryView view, int orientation) 27 { 28 super("", AS_RADIO_BUTTON); fView = view; 30 fOrientation = orientation; 31 32 if (orientation == MemoryView.HORIZONTAL_VIEW_ORIENTATION) { 33 setText(DebugUIMessages.ViewPaneOrientationAction_0); 34 setToolTipText(DebugUIMessages.ViewPaneOrientationAction_1); 35 setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_RIGHT)); 36 setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_RIGHT)); 37 setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_RIGHT)); 38 } else if (orientation == MemoryView.VERTICAL_VIEW_ORIENTATION) { 39 setText(DebugUIMessages.ViewPaneOrientationAction_2); 40 setToolTipText(DebugUIMessages.ViewPaneOrientationAction_3); 41 setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_UNDER)); 42 setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_UNDER)); 43 setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_UNDER)); 44 } 45 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.MEMORY_VIEW_PANE_ORIENTATION_ACTION); 46 } 47 48 public void run() { 49 fView.setViewPanesOrientation(fOrientation); 50 } 51 52 public int getOrientation() 53 { 54 return fOrientation; 55 } 56 } 57 | Popular Tags |