Class RichTooltip
- java.lang.Object
-
- org.pushingpixels.radiance.component.api.common.RichTooltip
-
public class RichTooltip extends java.lang.Object
Rich tooltip for command buttons.In its most basic form, the rich tooltip has a title and one (possible multiline) description text:
+--------------------------------+ | Title | | Some description text | +--------------------------------+
The
RichTooltip.Builder.addDescriptionSection(String)
can be used to add multiple sections to the description:+--------------------------------+ | Title | | First multiline | | description section | | | | Second multiline | | description section | | | | Third multiline | | description section | +--------------------------------+
The
RichTooltip.Builder.setMainIconFactory(RadianceIcon.Factory)
can be used to place an image below the title and to the left of the description sections:+--------------------------------+ | Title | | ******* First multiline | | *image* description section | | ******* | | Second multiline | | description section | +--------------------------------+
The
RichTooltip.Builder.addFooterSection(String)
can be used to add (possibly) multiple footer sections that will be shown below a horizontal separator:+--------------------------------+ | Title | | First multiline | | description section | | | | Second multiline | | description section | |--------------------------------| | A multiline footer section | | placed below a separator | +--------------------------------+
The
RichTooltip.Builder.setFooterIconFactory(RadianceIcon.Factory)
can be used to place an image to the left of the footer sections:+--------------------------------+ | Title | | First multiline | | description section | | | | Second multiline | | description section | |--------------------------------| | ******* A multiline | | *image* footer section | | ******* | +--------------------------------+
Here is a fully fledged rich tooltip that shows all these APIs in action:
+--------------------------------+ | Title | | ******* First multiline | | *image* description section | | ******* | | Second multiline | | description section | |--------------------------------| | ******* First multiline | | *image* footer section | | ******* | | Second multiline | | footer section | +--------------------------------+
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RichTooltip.Builder
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
descriptionSections
The description sections of this tooltip.private RadianceIcon
footerIcon
The ooter icon of this tooltip.private java.util.List<java.lang.String>
footerSections
The footer sections of this tooltip.private RadianceIcon
mainIcon
The main icon of this tooltip.private java.lang.String
title
The main title of this tooltip.
-
Constructor Summary
Constructors Modifier Constructor Description private
RichTooltip()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RichTooltip.Builder
builder()
java.util.List<java.lang.String>
getDescriptionSections()
Returns an unmodifiable list of description sections of this tooltip.RadianceIcon
getFooterIcon()
Returns the footer icon of this tooltip.java.util.List<java.lang.String>
getFooterSections()
Returns an unmodifiable list of footer sections of this tooltip.RadianceIcon
getMainIcon()
Returns the main icon of this tooltip.java.lang.String
getTitle()
Returns the main title of this tooltip.
-
-
-
Field Detail
-
title
private java.lang.String title
The main title of this tooltip.- See Also:
getTitle()
-
mainIcon
private RadianceIcon mainIcon
The main icon of this tooltip. Can benull
.- See Also:
getMainIcon()
-
descriptionSections
private java.util.List<java.lang.String> descriptionSections
The description sections of this tooltip.- See Also:
getDescriptionSections()
-
footerIcon
private RadianceIcon footerIcon
The ooter icon of this tooltip. Can benull
.- See Also:
getFooterIcon()
-
footerSections
private java.util.List<java.lang.String> footerSections
The footer sections of this tooltip. Can be empty.- See Also:
getFooterSections()
-
-
Method Detail
-
getTitle
public java.lang.String getTitle()
Returns the main title of this tooltip.- Returns:
- The main title of this tooltip.
-
getMainIcon
public RadianceIcon getMainIcon()
Returns the main icon of this tooltip. Can returnnull
.- Returns:
- The main icon of this tooltip.
- See Also:
getDescriptionSections()
-
getDescriptionSections
public java.util.List<java.lang.String> getDescriptionSections()
Returns an unmodifiable list of description sections of this tooltip. Guaranteed to return a non-null
list.- Returns:
- An unmodifiable list of description sections of this tooltip.
- See Also:
getTitle()
,getMainIcon()
-
getFooterIcon
public RadianceIcon getFooterIcon()
Returns the footer icon of this tooltip. Can returnnull
.- Returns:
- The footer icon of this tooltip.
- See Also:
getFooterSections()
-
getFooterSections
public java.util.List<java.lang.String> getFooterSections()
Returns an unmodifiable list of footer sections of this tooltip. Guaranteed to return a non-null
list.- Returns:
- An unmodifiable list of footer sections of this tooltip.
- See Also:
getFooterIcon()
-
builder
public static RichTooltip.Builder builder()
-
-