KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 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.ui.application.ActionBarAdvisor;
14 import org.eclipse.ui.application.IActionBarConfigurer;
15 import org.eclipse.ui.application.WorkbenchAdvisor;
16
17 /**
18  * An implementation of <code>ActionBarAdvisor</code> that
19  * calls back to the 3.0 legacy methods on <code>WorkbenchAdvisor</code>
20  * for backwards compatibility.
21  *
22  * @since 3.1
23  */

24 public class CompatibilityActionBarAdvisor extends ActionBarAdvisor {
25
26     private WorkbenchAdvisor wbAdvisor;
27
28     /**
29      * Creates a new compatibility action bar advisor.
30      *
31      * @param wbAdvisor the workbench advisor
32      * @param configurer the action bar configurer
33      */

34     public CompatibilityActionBarAdvisor(WorkbenchAdvisor wbAdvisor, 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(), abc, flags);
42     }
43     
44     public boolean isApplicationMenu(String JavaDoc menuId) {
45         IActionBarConfigurer abc = getActionBarConfigurer();
46         return wbAdvisor.isApplicationMenu(abc.getWindowConfigurer(), menuId);
47     }
48 }
49
Popular Tags