1 11 package org.eclipse.ui.internal; 12 13 import org.eclipse.ui.IEditorPart; 14 import org.eclipse.ui.IWorkbenchWindow; 15 16 19 public class CloseEditorAction extends ActiveEditorAction { 20 25 public CloseEditorAction(IWorkbenchWindow window) { 26 super(WorkbenchMessages.CloseEditorAction_text, window); 27 setToolTipText(WorkbenchMessages.CloseEditorAction_toolTip); 28 setId("close"); window.getWorkbench().getHelpSystem().setHelp(this, 30 IWorkbenchHelpContextIds.CLOSE_PART_ACTION); 31 setActionDefinitionId("org.eclipse.ui.file.close"); } 33 34 37 public void run() { 38 IEditorPart part = getActiveEditor(); 39 if (part != null) { 40 getActivePage().closeEditor(part, true); 41 } 42 } 43 } 44 | Popular Tags |