1 11 package org.eclipse.ui.internal.misc; 12 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.widgets.*; 15 16 public abstract class WorkbookPage { 17 public TabItem tabItem; 18 21 public WorkbookPage(Workbook parent) { 22 TabFolder folder = parent.getTabFolder(); 23 tabItem = new TabItem(folder,SWT.NONE); 24 tabItem.setData(this); 25 } 26 public void activate() { 27 28 if (tabItem.getControl() == null) 29 tabItem.setControl(createControl(tabItem.getParent())); 30 31 } 32 protected abstract Control createControl (Composite parent); 33 public boolean deactivate() { 34 return true; 35 } 36 public void dispose() { 37 38 if (tabItem == null) 39 return; 40 41 TabItem oldItem = tabItem; 42 tabItem = null; 43 oldItem.dispose(); 44 } 45 public TabItem getTabItem() { 46 return tabItem; 47 } 48 } 49 | Popular Tags |