KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > application > CompatibilityWorkbenchWindowAdvisor


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

11 package org.eclipse.ui.internal.application;
12
13 import org.eclipse.core.runtime.IAdaptable;
14 import org.eclipse.swt.widgets.Shell;
15 import org.eclipse.ui.WorkbenchException;
16 import org.eclipse.ui.application.ActionBarAdvisor;
17 import org.eclipse.ui.application.IActionBarConfigurer;
18 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
19 import org.eclipse.ui.application.WorkbenchAdvisor;
20 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
21
22 /**
23  * An implementation of <code>WorkbenchWindowAdvisor</code> that
24  * calls back to the 3.0 legacy methods on <code>WorkbenchAdvisor</code>
25  * for backwards compatibility.
26  *
27  * @since 3.1
28  */

29 public class CompatibilityWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
30
31     private WorkbenchAdvisor wbAdvisor;
32
33     /**
34      * Creates a new compatibility workbench window advisor.
35      *
36      * @param wbAdvisor the workbench advisor
37      * @param windowConfigurer the window configurer
38      */

39     public CompatibilityWorkbenchWindowAdvisor(WorkbenchAdvisor wbAdvisor, IWorkbenchWindowConfigurer windowConfigurer) {
40         super(windowConfigurer);
41         this.wbAdvisor = wbAdvisor;
42     }
43
44     public void preWindowOpen() {
45         wbAdvisor.preWindowOpen(getWindowConfigurer());
46     }
47
48     public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
49         return new CompatibilityActionBarAdvisor(wbAdvisor, configurer);
50     }
51     
52     public void postWindowRestore() throws WorkbenchException {
53         wbAdvisor.postWindowRestore(getWindowConfigurer());
54     }
55
56     public void openIntro() {
57         wbAdvisor.openIntro(getWindowConfigurer());
58     }
59
60     public void postWindowCreate() {
61         wbAdvisor.postWindowCreate(getWindowConfigurer());
62     }
63
64     public void postWindowOpen() {
65         wbAdvisor.postWindowOpen(getWindowConfigurer());
66     }
67
68     public boolean preWindowShellClose() {
69         return wbAdvisor.preWindowShellClose(getWindowConfigurer());
70     }
71
72     public void postWindowClose() {
73         wbAdvisor.postWindowClose(getWindowConfigurer());
74     }
75
76     public boolean isApplicationMenu(String JavaDoc menuId) {
77         return wbAdvisor.isApplicationMenu(getWindowConfigurer(), menuId);
78     }
79
80     public IAdaptable getDefaultPageInput() {
81         return wbAdvisor.getDefaultPageInput();
82     }
83
84     public void createWindowContents(Shell shell) {
85         wbAdvisor.createWindowContents(getWindowConfigurer(), shell);
86     }
87
88  
89 }
90
Popular Tags