1 11 package org.eclipse.ui.internal.presentations.util; 12 13 import org.eclipse.jface.action.Separator; 14 import org.eclipse.swt.graphics.Point; 15 import org.eclipse.swt.widgets.Control; 16 import org.eclipse.ui.internal.WorkbenchMessages; 17 import org.eclipse.ui.internal.presentations.SystemMenuCloseAll; 18 import org.eclipse.ui.internal.presentations.SystemMenuCloseOthers; 19 import org.eclipse.ui.internal.presentations.SystemMenuNewEditor; 20 import org.eclipse.ui.presentations.IPresentablePart; 21 import org.eclipse.ui.presentations.IStackPresentationSite; 22 23 29 public class StandardEditorSystemMenu extends StandardViewSystemMenu { 30 31 private SystemMenuCloseOthers closeOthers; 32 private SystemMenuCloseAll closeAll; 33 private SystemMenuNewEditor openAgain; 34 35 38 public StandardEditorSystemMenu(IStackPresentationSite site) { 39 super(site); 40 41 closeOthers = new SystemMenuCloseOthers(site); 42 closeAll = new SystemMenuCloseAll(site); 43 openAgain = new SystemMenuNewEditor(site); 44 menuManager.add(closeOthers); 45 menuManager.add(closeAll); 46 menuManager.add(new Separator()); 47 menuManager.add(openAgain); 48 } 49 50 String getMoveMenuText() { 51 return WorkbenchMessages.EditorPane_moveEditor; 52 } 53 54 57 public void show(Control parent, Point displayCoordinates, 58 IPresentablePart currentSelection) { 59 closeOthers.setTarget(currentSelection); 60 closeAll.update(); 61 openAgain.setTarget(currentSelection); 62 super.show(parent, displayCoordinates, currentSelection); 63 } 64 } 65 | Popular Tags |