1 11 package org.eclipse.debug.internal.ui.views.memory.renderings; 12 13 import org.eclipse.debug.internal.ui.DebugUIMessages; 14 import org.eclipse.debug.internal.ui.DebugUIPlugin; 15 import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; 16 import org.eclipse.debug.ui.IDebugUIConstants; 17 import org.eclipse.debug.ui.memory.AbstractTableRendering; 18 import org.eclipse.jface.action.Action; 19 import org.eclipse.jface.preference.IPreferenceStore; 20 import org.eclipse.ui.PlatformUI; 21 22 27 public class SetColumnSizeDefaultAction extends Action { 28 private AbstractTableRendering fRendering; 29 30 public SetColumnSizeDefaultAction(AbstractTableRendering rendering) { 31 super(DebugUIMessages.SetColumnSizeDefaultAction_Set_as_default); 32 fRendering = rendering; 33 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".SetColumnSizeDefaultAction_context"); } 35 36 41 public void run() { 42 int numUnits = fRendering.getAddressableUnitPerColumn(); 43 44 IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore(); 45 prefStore.setValue(IDebugPreferenceConstants.PREF_COLUMN_SIZE, numUnits); 46 } 47 48 } 49 | Popular Tags |