public class SubContributionItem extends Object implements IContributionItem
SubContributionItem
is a wrapper for an IContributionItem
.
It is used within a SubContributionManager
to control the visibility
of items.
This class is not intended to be subclassed.
Constructor and Description |
---|
SubContributionItem(IContributionItem item)
Creates a new
SubContributionItem . |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
The default implementation of this
IContributionItem
delegates to the inner item. |
void |
fill(Composite parent)
Fills the given composite control with controls representing this
contribution item.
|
void |
fill(CoolBar parent,
int index)
Fills the given cool bar with controls representing this contribution item.
|
void |
fill(Menu parent,
int index)
Fills the given menu with controls representing this contribution item.
|
void |
fill(ToolBar parent,
int index)
Fills the given tool bar with controls representing this contribution item.
|
String |
getId()
Returns the identifier of this contribution item.
|
IContributionItem |
getInnerItem()
Returns the inner contribution item.
|
boolean |
isDirty()
Returns whether this contribution item is dirty.
|
boolean |
isDynamic()
Returns whether this contribution item is dynamic.
|
boolean |
isEnabled()
Returns whether this contribution item is enabled.
|
boolean |
isGroupMarker()
Returns whether this contribution item is a group marker.
|
boolean |
isSeparator()
Returns whether this contribution item is a separator.
|
boolean |
isVisible()
Returns whether this contribution item is visibile within its manager.
|
void |
saveWidgetState()
Saves any state information of the control(s) owned by this contribution item.
|
void |
setParent(IContributionManager parent)
Sets the parent manager of this item
|
void |
setVisible(boolean visible)
Sets whether this contribution item is visibile within its manager.
|
void |
update()
Updates any SWT controls cached by this contribution item with any
changes which have been made to this contribution item since the last update.
|
void |
update(String id)
Updates any SWT controls cached by this contribution item with changes
for the the given property.
|
public SubContributionItem(IContributionItem item)
SubContributionItem
.item
- the contribution item to be wrappedpublic void dispose()
IContributionItem
delegates to the inner item. Subclasses may override.dispose
in interface IContributionItem
public void fill(Composite parent)
IContributionItem
StatusLineManager
.fill
in interface IContributionItem
parent
- the parent controlpublic void fill(Menu parent, int index)
IContributionItem
MenuManager
.fill
in interface IContributionItem
parent
- the parent menuindex
- the index where the controls are inserted,
or -1
to insert at the endpublic void fill(ToolBar parent, int index)
IContributionItem
ToolBarManager
.fill
in interface IContributionItem
parent
- the parent tool barindex
- the index where the controls are inserted,
or -1
to insert at the endpublic String getId()
IContributionItem
getId
in interface IContributionItem
null
if nonepublic IContributionItem getInnerItem()
public boolean isEnabled()
IContributionItem
isEnabled
in interface IContributionItem
true
if this item is enabledpublic boolean isDirty()
IContributionItem
isDirty
in interface IContributionItem
true
if this item is dirtypublic boolean isDynamic()
IContributionItem
isDynamic
in interface IContributionItem
true
if this item is dynamic, and
false
for normal itemspublic boolean isGroupMarker()
IContributionItem
isGroupMarker
in interface IContributionItem
true
if this item is a group marker, and
false
for normal itemsGroupMarker
,
IContributionManager.appendToGroup(String, IContributionItem)
,
IContributionManager.prependToGroup(String, IContributionItem)
public boolean isSeparator()
IContributionItem
isSeparator
in interface IContributionItem
true
if this item is a separator, and
false
for normal itemsSeparator
public boolean isVisible()
IContributionItem
isVisible
in interface IContributionItem
true
if this item is visible, and
false
otherwisepublic void setParent(IContributionManager parent)
IContributionItem
setParent
in interface IContributionItem
parent
- the parent contribution managerpublic void setVisible(boolean visible)
IContributionItem
setVisible
in interface IContributionItem
visible
- true
if this item should be visible, and
false
otherwisepublic void update()
IContributionItem
update
in interface IContributionItem
public void update(String id)
IContributionItem
update
in interface IContributionItem
id
- the id of the changed propertypublic void fill(CoolBar parent, int index)
IContributionItem
CoolBarManager
.fill
in interface IContributionItem
parent
- the parent cool barindex
- the index where the controls are inserted,
or -1
to insert at the endpublic void saveWidgetState()
IContributionItem
saveWidgetState
in interface IContributionItem
Copyright (c) 2000, 2013 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.