BiLabel
This class is used to show text
This class extends
BiComponent
and therefore all methods and fields available for
BiComponent
are also available for
BiLabel
.
Constructor
new
BiLabel
(
[
sText
]
)
Parameters
| Name | Type | Optional | Default | Descripton |
sText |
String |
![]() |
"" |
The text to show on the label |
Properties
| Name | Type | get | set | Descripton |
align |
String |
![]() |
![]() |
The text alignment. Valid values are:leftrightcenterjustify
|
font |
|
![]() |
![]() |
This is used to describe how to paint the text on the label. |
html |
String |
![]() |
![]() |
The HTML text shown on the label |
icon |
|
![]() |
![]() |
The icon image to show on the label. Note that changing the image object does not update the label icon. You'll have to set the icon property to update the label icon. |
iconPosition |
String |
![]() |
![]() |
The position of the icon relative to the text. Valid values are:leftrighttopbottom
|
iconTextGap |
Number |
![]() |
![]() |
The gap between the icon and the text (in pixels) |
labelFor |
|
![]() |
![]() |
If this is set then focusing on the current label moves the focus to another component |
mnemonic |
String |
![]() |
![]() |
A character used to give UI hints about the access key for the label |
paddingBottom |
Number |
![]() |
![]() |
The bottom padding (in pixels) |
paddingLeft |
Number |
![]() |
![]() |
The left padding (in pixels) |
paddingRight |
Number |
![]() |
![]() |
The right padding (in pixels) |
paddingTop |
Number |
![]() |
![]() |
The top padding (in pixels) |
text |
String |
![]() |
![]() |
The plain text shown on the label |
verticalAlign |
String |
![]() |
![]() |
NOT IMPLEMENTED The vertical text alignment. Valid values are: topmiddlebottom
|
wrap |
Boolean |
![]() |
![]() |
Whether to wrap the text if the label is not wide enough |
Methods
| Name | Description |
setPadding |
Sets the padding on more than one side. This method can ba called with
1, 2 or 4 arguments. In case of 1 argument it sets the padding on all
sides. If 2 arguments are used then the padding on the left/right and
top/bottom are set to the same. And if called with 4 all 4 sides can have
different padding,setPadding(nPadding) - Sets the padding on all sides to
nPaddingsetPadding(nLeftRight, nTopBottom) - Sets the padding on
the left and right to nLeftRight and the padding on the
top and bottom to nTopBottomsetPadding(nLeft, nRight, nTop, nBottom) - Sets the padding
on all sides to nLeft, nRight, nTop
and nBottom respectively.
|
Events
None.
Static Methods
| Name | Description |
addMnemonic |
Changes an HTML string to designate a character as a mnemonic |
htmlToText |
Strips HTML markup from an HTML string and returns a plain text string |
textToHtml |
Converts a plain text string to HTML. This includes adding line breaks and entities. |
Static Fields
None.
Remarks
To change the font of the component you have to use setFont(). Changing the font object without calling setFont() will not update the component. To change the icon of the component you have to use setIcon(). Changing the image object without calling setIcon() will not update the component.
Method Details
setPadding
Sets the padding on more than one side. This method can ba called with
1, 2 or 4 arguments. In case of 1 argument it sets the padding on all
sides. If 2 arguments are used then the padding on the left/right and
top/bottom are set to the same. And if called with 4 all 4 sides can have
different padding,
setPadding(nPadding) - Sets the padding on all sides to
nPadding
setPadding(nLeftRight, nTopBottom) - Sets the padding on
the left and right to nLeftRight and the padding on the
top and bottom to nTopBottom
setPadding(nLeft, nRight, nTop, nBottom) - Sets the padding
on all sides to nLeft, nRight, nTop
and nBottom respectively.
Syntax
object.setPadding ( nLeft [ ,nRight [ ,nTop [ ,nBottom ] ] ] )
Parameters
| Name | Type | Optional | Default | Descripton |
nLeft |
Number |
Left padding | ||
nRight |
Number |
![]() |
Right padding | |
nTop |
Number |
![]() |
Top padding | |
nBottom |
Number |
![]() |
Bottom padding |
Return Type
void
Static Method Details
addMnemonic
Changes an HTML string to designate a character as a mnemonic
Syntax
BiLabel . addMnemonic ( sHtml,sMnemonic )
Parameters
| Name | Type | Optional | Default | Descripton |
sHtml |
String |
The HTML text to add the mnemonic to | ||
sMnemonic |
String |
The mnemonic character |
Return Type
String
htmlToText
Strips HTML markup from an HTML string and returns a plain text string
Syntax
BiLabel
.
htmlToText
(
sHtml
)
Parameters
| Name | Type | Optional | Default | Descripton |
sHtml |
String |
The HTML string to convert |
Return Type
String
textToHtml
Converts a plain text string to HTML. This includes adding line breaks and entities.
Syntax
BiLabel
.
textToHtml
(
sText
)
Parameters
| Name | Type | Optional | Default | Descripton |
sText |
String |
The plain text string to convert |
Return Type
String
