01: /*******************************************************************************
02: * Copyright (c) 2004, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.application;
11:
12: import org.eclipse.core.runtime.IAdaptable;
13: import org.eclipse.swt.widgets.Shell;
14: import org.eclipse.ui.WorkbenchException;
15: import org.eclipse.ui.application.ActionBarAdvisor;
16: import org.eclipse.ui.application.IActionBarConfigurer;
17: import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
18: import org.eclipse.ui.application.WorkbenchAdvisor;
19: import org.eclipse.ui.application.WorkbenchWindowAdvisor;
20:
21: /**
22: * An implementation of <code>WorkbenchWindowAdvisor</code> that
23: * calls back to the 3.0 legacy methods on <code>WorkbenchAdvisor</code>
24: * for backwards compatibility.
25: *
26: * @since 3.1
27: */
28: public class CompatibilityWorkbenchWindowAdvisor extends
29: 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(
40: WorkbenchAdvisor wbAdvisor,
41: IWorkbenchWindowConfigurer windowConfigurer) {
42: super (windowConfigurer);
43: this .wbAdvisor = wbAdvisor;
44: }
45:
46: public void preWindowOpen() {
47: wbAdvisor.preWindowOpen(getWindowConfigurer());
48: }
49:
50: public ActionBarAdvisor createActionBarAdvisor(
51: IActionBarConfigurer configurer) {
52: return new CompatibilityActionBarAdvisor(wbAdvisor, configurer);
53: }
54:
55: public void postWindowRestore() throws WorkbenchException {
56: wbAdvisor.postWindowRestore(getWindowConfigurer());
57: }
58:
59: public void openIntro() {
60: wbAdvisor.openIntro(getWindowConfigurer());
61: }
62:
63: public void postWindowCreate() {
64: wbAdvisor.postWindowCreate(getWindowConfigurer());
65: }
66:
67: public void postWindowOpen() {
68: wbAdvisor.postWindowOpen(getWindowConfigurer());
69: }
70:
71: public boolean preWindowShellClose() {
72: return wbAdvisor.preWindowShellClose(getWindowConfigurer());
73: }
74:
75: public void postWindowClose() {
76: wbAdvisor.postWindowClose(getWindowConfigurer());
77: }
78:
79: public boolean isApplicationMenu(String menuId) {
80: return wbAdvisor.isApplicationMenu(getWindowConfigurer(),
81: menuId);
82: }
83:
84: public IAdaptable getDefaultPageInput() {
85: return wbAdvisor.getDefaultPageInput();
86: }
87:
88: public void createWindowContents(Shell shell) {
89: wbAdvisor.createWindowContents(getWindowConfigurer(), shell);
90: }
91:
92: }
|