Package org.yamcs.studio.core.utils
Class StatusLineContributionItem
java.lang.Object
org.eclipse.jface.action.ContributionItem
org.yamcs.studio.core.utils.StatusLineContributionItem
- All Implemented Interfaces:
IContributionItem
- Direct Known Subclasses:
ConnectionStringStatusLineContributionItem
,MissionTimeStatusLineContributionItem
,ProcessorStatusLineContributionItem
A contribution item to be used with status line managers. Forked and modified from jface's
StatusLineContributionItem, because it does not provide good customization options. (e.g. no tooltip support)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
A constant indicating that the contribution should compute its actual size depending on the text. -
Constructor Summary
ConstructorDescriptionCreates a status line contribution item with the given id.StatusLineContributionItem
(String id, boolean addTrailingSeparator) StatusLineContributionItem
(String id, int charWidth) Creates a status line contribution item with the given id that displays the given number of characters.StatusLineContributionItem
(String id, int charWidth, boolean addTrailingSeparator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClickListener
(Listener listener) void
An accessor for the current location of this status line contribution item -- relative to the display.getText()
Retrieves the text that is being displayed in the status line.boolean
void
setErrorText
(String errorText, String errorDetail) void
void
Sets the text to be displayed in the status line.void
setToolTipText
(String tooltip) Methods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, fill, fill, getId, getParent, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
-
Field Details
-
CALC_TRUE_WIDTH
public static final int CALC_TRUE_WIDTHA constant indicating that the contribution should compute its actual size depending on the text. It will grab all space necessary to display the whole text.- See Also:
-
-
Constructor Details
-
StatusLineContributionItem
Creates a status line contribution item with the given id.- Parameters:
id
- the contribution item's id, ornull
if it is to have no id
-
StatusLineContributionItem
-
StatusLineContributionItem
Creates a status line contribution item with the given id that displays the given number of characters.- Parameters:
id
- the contribution item's id, ornull
if it is to have no idcharWidth
- the number of characters to display. If the value is CALC_TRUE_WIDTH then the contribution will compute the preferred size exactly. Otherwise the size will be based on the average character size * 'charWidth'
-
StatusLineContributionItem
-
-
Method Details
-
fill
- Specified by:
fill
in interfaceIContributionItem
- Overrides:
fill
in classContributionItem
-
isDisposed
public boolean isDisposed() -
getDisplayLocation
An accessor for the current location of this status line contribution item -- relative to the display.- Returns:
- The current location of this status line;
null
if not yet initialized.
-
setToolTipText
-
setImage
-
setErrorText
-
addClickListener
-
getText
Retrieves the text that is being displayed in the status line.- Returns:
- the text that is currently being displayed
-
setText
Sets the text to be displayed in the status line.- Parameters:
text
- the text to be displayed, must not benull
-