Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui
Class SubActionBars


java.lang.Object
  extended by 

org.eclipse.core.commands.common.EventManager
      extended by 
org.eclipse.ui.SubActionBars
All Implemented Interfaces:
IActionBars
Direct Known Subclasses:
SubActionBars2

public class SubActionBars
extends EventManager
implements IActionBars

Generic implementation of the IActionBars interface.


Field Summary
static  String P_ACTION_HANDLERS
          Property constant for changes to action handlers.
 
Constructor Summary
SubActionBars ( IActionBars parent)
          Construct a new SubActionBars object.
SubActionBars ( IActionBars parent, IServiceLocator serviceLocator)
          Constructs a new instance of SubActionBars.
 
Method Summary
 void activate ()
          Activate the contributions.
 void activate (boolean forceVisibility)
          Activate the contributions.
 void addPropertyChangeListener ( IPropertyChangeListener listener)
          Adds a property change listener.
protected  void basicSetActive (boolean active)
          Sets the active flag.
 void clearGlobalActionHandlers ()
          Clear the global action handlers.
protected   SubMenuManager createSubMenuManager ( IMenuManager parent)
          Returns a new sub menu manager.
protected   SubToolBarManager createSubToolBarManager ( IToolBarManager parent)
          Returns a new sub toolbar manager.
 void deactivate ()
          Deactivate the contributions.
 void deactivate (boolean forceHide)
          Deactivate the contributions.
 void dispose ()
          Dispose the contributions.
protected  void fireActionHandlersChanged ()
          Notifies any property change listeners if the global action handlers have changed
protected  void firePropertyChange ( PropertyChangeEvent event)
          Notifies any property change listeners that a property has changed.
protected  boolean getActive ()
          Return whether the manager is currently active or not.
  IAction getGlobalActionHandler ( String actionID)
          Get the handler for a window action.
  Map getGlobalActionHandlers ()
          Returns the complete list of active global action handlers.
  IMenuManager getMenuManager ()
          Returns the abstract menu manager.
protected   IActionBars getParent ()
          Return the parent action bar manager.
  IServiceLocator getServiceLocator ()
          Answer the service locator for this action bar.
  IStatusLineManager getStatusLineManager ()
          Returns the status line manager.
  IToolBarManager getToolBarManager ()
          Returns the tool bar manager.
protected  boolean isSubMenuManagerCreated ()
          Return whether the sub menu manager has been created yet.
protected  boolean isSubStatusLineManagerCreated ()
          Return whether the sub status line manager has been created yet.
protected  boolean isSubToolBarManagerCreated ()
          Return whether the sub toolbar manager has been created yet.
 void partChanged ( IWorkbenchPart part)
          Notification that the target part for the action bars has changed.
 void removePropertyChangeListener ( IPropertyChangeListener listener)
          Removes the given property change listener.
protected  void setActive (boolean set)
          Activate / deactivate the contributions.
 void setGlobalActionHandler ( String actionID, IAction handler)
          Add a handler for a window action.
protected  void setServiceLocator ( IServiceLocator locator)
          Sets the service locator for this action bar.
 void updateActionBars ()
          Commits all UI changes.
 
Methods inherited from class org.eclipse.core.commands.common. EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_ACTION_HANDLERS

public static final 
String P_ACTION_HANDLERS
Property constant for changes to action handlers.

See Also:
Constant Field Values
Constructor Detail

SubActionBars

public SubActionBars(
IActionBars parent)
Construct a new SubActionBars object. The service locator will simply be the service locator of the parent.

Parameters:
parent - The parent of this action bar; must not be null.

SubActionBars

public SubActionBars(
IActionBars parent,
                     
IServiceLocator serviceLocator)
Constructs a new instance of SubActionBars.

Parameters:
parent - The parent of this action bar; must not be null.
serviceLocator - The service locator for this action bar; should not be null.
Since:
3.2
Method Detail

activate

public void activate()
Activate the contributions.


activate

public void activate(boolean forceVisibility)
Activate the contributions.

Workaround for toolbar layout flashing when editors contribute large amounts of items. In this case we want to force the items to be visible/hidden only when required, otherwise just change the enablement state.


addPropertyChangeListener

public void addPropertyChangeListener(
IPropertyChangeListener listener)
Adds a property change listener. Has no effect if an identical listener is already registered.

Parameters:
listener - a property change listener

basicSetActive

protected final void basicSetActive(boolean active)
Sets the active flag. Clients should not call this method directly unless they are overriding the setActive() method.


clearGlobalActionHandlers

public void clearGlobalActionHandlers()
Clear the global action handlers.

Specified by:
clearGlobalActionHandlers in interface IActionBars

createSubMenuManager

protected 
SubMenuManager createSubMenuManager(
IMenuManager parent)
Returns a new sub menu manager.

Parameters:
parent - the parent menu manager
Returns:
the menu manager

createSubToolBarManager

protected 
SubToolBarManager createSubToolBarManager(
IToolBarManager parent)
Returns a new sub toolbar manager.

Parameters:
parent - the parent toolbar manager
Returns:
the tool bar manager

deactivate

public void deactivate()
Deactivate the contributions.


deactivate

public void deactivate(boolean forceHide)
Deactivate the contributions.

Workaround for menubar/toolbar layout flashing when editors have many contributions. In this case we want to force the contributions to be visible/hidden only when required, otherwise just change the enablement state.


dispose

public void dispose()
Dispose the contributions.


fireActionHandlersChanged

protected void fireActionHandlersChanged()
Notifies any property change listeners if the global action handlers have changed


firePropertyChange

protected void firePropertyChange(
PropertyChangeEvent event)
Notifies any property change listeners that a property has changed. Only listeners registered at the time this method is called are notified.

Parameters:
event - the property change event
See Also:
IPropertyChangeListener.propertyChange(org.eclipse.jface.util.PropertyChangeEvent)

getActive

protected final boolean getActive()
Return whether the manager is currently active or not.


getGlobalActionHandler

public 
IAction getGlobalActionHandler(
String actionID)
Get the handler for a window action.

Specified by:
getGlobalActionHandler in interface IActionBars
Parameters:
actionID - an action ID declared in the registry
Returns:
an action handler which implements the action ID, or null if none is registered.
See Also:
IWorkbenchActionConstants, IActionBars.setGlobalActionHandler(String, IAction)

getGlobalActionHandlers

public 
Map getGlobalActionHandlers()
Returns the complete list of active global action handlers. If there are no global action handlers registered return null.


getMenuManager

public 
IMenuManager getMenuManager()
Returns the abstract menu manager. If items are added or removed from the manager be sure to call updateActionBars.

Specified by:
getMenuManager in interface IActionBars
Returns:
the menu manager

getParent

protected final 
IActionBars getParent()
Return the parent action bar manager.


getServiceLocator

public final 
IServiceLocator getServiceLocator()
Answer the service locator for this action bar.

Specified by:
getServiceLocator in interface IActionBars
Returns:
an IServiceLocater or the parents if the receiver does not have one
Since:
3.2

getStatusLineManager

public 
IStatusLineManager getStatusLineManager()
Returns the status line manager. If items are added or removed from the manager be sure to call updateActionBars.

Specified by:
getStatusLineManager in interface IActionBars
Returns:
the status line manager

getToolBarManager

public 
IToolBarManager getToolBarManager()
Returns the tool bar manager. If items are added or removed from the manager be sure to call updateActionBars.

Specified by:
getToolBarManager in interface IActionBars
Returns:
the tool bar manager

isSubMenuManagerCreated

protected final boolean isSubMenuManagerCreated()
Return whether the sub menu manager has been created yet.


isSubStatusLineManagerCreated

protected final boolean isSubStatusLineManagerCreated()
Return whether the sub status line manager has been created yet.


isSubToolBarManagerCreated

protected final boolean isSubToolBarManagerCreated()
Return whether the sub toolbar manager has been created yet.


partChanged

public void partChanged(
IWorkbenchPart part)
Notification that the target part for the action bars has changed.


removePropertyChangeListener

public void removePropertyChangeListener(
IPropertyChangeListener listener)
Removes the given property change listener. Has no effect if an identical listener is not registered.

Parameters:
listener - a property change listener

setActive

protected void setActive(boolean set)
Activate / deactivate the contributions.


setGlobalActionHandler

public void setGlobalActionHandler(
String actionID,
                                   
IAction handler)
Add a handler for a window action.

Specified by:
setGlobalActionHandler in interface IActionBars
Parameters:
actionID - an action ID declared in the registry
handler - an action which implements the action ID. null may be passed to deregister a handler.
See Also:
IWorkbenchActionConstants

setServiceLocator

protected final void setServiceLocator(
IServiceLocator locator)
Sets the service locator for this action bar.

Parameters:
locator - The new locator; must not be null.
Since:
3.2

updateActionBars

public void updateActionBars()
Commits all UI changes. This should be called after additions or subtractions have been made to a menu, status line, or toolbar.

Specified by:
updateActionBars in interface IActionBars
See Also:
IActionBars.setGlobalActionHandler(String, IAction), IActionBars.clearGlobalActionHandlers()

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire