Package com.iizigo.prop.tooltip
Class TooltipItem
- java.lang.Object
- com.iizigo.prop.tooltip.TooltipItem
public class TooltipItem extends java.lang.Object
Tooltip item class used to display a tooltip for a property container implementing theITooltipPropList
interface.Flags are composed as F_* bit flag or'ed with the type of:
- 0 = normal text
- 1 = property value (perhaps using formatter)
- 2 = property name getPropName()
- 3 = getCNText()
- 4 = getCNDescription()
- 5 = getCNDescriptionType()
- 14 = Vertical indent with "valueFlags" pixels
- 15 = Horizontal line
- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description static int
F_BOLD
Flag for bold font, cannot be combined with italic font.static int
F_IMAGE
Flag for Image.static int
F_ITALIC
Flag for bold font, cannot be combined with italic font.static int
F_ITALIC_NONE
Flag for bold font, cannot be combined with italic font.static TooltipItem
HEADER_DESCR_TEXT
Header line: BOLD + CNDescription + ':' + CNText.static TooltipItem
HEADER_IMAGE_DESCR_TYPE
Header line: BOLD + CNDescription + ':'.static TooltipItem
HEADER_IMAGE_DESCR_TYPE_NAME
Header line: BOLD + CNDescription + ':' + PropName.static TooltipItem
SEPARATOR
The horizontal separator line.static TooltipItem
SPACER_4PX
The vertical indent of 4 pixels.static TooltipItem
SPACER_8PX
The vertical indent of 8 pixels.static int
T_CN_DESCRIPTION
Type: string as getCNDescription().static int
T_CN_DESCRIPTION_TYPE
Type: string as getCNDescriptionType().static int
T_CN_TEXT
Type: string as getCNText().static int
T_CN_TYPE_DESCRIPTION_TYPE
Type: string as getCNTypeDescriptionType() when available (only for IPropDesigner implementing properties).static int
T_NORMAL
Type: normal.static int
T_PROP_NAME
Type: property name.static int
T_PROP_VALUE
Type: property value (perhaps using formatter).
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
createLine(org.eclipse.swt.widgets.Composite parent, PropCnr pc, int verticalIndent)
Creates a line with the settings specified.static TooltipItem
newID(java.lang.String prompt)
Constructs a line with normal fonts of a text prompt and a property name "ID" (Atom).static TooltipItem
newIntIndex(java.lang.String prompt, Atom atomName, java.lang.String[] array)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.static TooltipItem
newIntIndex(java.lang.String prompt, Atom atomName, java.lang.String[] array, java.lang.String defaultValue)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.static TooltipItem
newIntIndex(java.lang.String prompt, java.lang.String atomName, java.lang.String[] array)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.static TooltipItem
newIntIndex(java.lang.String prompt, java.lang.String atomName, java.lang.String[] array, java.lang.String defaultValue)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.static TooltipItem
newNormal(java.lang.String prompt, ITooltipStringFormatter formatter)
Constructs a line with normal fonts of a text prompt and a formatter.static TooltipItem
newNormal(java.lang.String prompt, Atom atom)
Constructs a line with normal fonts of a text prompt and a property atom.static TooltipItem
newNormal(java.lang.String prompt, Atom atom, ITooltipStringFormatter formatter)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.static TooltipItem
newNormal(java.lang.String prompt, java.lang.String atomName)
Constructs a line with normal fonts of a text prompt and a property atom.static TooltipItem
newNormal(java.lang.String prompt, java.lang.String atomName, ITooltipStringFormatter formatter)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.static TooltipItem
newNormalItalicEmpty(java.lang.String prompt, Atom atom)
Constructs a line with normal fonts of a text prompt and a property atom.static TooltipItem
newNormalItalicEmpty(java.lang.String prompt, java.lang.String atomName)
Constructs a line with normal fonts of a text prompt and a property atom.static TooltipItem
newNormalItalicEmpty(java.lang.String prompt, java.lang.String atomName, ITooltipStringFormatter formatter)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.
Field Detail
F_IMAGE
public static final int F_IMAGE
Flag for Image.- See Also:
- Constant Field Values
F_BOLD
public static final int F_BOLD
Flag for bold font, cannot be combined with italic font.- See Also:
- Constant Field Values
F_ITALIC
public static final int F_ITALIC
Flag for bold font, cannot be combined with italic font.- See Also:
- Constant Field Values
F_ITALIC_NONE
public static final int F_ITALIC_NONE
Flag for bold font, cannot be combined with italic font.- See Also:
- Constant Field Values
T_NORMAL
public static final int T_NORMAL
Type: normal.- See Also:
- Constant Field Values
T_PROP_VALUE
public static final int T_PROP_VALUE
Type: property value (perhaps using formatter).- See Also:
- Constant Field Values
T_PROP_NAME
public static final int T_PROP_NAME
Type: property name.- See Also:
- Constant Field Values
T_CN_TEXT
public static final int T_CN_TEXT
Type: string as getCNText().- See Also:
- Constant Field Values
T_CN_DESCRIPTION
public static final int T_CN_DESCRIPTION
Type: string as getCNDescription().- See Also:
- Constant Field Values
T_CN_DESCRIPTION_TYPE
public static final int T_CN_DESCRIPTION_TYPE
Type: string as getCNDescriptionType().- See Also:
- Constant Field Values
T_CN_TYPE_DESCRIPTION_TYPE
public static final int T_CN_TYPE_DESCRIPTION_TYPE
Type: string as getCNTypeDescriptionType() when available (only for IPropDesigner implementing properties).- See Also:
- Constant Field Values
HEADER_IMAGE_DESCR_TYPE
public static final TooltipItem HEADER_IMAGE_DESCR_TYPE
Header line: BOLD + CNDescription + ':'.
HEADER_IMAGE_DESCR_TYPE_NAME
public static final TooltipItem HEADER_IMAGE_DESCR_TYPE_NAME
Header line: BOLD + CNDescription + ':' + PropName.
HEADER_DESCR_TEXT
public static final TooltipItem HEADER_DESCR_TEXT
Header line: BOLD + CNDescription + ':' + CNText.
SEPARATOR
public static final TooltipItem SEPARATOR
The horizontal separator line.
SPACER_4PX
public static final TooltipItem SPACER_4PX
The vertical indent of 4 pixels.
SPACER_8PX
public static final TooltipItem SPACER_8PX
The vertical indent of 8 pixels.
Method Detail
newID
public static TooltipItem newID(java.lang.String prompt)
Constructs a line with normal fonts of a text prompt and a property name "ID" (Atom).- Parameters:
prompt
- The text prompt.- Returns:
- A tooltip item.
newNormal
public static TooltipItem newNormal(java.lang.String prompt, java.lang.String atomName)
Constructs a line with normal fonts of a text prompt and a property atom.- Parameters:
prompt
- The text prompt.atomName
- The atom name.- Returns:
- A tooltip item.
newNormal
public static TooltipItem newNormal(java.lang.String prompt, Atom atom)
Constructs a line with normal fonts of a text prompt and a property atom.- Parameters:
prompt
- The text prompt.atom
- The atom name.- Returns:
- A tooltip item.
newNormal
public static TooltipItem newNormal(java.lang.String prompt, Atom atom, ITooltipStringFormatter formatter)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.- Parameters:
prompt
- The text prompt.atom
- The atom.formatter
- The formatter of the item.- Returns:
- A tooltip item.
newNormal
public static TooltipItem newNormal(java.lang.String prompt, java.lang.String atomName, ITooltipStringFormatter formatter)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.- Parameters:
prompt
- The text prompt.atomName
- The atom name.formatter
- The formatter of the item.- Returns:
- A tooltip item.
newIntIndex
public static TooltipItem newIntIndex(java.lang.String prompt, java.lang.String atomName, java.lang.String[] array, java.lang.String defaultValue)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.- Parameters:
prompt
- The text prompt.atomName
- The atom name.array
- Array containing zero-based valuesdefaultValue
- String value to show if value is undefined or out of range.- Returns:
- A tooltip item.
newIntIndex
public static TooltipItem newIntIndex(java.lang.String prompt, java.lang.String atomName, java.lang.String[] array)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.- Parameters:
prompt
- The text prompt.atomName
- The atom name.array
- Array containing zero-based values- Returns:
- A tooltip item.
newIntIndex
public static TooltipItem newIntIndex(java.lang.String prompt, Atom atomName, java.lang.String[] array, java.lang.String defaultValue)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.- Parameters:
prompt
- The text prompt.atomName
- The atom name.array
- Array containing zero-based valuesdefaultValue
- String value to show if value is undefined or out of range.- Returns:
- A tooltip item.
newIntIndex
public static TooltipItem newIntIndex(java.lang.String prompt, Atom atomName, java.lang.String[] array)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter.- Parameters:
prompt
- The text prompt.atomName
- The atom name.array
- Array containing zero-based values- Returns:
- A tooltip item.
newNormal
public static TooltipItem newNormal(java.lang.String prompt, ITooltipStringFormatter formatter)
Constructs a line with normal fonts of a text prompt and a formatter. Italic is used for the value if the string is empty, replacing the empty value string with "empty".- Parameters:
prompt
- The text prompt.formatter
- The formatter of the item.- Returns:
- A tooltip item.
newNormalItalicEmpty
public static TooltipItem newNormalItalicEmpty(java.lang.String prompt, java.lang.String atomName)
Constructs a line with normal fonts of a text prompt and a property atom. Italic is used for the value if the string is empty, replacing the empty value string with "empty".- Parameters:
prompt
- The text prompt.atomName
- The atom name.- Returns:
- A tooltip item.
newNormalItalicEmpty
public static TooltipItem newNormalItalicEmpty(java.lang.String prompt, Atom atom)
Constructs a line with normal fonts of a text prompt and a property atom. Italic is used for the value if the string is empty, replacing the empty value string with "empty".- Parameters:
prompt
- The text prompt.atom
- The atom name.- Returns:
- A tooltip item.
newNormalItalicEmpty
public static TooltipItem newNormalItalicEmpty(java.lang.String prompt, java.lang.String atomName, ITooltipStringFormatter formatter)
Constructs a line with normal fonts of a text prompt and a property atom with a formatter. Italic is used for the value if the string is empty, replacing the empty value string with "empty".- Parameters:
prompt
- The text prompt.atomName
- The atom name.formatter
- The formatter of the item.- Returns:
- A tooltip item.
createLine
public int createLine(org.eclipse.swt.widgets.Composite parent, PropCnr pc, int verticalIndent)
Creates a line with the settings specified.- Parameters:
parent
- The parent composite.pc
- The property container.verticalIndent
- The vertical indent, negative value indicates separator before.- Returns:
- The vertical indent for next item, negative value indicates separator after.