1 11 package org.eclipse.ui.internal.part.services; 12 13 import org.eclipse.jface.action.IAction; 14 import org.eclipse.jface.action.IMenuManager; 15 import org.eclipse.jface.action.IStatusLineManager; 16 import org.eclipse.jface.action.IToolBarManager; 17 import org.eclipse.ui.IActionBars; 18 import org.eclipse.ui.internal.components.Assert; 19 import org.eclipse.ui.internal.part.components.services.IPartActionBars; 20 import org.eclipse.ui.internal.part.components.services.IStatusFactory; 21 import org.eclipse.ui.internal.part.components.services.IStatusHandler; 22 23 public class PartToViewActionBarsAdapter implements IActionBars { 24 25 private IPartActionBars parent; 26 private IStatusLineManager statusLine; 27 28 public PartToViewActionBarsAdapter(IPartActionBars toAdapt, IStatusHandler statusHandler, IStatusFactory statusFactory) { 29 Assert.isNotNull(toAdapt); 30 Assert.isNotNull(statusHandler); 31 Assert.isNotNull(statusFactory); 32 parent = toAdapt; 33 this.statusLine = new StatusLineManagerAdapter(statusHandler, statusFactory); 34 } 35 36 public void clearGlobalActionHandlers() { 37 parent.clearGlobalActionHandlers(); 38 } 39 40 public IAction getGlobalActionHandler(String actionId) { 41 return parent.getGlobalActionHandler(actionId); 42 } 43 44 public IMenuManager getMenuManager() { 45 return parent.getPartMenuManager(); 46 } 47 48 public IStatusLineManager getStatusLineManager() { 49 return statusLine; 50 } 51 52 public IToolBarManager getToolBarManager() { 53 return parent.getToolBarManager(); 54 } 55 56 public void setGlobalActionHandler(String actionId, IAction handler) { 57 parent.setGlobalActionHandler(actionId, handler); 58 } 59 60 public void updateActionBars() { 61 parent.updateActionBars(); 62 } 63 64 } 65 | Popular Tags |