Package org.eclipse.jface.viewers
Class ViewerLabel
java.lang.Object
org.eclipse.jface.viewers.ViewerLabel
The ViewerLabel is the class that is passed to a viewer to handle updates of
labels. It keeps track of both original and updates text.
- Since:
- 3.0
- See Also:
-
Constructor Summary
ConstructorDescriptionViewerLabel
(String initialText, Image initialImage) Create a new instance of the receiver with the supplied initial text and image. -
Method Summary
Modifier and TypeMethodDescriptionGet the background Color.getFont()
Get the font.Get the foreground Color.final Image
getImage()
Get the image for the receiver.final String
getText()
Get the text for the receiver.Return the tool tip background color.Return the foregroundColor
.Returns the tooltipText.boolean
Return whether or not the background color has been set.boolean
Return whether or not the font has been set.boolean
Return whether or not the foreground color has been set.boolean
Return whether or not the image has been set.boolean
Return whether or not the text has been set.boolean
Return whether or not the tool tip background color has been set.boolean
Return whether or not the tool tip foreground color has been set.boolean
Return whether or not the tool tip text has been set.boolean
void
setBackground
(Color background) Set the background Color.void
Set the font.void
setForeground
(Color foreground) Set the foreground Color.final void
Set the image for the receiver.final void
Set the text for the receiver.void
setTooltipBackgroundColor
(Color tooltipBackgroundColor) Set the backgroundColor
for tool tip.void
setTooltipForegroundColor
(Color tooltipForegroundColor) Set the foregroundColor
for tool tip.void
setTooltipShift
(Point tooltipShift) void
setTooltipText
(String tooltipText) Set the tool tip text.
-
Constructor Details
-
ViewerLabel
Create a new instance of the receiver with the supplied initial text and image.- Parameters:
initialText
- initial textinitialImage
- initial image
-
-
Method Details
-
getImage
Get the image for the receiver. If the new image has been set return it, otherwise return the starting image.- Returns:
- Returns the image.
-
setImage
Set the image for the receiver.- Parameters:
image
- The image to set.
-
getText
Get the text for the receiver. If the new text has been set return it, otherwise return the starting text.- Returns:
- String or
null
if there was no initial text and nothing was updated.
-
setText
Set the text for the receiver.- Parameters:
text
- String The label to set. This value should not benull
.- See Also:
-
hasNewImage
public boolean hasNewImage()Return whether or not the image has been set.- Returns:
- boolean.
true
if the image has been set to something new. - Since:
- 3.1
-
hasNewText
public boolean hasNewText()Return whether or not the text has been set.- Returns:
- boolean.
true
if the text has been set to something new.
-
hasNewBackground
public boolean hasNewBackground()Return whether or not the background color has been set.- Returns:
- boolean.
true
if the value has been set.
-
hasNewForeground
public boolean hasNewForeground()Return whether or not the foreground color has been set.- Returns:
- boolean.
true
if the value has been set. - Since:
- 3.1
-
hasNewFont
public boolean hasNewFont()Return whether or not the font has been set.- Returns:
- boolean.
true
if the value has been set. - Since:
- 3.1
-
getBackground
Get the background Color.- Returns:
- Color or
null
if no new value was set. - Since:
- 3.1
-
setBackground
Set the background Color.- Parameters:
background
- Color. This value should not benull
.- Since:
- 3.1
-
getFont
Get the font.- Returns:
- Font or
null
if no new value was set. - Since:
- 3.1
-
setFont
Set the font.- Parameters:
font
- Font This value should not benull
.- Since:
- 3.1
-
getForeground
Get the foreground Color.- Returns:
- Color or
null
if no new value was set. - Since:
- 3.1
-
setForeground
Set the foreground Color.- Parameters:
foreground
- Color This value should not benull
.- Since:
- 3.1
-
getTooltipText
Returns the tooltipText.- Returns:
String
ornull
if the tool tip text was never set.- Since:
- 3.3
-
setTooltipText
Set the tool tip text.- Parameters:
tooltipText
- The tooltipTextString
to set. This value should not benull
.- Since:
- 3.3
-
hasNewTooltipText
public boolean hasNewTooltipText()Return whether or not the tool tip text has been set.- Returns:
boolean
.true
if the tool tip text has been set.- Since:
- 3.3
-
getTooltipBackgroundColor
Return the tool tip background color.- Returns:
Color
ornull
if the tool tip background color has not been set.- Since:
- 3.3
-
setTooltipBackgroundColor
Set the backgroundColor
for tool tip.- Parameters:
tooltipBackgroundColor
- TheColor
to set. This value should not benull
.- Since:
- 3.3
-
hasNewTooltipBackgroundColor
public boolean hasNewTooltipBackgroundColor()Return whether or not the tool tip background color has been set.- Returns:
boolean
.true
if the tool tip text has been set.- Since:
- 3.3
-
getTooltipForegroundColor
Return the foregroundColor
.- Returns:
- Returns
Color
ornull
if the tool tip foreground color has not been set. - Since:
- 3.3
-
setTooltipForegroundColor
Set the foregroundColor
for tool tip.- Parameters:
tooltipForegroundColor
- The tooltipForegroundColor to set.- Since:
- 3.3
-
hasNewTooltipForegroundColor
public boolean hasNewTooltipForegroundColor()Return whether or not the tool tip foreground color has been set.- Returns:
boolean
.true
if the tool tip foreground has been set.- Since:
- 3.3
-
getTooltipShift
- Returns:
- Returns the tooltipShift.
- Since:
- 3.3
-
setTooltipShift
- Parameters:
tooltipShift
- The tooltipShift to set.- Since:
- 3.3
-
hasTooltipShift
public boolean hasTooltipShift()- Returns:
- Return whether or not the tool tip shift has been set.
- Since:
- 3.3
-