Package com.iizigo.jface
Class EnabledItemsCompoundItem
- java.lang.Object
- org.eclipse.jface.action.ContributionItem
- org.eclipse.ui.actions.CompoundContributionItem
- com.iizigo.jface.EnabledItemsCompoundItem
- All Implemented Interfaces:
IAddActionsOrContributions
,org.eclipse.jface.action.IContributionItem
public class EnabledItemsCompoundItem extends org.eclipse.ui.actions.CompoundContributionItem implements IAddActionsOrContributions
Class for enabled items.- Author:
- Christopher Mindus
Constructor Summary
Constructors Constructor Description EnabledItemsCompoundItem()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnabledItemsCompoundItem
add(org.eclipse.jface.action.IAction action)
Adds an action.EnabledItemsCompoundItem
add(org.eclipse.jface.action.IContributionItem item)
Adds an item.EnabledItemsCompoundItem
addSeparator()
Adds a separator.protected org.eclipse.jface.action.IContributionItem[]
getContributionItems()
Overrides to return only enabled items, skipping separators as required in order not to duplicate or have single ones.boolean
hasVisibleEnabledItems()
Checks the state of all items.void
setRemoveSeparators(boolean skipLeading, boolean skipTrailing)
Sets removal of separators.void
update()
Updates state.void
update(java.lang.String id)
Updates state.Methods inherited from class org.eclipse.ui.actions.CompoundContributionItem
dispose, fill, isDirty, isDynamic, setParent
Method Detail
setRemoveSeparators
public void setRemoveSeparators(boolean skipLeading, boolean skipTrailing)
Sets removal of separators.- Parameters:
skipLeading
- Leading separators skip flag.skipTrailing
- Trailing separators skip flag.
getContributionItems
protected org.eclipse.jface.action.IContributionItem[] getContributionItems()
Overrides to return only enabled items, skipping separators as required in order not to duplicate or have single ones.- Specified by:
getContributionItems
in classorg.eclipse.ui.actions.CompoundContributionItem
add
public EnabledItemsCompoundItem add(org.eclipse.jface.action.IContributionItem item)
Adds an item.- Specified by:
add
in interfaceIAddActionsOrContributions
add
public EnabledItemsCompoundItem add(org.eclipse.jface.action.IAction action)
Adds an action.- Specified by:
add
in interfaceIAddActionsOrContributions
addSeparator
public EnabledItemsCompoundItem addSeparator()
Adds a separator.- Specified by:
addSeparator
in interfaceIAddActionsOrContributions
update
public void update()
Updates state.- Specified by:
update
in interfaceorg.eclipse.jface.action.IContributionItem
- Overrides:
update
in classorg.eclipse.jface.action.ContributionItem
update
public void update(java.lang.String id)
Updates state.- Specified by:
update
in interfaceorg.eclipse.jface.action.IContributionItem
- Overrides:
update
in classorg.eclipse.jface.action.ContributionItem
hasVisibleEnabledItems
public boolean hasVisibleEnabledItems()
Checks the state of all items.