public class ActionFactoryMenuContributor extends AbstractSubmenuContributor
MenuContributor
which loads Action
s using a ActionFactory
. The
ActionFactory
and action keys are passed as parameters to the
constructor
.log
Constructor and Description |
---|
ActionFactoryMenuContributor(ActionFactory actionFactory,
String... actionKeys) |
Modifier and Type | Method and Description |
---|---|
protected void |
doContribute(ContributionContext context,
MenuBuilder menuBuilder) |
String |
getGroup() |
boolean |
isHideIfDisabled()
Whether disabled actions shall be hidden or not.
|
void |
setGroup(String group)
Specifies to which
group the actions shall be
contributed. |
void |
setHideIfDisabled(boolean hideIfDisabled)
Specify whether actions that are not enabled should be hidden.
|
contribute, setTargetSubmenu, setTargetSubmenu
public ActionFactoryMenuContributor(ActionFactory actionFactory, String... actionKeys)
actionFactory
- the ActionFactory
to be used to lookup the specified action keysactionKeys
- the action keys to be usedIllegalArgumentException
- if one or both of the arguments are null
.public String getGroup()
public void setGroup(String group)
group
the actions shall be
contributed. If this value is null
(the default) MenuBuilder.GROUP_DEFAULT
will be assumed.group
- the group into which the actions shall be added or null
if the
default group
shall be usedprotected void doContribute(ContributionContext context, MenuBuilder menuBuilder)
doContribute
in class AbstractSubmenuContributor
public boolean isHideIfDisabled()
setHideIfDisabled(boolean)
for details.true
if disabled actions shall not be contributed to the resulting menu.setHideIfDisabled(boolean)
public void setHideIfDisabled(boolean hideIfDisabled)
hideIfDisabled
- If the value is true
, only the enabled actions will be
contributed to the target menu. Otherwise all actions, regardless their enabled state,
will be contributed and shown as disabled in the resulting menu.Copyright © 2024 levigo holding gmbh. All rights reserved.