Package org.eclipse.ui
Class SubActionBars
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.SubActionBars
- All Implemented Interfaces:
IActionBars
- Direct Known Subclasses:
SubActionBars2
Generic implementation of the
IActionBars
interface.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property constant for changes to action handlers. -
Constructor Summary
ConstructorDescriptionSubActionBars
(IActionBars parent) Construct a newSubActionBars
object.SubActionBars
(IActionBars parent, IServiceLocator serviceLocator) Constructs a new instance ofSubActionBars
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activate the contributions.void
activate
(boolean forceVisibility) Activate the contributions.void
Adds a property change listener.protected final void
basicSetActive
(boolean active) Sets the active flag.void
Clear the global action handlers.protected SubMenuManager
createSubMenuManager
(IMenuManager parent) Returns a new sub menu manager.protected SubToolBarManager
Returns a new sub toolbar manager.void
Deactivate the contributions.void
deactivate
(boolean forceHide) Deactivate the contributions.void
dispose()
Dispose the contributions.protected void
Notifies any property change listeners if the global action handlers have changedprotected void
Notifies any property change listeners that a property has changed.protected final boolean
Return whether the manager is currently active or not.getGlobalActionHandler
(String actionID) Get the handler for a window action.Returns the complete list of active global action handlers.Returns the abstract menu manager.protected final IActionBars
Return the parent action bar manager.final IServiceLocator
Answer the service locator for this action bar.Returns the status line manager.Returns the tool bar manager.protected final boolean
Return whether the sub menu manager has been created yet.protected final boolean
Return whether the sub status line manager has been created yet.protected final boolean
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
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 final void
setServiceLocator
(IServiceLocator locator) Sets the service locator for this action bar.void
Commits all UI changes.Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Field Details
-
P_ACTION_HANDLERS
Property constant for changes to action handlers.- See Also:
-
-
Constructor Details
-
SubActionBars
Construct a newSubActionBars
object. The service locator will simply be the service locator of the parent.- Parameters:
parent
- The parent of this action bar; must not benull
.
-
SubActionBars
Constructs a new instance ofSubActionBars
.- Parameters:
parent
- The parent of this action bar; must not benull
.serviceLocator
- The service locator for this action bar; should not benull
.- Since:
- 3.2
-
-
Method Details
-
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.
- Parameters:
forceVisibility
- (is not used)
-
addPropertyChangeListener
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 interfaceIActionBars
-
createSubMenuManager
Returns a new sub menu manager.- Parameters:
parent
- the parent menu manager- Returns:
- the menu manager
-
createSubToolBarManager
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.
- Parameters:
forceHide
- (not used)
-
dispose
public void dispose()Dispose the contributions. -
fireActionHandlersChanged
protected void fireActionHandlersChanged()Notifies any property change listeners if the global action handlers have changed -
firePropertyChange
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:
-
getActive
protected final boolean getActive()Return whether the manager is currently active or not. -
getGlobalActionHandler
Get the handler for a window action.- Specified by:
getGlobalActionHandler
in interfaceIActionBars
- 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:
-
getGlobalActionHandlers
Returns the complete list of active global action handlers. If there are no global action handlers registered return null.- Returns:
- a map with global action handlers
-
getMenuManager
Returns the abstract menu manager. If items are added or removed from the manager be sure to callupdateActionBars
.- Specified by:
getMenuManager
in interfaceIActionBars
- Returns:
- the menu manager
-
getParent
Return the parent action bar manager. -
getServiceLocator
Answer the service locator for this action bar.- Specified by:
getServiceLocator
in interfaceIActionBars
- Returns:
- an
IServiceLocater
or the parents if the receiver does not have one - Since:
- 3.2
-
getStatusLineManager
Returns the status line manager. If items are added or removed from the manager be sure to callupdateActionBars
.- Specified by:
getStatusLineManager
in interfaceIActionBars
- Returns:
- the status line manager
-
getToolBarManager
Returns the tool bar manager. If items are added or removed from the manager be sure to callupdateActionBars
.- Specified by:
getToolBarManager
in interfaceIActionBars
- 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
Notification that the target part for the action bars has changed. This implementation does nothing.- Parameters:
part
- the part to be notified.
-
removePropertyChangeListener
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
Add a handler for a window action.- Specified by:
setGlobalActionHandler
in interfaceIActionBars
- Parameters:
actionID
- an action ID declared in the registryhandler
- an action which implements the action ID.null
may be passed to deregister a handler.- See Also:
-
setServiceLocator
Sets the service locator for this action bar.- Parameters:
locator
- The new locator; must not benull
.- 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 interfaceIActionBars
- See Also:
-