1 11 package org.eclipse.ui.part; 12 13 import org.eclipse.jface.action.ICoolBarManager; 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.IActionBars2; 19 import org.eclipse.ui.IEditorActionBarContributor; 20 import org.eclipse.ui.IEditorPart; 21 import org.eclipse.ui.IWorkbenchPage; 22 23 40 public class EditorActionBarContributor implements IEditorActionBarContributor { 41 44 private IActionBars bars; 45 46 49 private IWorkbenchPage page; 50 51 55 public EditorActionBarContributor() { 56 } 57 58 68 public void contributeToMenu(IMenuManager menuManager) { 69 } 70 71 81 public void contributeToStatusLine(IStatusLineManager statusLineManager) { 82 } 83 84 94 public void contributeToToolBar(IToolBarManager toolBarManager) { 95 } 96 97 109 public void contributeToCoolBar(ICoolBarManager coolBarManager) { 110 } 111 112 117 public IActionBars getActionBars() { 118 return bars; 119 } 120 121 126 public IWorkbenchPage getPage() { 127 return page; 128 } 129 130 135 public void dispose() { 136 } 137 138 144 public void init(IActionBars bars, IWorkbenchPage page) { 145 this.page = page; 146 init(bars); 147 } 148 149 165 public void init(IActionBars bars) { 166 this.bars = bars; 167 contributeToMenu(bars.getMenuManager()); 168 contributeToToolBar(bars.getToolBarManager()); 169 if (bars instanceof IActionBars2) { 170 contributeToCoolBar(((IActionBars2) bars).getCoolBarManager()); 171 } 172 contributeToStatusLine(bars.getStatusLineManager()); 173 174 } 175 176 187 public void setActiveEditor(IEditorPart targetEditor) { 188 } 189 } 190 | Popular Tags |