1 11 12 package org.eclipse.debug.internal.ui.views.memory; 13 14 import org.eclipse.debug.core.model.IMemoryBlock; 15 import org.eclipse.debug.internal.core.memory.MemoryBlockManager; 16 import org.eclipse.debug.internal.ui.DebugPluginImages; 17 import org.eclipse.debug.internal.ui.DebugUIMessages; 18 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; 19 import org.eclipse.debug.ui.IDebugUIConstants; 20 import org.eclipse.ui.help.WorkbenchHelp; 21 22 27 public class RemoveMemoryBlockAction extends AbstractMemoryAction { 28 29 30 public RemoveMemoryBlockAction() 31 { 32 setText(DebugUIMessages.getString("RemoveMemoryBlockAction.title")); 34 setToolTipText(DebugUIMessages.getString("RemoveMemoryBlockAction.tooltip")); setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_MEMORY)); 36 setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_REMOVE_MEMORY)); 37 setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_MEMORY)); 38 WorkbenchHelp.setHelp(this, IDebugUIConstants.PLUGIN_ID + ".RemoveMemoryBlockAction_context"); } 40 41 44 public void run() { 45 46 if (getViewTab() == null) 47 return; 48 49 IMemoryViewTab topTab = getViewTab(); 51 52 if (topTab != null) 54 { 55 IMemoryBlock mem = topTab.getMemoryBlock(); 56 MemoryBlockManager.getMemoryBlockManager().removeMemoryBlock(mem); 57 } 58 } 59 62 IMemoryViewTab getViewTab() { 63 return getTopViewTabFromView(IInternalDebugUIConstants.ID_MEMORY_VIEW); 64 } 65 } 66 | Popular Tags |