1 11 package org.eclipse.jdt.internal.debug.ui.snippeteditor; 12 13 14 import org.eclipse.jdt.internal.debug.ui.IJavaDebugHelpContextIds; 15 import org.eclipse.jdt.internal.debug.ui.JavaDebugImages; 16 import org.eclipse.ui.PlatformUI; 17 18 22 public class StopAction extends SnippetAction { 23 24 public StopAction(JavaSnippetEditor editor) { 25 super(editor); 26 27 setText(SnippetMessages.getString("StopAction.label")); setToolTipText(SnippetMessages.getString("StopAction.tooltip")); setDescription(SnippetMessages.getString("StopAction.description")); 31 setImageDescriptor(JavaDebugImages.getImageDescriptor(JavaDebugImages.IMG_TOOL_TERMSNIPPET)); 32 setDisabledImageDescriptor(JavaDebugImages.getImageDescriptor(JavaDebugImages.IMG_TOOL_TERMSNIPPET_DISABLED)); 33 setHoverImageDescriptor(JavaDebugImages.getImageDescriptor(JavaDebugImages.IMG_TOOL_TERMSNIPPET_HOVER)); 34 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaDebugHelpContextIds.TERMINATE_SCRAPBOOK_VM_ACTION); 35 } 36 37 40 public void run() { 41 getEditor().shutDownVM(); 42 } 43 44 47 public void snippetStateChanged(JavaSnippetEditor editor) { 48 setEnabled(editor != null && editor.isVMLaunched()); 49 } 50 } 51 | Popular Tags |