1 11 package org.eclipse.ui.internal.presentations; 12 13 import org.eclipse.jface.action.MenuManager; 14 import org.eclipse.ui.internal.WorkbenchMessages; 15 import org.eclipse.ui.presentations.IPresentablePart; 16 import org.eclipse.ui.presentations.IStackPresentationSite; 17 18 public class SystemMenuMove extends MenuManager { 19 20 private IStackPresentationSite stackPresentationSite; 21 22 private SystemMenuMovePane movePaneAction; 23 24 private SystemMenuMoveFolder moveFolderAction; 25 private boolean assumeActivePart = false; 26 27 public SystemMenuMove(IStackPresentationSite stackPresentationSite, 28 String partName) { 29 this(stackPresentationSite, partName, true); 30 } 31 32 public SystemMenuMove(IStackPresentationSite stackPresentationSite, 33 String partName, boolean assumeActivePart) { 34 super(WorkbenchMessages.PartPane_move); 35 this.stackPresentationSite = stackPresentationSite; 36 this.assumeActivePart = assumeActivePart; 37 38 movePaneAction = new SystemMenuMovePane(stackPresentationSite); 39 movePaneAction.setText(partName); 40 moveFolderAction = new SystemMenuMoveFolder(stackPresentationSite); 41 42 add(movePaneAction); 43 add(moveFolderAction); 44 } 45 46 public void setTarget(IPresentablePart part) { 47 movePaneAction.setTarget(part); 48 } 49 50 53 protected void update(boolean force, boolean recursive) { 54 if (assumeActivePart) { 55 setTarget(stackPresentationSite.getSelectedPart()); 56 } 57 58 moveFolderAction.update(); 59 60 super.update(force, recursive); 61 } 62 63 } 64 | Popular Tags |