Java Doc for ActionBarAdvisor.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » application » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » ui workbench » org.eclipse.ui.application 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.ui.application.ActionBarAdvisor

All known Subclasses:   org.eclipse.ui.internal.application.CompatibilityActionBarAdvisor,
ActionBarAdvisor
public class ActionBarAdvisor (Code)
Public base class for configuring the action bars of a workbench window.

An application should declare a subclass of ActionBarAdvisor and override methods to configure a window's action bars to suit the needs of the particular application.

The following advisor methods are called at strategic points in the workbench's lifecycle (all occur within the dynamic scope of the call to PlatformUI.createAndRunWorkbench PlatformUI.createAndRunWorkbench ):

  • fillActionBars - called after WorkbenchWindowAdvisor.preWindowOpen to configure a window's action bars


See Also:   WorkbenchWindowAdvisor.createActionBarAdvisor(IActionBarConfigurer)
since:
   3.1


Field Summary
final public static  intFILL_COOL_BAR
     Bit flag for ActionBarAdvisor.fillActionBars fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's cool bar.
final public static  intFILL_MENU_BAR
     Bit flag for ActionBarAdvisor.fillActionBars fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's menu bar.
final public static  intFILL_PROXY
     Bit flag for ActionBarAdvisor.fillActionBars fillActionBars indicating that the operation is not filling the action bars of an actual workbench window, but rather a proxy (used for perspective customization).
final public static  intFILL_STATUS_LINE
     Bit flag for ActionBarAdvisor.fillActionBars fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's status line.

Constructor Summary
public  ActionBarAdvisor(IActionBarConfigurer configurer)
     Creates a new action bar advisor to configure a workbench window's action bars via the given action bar configurer.

Method Summary
public  voiddispose()
     Disposes this action bar advisor.
protected  voiddisposeAction(IAction action)
     Disposes the given action.
protected  voiddisposeActions()
     Disposes all actions added via register(IAction) using disposeAction(IAction).
public  voidfillActionBars(int flags)
     Configures the action bars using the given action bar configurer. Under normal circumstances, flags does not include FILL_PROXY, meaning this is a request to fill the action bars of the corresponding workbench window; the remaining flags indicate which combination of the menu bar (FILL_MENU_BAR), the tool bar (FILL_COOL_BAR), and the status line (FILL_STATUS_LINE) are to be filled.

If flags does include FILL_PROXY, then this is a request to describe the actions bars of the given workbench window (which will already have been filled); again, the remaining flags indicate which combination of the menu bar, the tool bar, and the status line are to be described. The actions included in the proxy action bars can be the same instances as in the actual window's action bars.

protected  voidfillCoolBar(ICoolBarManager coolBar)
     Fills the cool bar with the main toolbars for the window.
protected  voidfillMenuBar(IMenuManager menuBar)
     Fills the menu bar with the main menus for the window.
protected  voidfillStatusLine(IStatusLineManager statusLine)
     Fills the status line with the main status line contributions for the window.
protected  IActiongetAction(String id)
     Returns the action with the given id, or null if not found.
protected  IActionBarConfigurergetActionBarConfigurer()
     Returns the action bar configurer.
public  booleanisApplicationMenu(String menuId)
     Returns whether the menu with the given id is an application menu of the given window.
protected  voidmakeActions(IWorkbenchWindow window)
     Instantiates the actions used in the fill methods.
protected  voidregister(IAction action)
     Registers the given action with the key binding service (by calling IActionBarConfigurer.registerGlobalAction(IAction) ), and adds it to the list of actions to be disposed when the window is closed.

In order to participate in key bindings, the action must have an action definition id (aka command id), and a corresponding command extension. See the org.eclipse.ui.commands extension point documentation for more details.

public  IStatusrestoreState(IMemento memento)
     Restores arbitrary application-specific state information for this action bar advisor.
public  IStatussaveState(IMemento memento)
     Saves arbitrary application-specific state information for this action bar advisor.

Field Detail
FILL_COOL_BAR
final public static int FILL_COOL_BAR(Code)
Bit flag for ActionBarAdvisor.fillActionBars fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's cool bar.



FILL_MENU_BAR
final public static int FILL_MENU_BAR(Code)
Bit flag for ActionBarAdvisor.fillActionBars fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's menu bar.



FILL_PROXY
final public static int FILL_PROXY(Code)
Bit flag for ActionBarAdvisor.fillActionBars fillActionBars indicating that the operation is not filling the action bars of an actual workbench window, but rather a proxy (used for perspective customization).



FILL_STATUS_LINE
final public static int FILL_STATUS_LINE(Code)
Bit flag for ActionBarAdvisor.fillActionBars fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's status line.




Constructor Detail
ActionBarAdvisor
public ActionBarAdvisor(IActionBarConfigurer configurer)(Code)
Creates a new action bar advisor to configure a workbench window's action bars via the given action bar configurer.
Parameters:
  configurer - the action bar configurer




Method Detail
dispose
public void dispose()(Code)
Disposes this action bar advisor. Called when the window is being closed. This should dispose any allocated resources and remove any added listeners.

The default implementation calls disposeActions(). Subclasses may extend.




disposeAction
protected void disposeAction(IAction action)(Code)
Disposes the given action.

The default implementation checks whether the action is an instance of ActionFactory.IWorkbenchAction and calls its dispose() method if so. Subclasses may extend.


Parameters:
  action - the action to dispose



disposeActions
protected void disposeActions()(Code)
Disposes all actions added via register(IAction) using disposeAction(IAction).



fillActionBars
public void fillActionBars(int flags)(Code)
Configures the action bars using the given action bar configurer. Under normal circumstances, flags does not include FILL_PROXY, meaning this is a request to fill the action bars of the corresponding workbench window; the remaining flags indicate which combination of the menu bar (FILL_MENU_BAR), the tool bar (FILL_COOL_BAR), and the status line (FILL_STATUS_LINE) are to be filled.

If flags does include FILL_PROXY, then this is a request to describe the actions bars of the given workbench window (which will already have been filled); again, the remaining flags indicate which combination of the menu bar, the tool bar, and the status line are to be described. The actions included in the proxy action bars can be the same instances as in the actual window's action bars. Calling ActionFactory to create new action instances is not recommended, because these actions internally register listeners with the window and there is no opportunity to dispose of these actions.

This method is called just after WorkbenchWindowAdvisor.preWindowOpen . Clients must not call this method directly (although super calls are okay). The default implementation calls makeActions if FILL_PROXY is specified, then calls fillMenuBar, fillCoolBar, and fillStatusLine if the corresponding flags are specified.

Subclasses may override, but it is recommended that they override the methods mentioned above instead.


Parameters:
  flags - bit mask composed from the constantsActionBarAdvisor.FILL_MENU_BAR FILL_MENU_BAR,ActionBarAdvisor.FILL_COOL_BAR FILL_COOL_BAR,ActionBarAdvisor.FILL_STATUS_LINE FILL_STATUS_LINE,and ActionBarAdvisor.FILL_PROXY FILL_PROXY



fillCoolBar
protected void fillCoolBar(ICoolBarManager coolBar)(Code)
Fills the cool bar with the main toolbars for the window.

The default implementation does nothing. Subclasses may override.


Parameters:
  coolBar - the cool bar manager



fillMenuBar
protected void fillMenuBar(IMenuManager menuBar)(Code)
Fills the menu bar with the main menus for the window.

The default implementation does nothing. Subclasses may override.


Parameters:
  menuBar - the menu manager for the menu bar



fillStatusLine
protected void fillStatusLine(IStatusLineManager statusLine)(Code)
Fills the status line with the main status line contributions for the window.

The default implementation does nothing. Subclasses may override.


Parameters:
  statusLine - the status line manager



getAction
protected IAction getAction(String id)(Code)
Returns the action with the given id, or null if not found.
Parameters:
  id - the action id the action with the given id, or null if not found
See Also:   IAction.getId



getActionBarConfigurer
protected IActionBarConfigurer getActionBarConfigurer()(Code)
Returns the action bar configurer. the action bar configurer



isApplicationMenu
public boolean isApplicationMenu(String menuId)(Code)
Returns whether the menu with the given id is an application menu of the given window. This is used during OLE "in place" editing. Application menus should be preserved during menu merging. All other menus may be removed from the window.

The default implementation returns false. Subclasses may override.


Parameters:
  menuId - the menu id true for application menus, and falsefor part-specific menus



makeActions
protected void makeActions(IWorkbenchWindow window)(Code)
Instantiates the actions used in the fill methods. Use ActionBarAdvisor.register(IAction) to register the action with the key binding service and add it to the list of actions to be disposed when the window is closed.
Parameters:
  window - the window containing the action bars



register
protected void register(IAction action)(Code)
Registers the given action with the key binding service (by calling IActionBarConfigurer.registerGlobalAction(IAction) ), and adds it to the list of actions to be disposed when the window is closed.

In order to participate in key bindings, the action must have an action definition id (aka command id), and a corresponding command extension. See the org.eclipse.ui.commands extension point documentation for more details.


Parameters:
  action - the action to register
See Also:   IAction.setActionDefinitionId(String)
See Also:   ActionBarAdvisor.disposeAction(IAction)



restoreState
public IStatus restoreState(IMemento memento)(Code)
Restores arbitrary application-specific state information for this action bar advisor.

The default implementation simply returns an OK status. Subclasses may extend or override.


Parameters:
  memento - the memento from which to restore the advisor's state a status object indicating whether the restore was successful
since:
   3.1



saveState
public IStatus saveState(IMemento memento)(Code)
Saves arbitrary application-specific state information for this action bar advisor.

The default implementation simply returns an OK status. Subclasses may extend or override.


Parameters:
  memento - the memento in which to save the advisor's state a status object indicating whether the save was successful
since:
   3.1



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.