com.levigo.util.swing.menu
Class ActionFactoryMenuContributor
java.lang.Object
com.levigo.util.swing.menu.AbstractSubmenuContributor
com.levigo.util.swing.menu.ActionFactoryMenuContributor
- All Implemented Interfaces:
- MenuContributor
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
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ActionFactoryMenuContributor
public ActionFactoryMenuContributor(ActionFactory actionFactory,
String... actionKeys)
- Parameters:
actionFactory
- the ActionFactory
to be used to lookup the specified action keysactionKeys
- the action keys to be used
- Throws:
IllegalArgumentException
- if one or both of the arguments are null
.
getGroup
public String getGroup()
setGroup
public void setGroup(String group)
- Specifies to which
group
the actions shall be
contributed. If this value is null
(the default) MenuBuilder.GROUP_DEFAULT
will be assumed.
- Parameters:
group
- the group into which the actions shall be added or null
if the
default group
shall be used
doContribute
protected void doContribute(ContributionContext context,
MenuBuilder menuBuilder)
- Specified by:
doContribute
in class AbstractSubmenuContributor
isHideIfDisabled
public boolean isHideIfDisabled()
- Whether disabled actions shall be hidden or not. Please see
setHideIfDisabled(boolean)
for details.
- Returns:
true
if disabled actions shall not be contributed to the resulting menu.- See Also:
setHideIfDisabled(boolean)
setHideIfDisabled
public void setHideIfDisabled(boolean hideIfDisabled)
- Specify whether actions that are not enabled should be hidden.
- Parameters:
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 © 1995-2020 levigo holding gmbh. All Rights Reserved.