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.internal.ui.DebugUIPlugin; 16 import org.eclipse.debug.ui.IDebugUIConstants; 17 import org.eclipse.jface.action.Action; 18 import org.eclipse.ui.PlatformUI; 19 20 public class FormatTableRenderingAction extends Action { 21 22 private AbstractBaseTableRendering fRendering; 23 24 int fColumnSize = -1; 25 int fRowSize = -1; 26 27 public FormatTableRenderingAction(AbstractBaseTableRendering rendering) 28 { 29 fRendering = rendering; 30 setText(DebugUIMessages.FormatTableRenderingAction_16); 31 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".FormatTableRenderingAction_context"); } 33 34 public void run() { 35 FormatTableRenderingDialog dialog = new FormatTableRenderingDialog(fRendering, DebugUIPlugin.getShell()); 36 dialog.open(); 37 fColumnSize = dialog.getColumnSize(); 38 fRowSize = dialog.getRowSize(); 39 if (fColumnSize > 0 && fRowSize > 0) 40 { 41 int addressableSize = fRendering.getAddressableSize(); 42 int columnSizeInBytes = addressableSize * fColumnSize; 43 int rowSizeInBytes = addressableSize * fRowSize; 44 fRendering.format(rowSizeInBytes, columnSizeInBytes); 45 } 46 } 47 } 48 | Popular Tags |