blob: b27d7866036fb120c1c44f2bb8ef0995107525aa (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
/*******************************************************************************
* Copyright (c) 2004, 2015 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui.internal.application;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
/**
* An implementation of <code>WorkbenchWindowAdvisor</code> that
* calls back to the 3.0 legacy methods on <code>WorkbenchAdvisor</code>
* for backwards compatibility.
*
* @since 3.1
*/
public class CompatibilityWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
private WorkbenchAdvisor wbAdvisor;
/**
* Creates a new compatibility workbench window advisor.
*
* @param wbAdvisor the workbench advisor
* @param windowConfigurer the window configurer
*/
public CompatibilityWorkbenchWindowAdvisor(WorkbenchAdvisor wbAdvisor, IWorkbenchWindowConfigurer windowConfigurer) {
super(windowConfigurer);
this.wbAdvisor = wbAdvisor;
}
@Override
public void preWindowOpen() {
wbAdvisor.preWindowOpen(getWindowConfigurer());
}
@Override
public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
return new CompatibilityActionBarAdvisor(wbAdvisor, configurer);
}
@Override
public void postWindowRestore() throws WorkbenchException {
wbAdvisor.postWindowRestore(getWindowConfigurer());
}
@Override
public void openIntro() {
wbAdvisor.openIntro(getWindowConfigurer());
}
@Override
public void postWindowCreate() {
wbAdvisor.postWindowCreate(getWindowConfigurer());
}
@Override
public void postWindowOpen() {
wbAdvisor.postWindowOpen(getWindowConfigurer());
}
@Override
public boolean preWindowShellClose() {
return wbAdvisor.preWindowShellClose(getWindowConfigurer());
}
@Override
public void postWindowClose() {
wbAdvisor.postWindowClose(getWindowConfigurer());
}
public boolean isApplicationMenu(String menuId) {
return wbAdvisor.isApplicationMenu(getWindowConfigurer(), menuId);
}
public IAdaptable getDefaultPageInput() {
return wbAdvisor.getDefaultPageInput();
}
@Override
public void createWindowContents(Shell shell) {
wbAdvisor.createWindowContents(getWindowConfigurer(), shell);
}
}
|