KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > misc > WorkbookPage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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 /**
19  * WorkbookPage constructor comment.
20  */

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