1 11 package org.eclipse.ui.part; 12 13 import org.eclipse.jface.action.IMenuManager; 14 import org.eclipse.jface.action.IStatusLineManager; 15 import org.eclipse.jface.action.IToolBarManager; 16 import org.eclipse.swt.widgets.Composite; 17 import org.eclipse.swt.widgets.Control; 18 import org.eclipse.ui.IActionBars; 19 20 47 public abstract class Page implements IPageBookViewPage { 48 51 private IPageSite site; 52 53 56 protected Page() { 57 } 58 59 62 public abstract void createControl(Composite parent); 63 64 69 public void dispose() { 70 Control ctrl = getControl(); 71 if (ctrl != null && !ctrl.isDisposed()) { 72 ctrl.dispose(); 73 } 74 } 75 76 80 public abstract Control getControl(); 81 82 86 public void makeContributions(IMenuManager menuManager, 87 IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { 88 } 89 90 94 public void setActionBars(IActionBars actionBars) { 95 makeContributions(actionBars.getMenuManager(), actionBars 96 .getToolBarManager(), actionBars.getStatusLineManager()); 97 } 98 99 109 public void init(IPageSite pageSite) { 110 site = pageSite; 111 } 112 113 118 public IPageSite getSite() { 119 return site; 120 } 121 122 126 public abstract void setFocus(); 127 } 128 | Popular Tags |