public class SubActionBars extends EventManager implements IActionBars
IActionBars
interface.Modifier and Type | Field and Description |
---|---|
static String |
P_ACTION_HANDLERS
Property constant for changes to action handlers.
|
Constructor and Description |
---|
SubActionBars(IActionBars parent)
Construct a new
SubActionBars object. |
SubActionBars(IActionBars parent,
IServiceLocator serviceLocator)
Constructs a new instance of
SubActionBars . |
Modifier and Type | Method and Description |
---|---|
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.
|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public static final String P_ACTION_HANDLERS
public SubActionBars(IActionBars parent)
SubActionBars
object. The service locator
will simply be the service locator of the parent.parent
- The parent of this action bar; must not be null
.public SubActionBars(IActionBars parent, IServiceLocator serviceLocator)
SubActionBars
.parent
- The parent of this action bar; must not be null
.serviceLocator
- The service locator for this action bar; should not be
null
.public void activate()
public void activate(boolean forceVisibility)
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.
public void addPropertyChangeListener(IPropertyChangeListener listener)
listener
- a property change listenerprotected final void basicSetActive(boolean active)
public void clearGlobalActionHandlers()
clearGlobalActionHandlers
in interface IActionBars
protected SubMenuManager createSubMenuManager(IMenuManager parent)
parent
- the parent menu managerprotected SubToolBarManager createSubToolBarManager(IToolBarManager parent)
parent
- the parent toolbar managerpublic void deactivate()
public void deactivate(boolean forceHide)
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.
public void dispose()
protected void fireActionHandlersChanged()
protected void firePropertyChange(PropertyChangeEvent event)
event
- the property change eventIPropertyChangeListener.propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
protected final boolean getActive()
public IAction getGlobalActionHandler(String actionID)
getGlobalActionHandler
in interface IActionBars
actionID
- an action ID declared in the registrynull
if none is registered.IWorkbenchActionConstants
,
IActionBars.setGlobalActionHandler(String, IAction)
public Map getGlobalActionHandlers()
public IMenuManager getMenuManager()
updateActionBars
.getMenuManager
in interface IActionBars
protected final IActionBars getParent()
public final IServiceLocator getServiceLocator()
getServiceLocator
in interface IActionBars
IServiceLocater
or the parents if
the receiver does not have onepublic IStatusLineManager getStatusLineManager()
updateActionBars
.getStatusLineManager
in interface IActionBars
public IToolBarManager getToolBarManager()
updateActionBars
.getToolBarManager
in interface IActionBars
protected final boolean isSubMenuManagerCreated()
protected final boolean isSubStatusLineManagerCreated()
protected final boolean isSubToolBarManagerCreated()
public void partChanged(IWorkbenchPart part)
public void removePropertyChangeListener(IPropertyChangeListener listener)
listener
- a property change listenerprotected void setActive(boolean set)
public void setGlobalActionHandler(String actionID, IAction handler)
setGlobalActionHandler
in interface IActionBars
actionID
- an action ID declared in the registryhandler
- an action which implements the action ID. null
may be passed to deregister a handler.IWorkbenchActionConstants
protected final void setServiceLocator(IServiceLocator locator)
locator
- The new locator; must not be null
.public void updateActionBars()
updateActionBars
in interface IActionBars
IActionBars.setGlobalActionHandler(String, IAction)
,
IActionBars.clearGlobalActionHandlers()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.