01: /*******************************************************************************
02: * Copyright (c) 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.ui.application.ActionBarAdvisor;
13: import org.eclipse.ui.application.IActionBarConfigurer;
14: import org.eclipse.ui.application.WorkbenchAdvisor;
15:
16: /**
17: * An implementation of <code>ActionBarAdvisor</code> that
18: * calls back to the 3.0 legacy methods on <code>WorkbenchAdvisor</code>
19: * for backwards compatibility.
20: *
21: * @since 3.1
22: */
23: public class CompatibilityActionBarAdvisor extends ActionBarAdvisor {
24:
25: private WorkbenchAdvisor wbAdvisor;
26:
27: /**
28: * Creates a new compatibility action bar advisor.
29: *
30: * @param wbAdvisor the workbench advisor
31: * @param configurer the action bar configurer
32: */
33: public CompatibilityActionBarAdvisor(WorkbenchAdvisor wbAdvisor,
34: IActionBarConfigurer configurer) {
35: super (configurer);
36: this .wbAdvisor = wbAdvisor;
37: }
38:
39: public void fillActionBars(int flags) {
40: IActionBarConfigurer abc = getActionBarConfigurer();
41: wbAdvisor.fillActionBars(abc.getWindowConfigurer().getWindow(),
42: abc, flags);
43: }
44:
45: public boolean isApplicationMenu(String menuId) {
46: IActionBarConfigurer abc = getActionBarConfigurer();
47: return wbAdvisor.isApplicationMenu(abc.getWindowConfigurer(),
48: menuId);
49: }
50: }
|