1 11 12 package org.eclipse.debug.internal.ui.views.memory.renderings; 13 14 import org.eclipse.debug.internal.ui.DebugUIMessages; 15 import org.eclipse.debug.ui.IDebugUIConstants; 16 import org.eclipse.debug.ui.memory.AbstractTableRendering; 17 import org.eclipse.jface.action.Action; 18 import org.eclipse.ui.PlatformUI; 19 20 21 26 public class FormatColumnAction extends Action 27 { 28 AbstractTableRendering fRendering; 29 int fNumBytesPerCol; 30 31 public FormatColumnAction(int numUnits, int addressableSize, AbstractTableRendering rendering) 32 { 33 String label; 34 if (numUnits == 1) 35 label = String.valueOf(numUnits) + " " + DebugUIMessages.FormatColumnAction_unit; else 37 label = String.valueOf(numUnits) + " " + DebugUIMessages.FormatColumnAction_units; 39 super.setText(label); 40 41 fRendering = rendering; 42 43 if (numUnits*addressableSize == fRendering.getBytesPerColumn()) 45 { 46 setChecked(true); 47 } 48 49 fNumBytesPerCol = numUnits*addressableSize; 50 51 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".FormatColumnAction_context"); } 53 56 public void run() 57 { 58 fRendering.format(fRendering.getBytesPerLine(), fNumBytesPerCol); 59 } 60 61 public int getColumnSize() 62 { 63 return fNumBytesPerCol; 64 } 65 66 } 67 | Popular Tags |