1 11 package org.eclipse.ui; 12 13 import org.eclipse.jface.action.ICoolBarManager; 14 import org.eclipse.jface.action.SubCoolBarManager; 15 import org.eclipse.ui.services.IServiceLocator; 16 17 24 public class SubActionBars2 extends SubActionBars implements IActionBars2 { 25 private SubCoolBarManager coolBarMgr = null; 26 27 33 public SubActionBars2(final IActionBars2 parent) { 34 this(parent, parent.getServiceLocator()); 35 } 36 37 48 public SubActionBars2(final IActionBars2 parent, 49 final IServiceLocator serviceLocator) { 50 super(parent, serviceLocator); 51 } 52 53 59 protected IActionBars2 getCastedParent() { 60 return (IActionBars2) getParent(); 61 } 62 63 70 protected SubCoolBarManager createSubCoolBarManager(ICoolBarManager parent) { 71 return new SubCoolBarManager(parent); 72 } 73 74 79 public ICoolBarManager getCoolBarManager() { 80 if (coolBarMgr == null) { 81 coolBarMgr = createSubCoolBarManager(getCastedParent() 82 .getCoolBarManager()); 83 coolBarMgr.setVisible(getActive()); 84 } 85 return coolBarMgr; 86 } 87 88 93 protected void setActive(boolean value) { 94 super.setActive(value); 95 if (coolBarMgr != null) { 96 coolBarMgr.setVisible(value); 97 } 98 } 99 100 105 public void dispose() { 106 super.dispose(); 107 if (coolBarMgr != null) { 108 coolBarMgr.removeAll(); 109 } 110 } 111 } 112 | Popular Tags |