public class MonologFXButton
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MonologFXButton.Type
Type of button, with several built-in options and three custom ones.
|
Constructor and Description |
---|
MonologFXButton()
Default constructor for a MonologFX button.
|
Modifier and Type | Method and Description |
---|---|
javafx.scene.Node |
getIcon()
Returns the graphic file (if one is assigned) for this button.
|
java.lang.String |
getLabel()
Returns the appropriate button label according to the following rules:
|
MonologFXButton.Type |
getType()
Returns the type of this button.
|
boolean |
isCancelButton()
Indicates if this button is designated as the "cancel" button.
|
boolean |
isDefaultButton()
Indicates if this button is designated as the "default" button.
|
void |
setCancelButton(boolean cancelButton)
Designates this button as the "cancel" button - or not.
|
void |
setDefaultButton(boolean defaultButton)
Designates this button as the "default" button - or not.
|
void |
setIcon(java.lang.String iconFile)
Sets the graphic for use on the button, either alone or with text.
|
void |
setLabel(java.lang.String label)
Sets the label text for the button.
|
void |
setType(MonologFXButton.Type type)
Sets the type of this button.
|
public MonologFXButton()
Default constructor for a MonologFX button. Plain button, no label or icon and no default or cancel designation(s).
public MonologFXButton.Type getType()
Returns the type of this button.
MonologFXButton.Type
public void setType(MonologFXButton.Type type)
Sets the type of this button.
type
- MonologFXButton.Type designation.MonologFXButton.Type
public java.lang.String getLabel()
Returns the appropriate button label according to the following rules:
If the developer specifies a label, it returns that text.
If not, the button checks for a resource with i18n (internationalization) text to use for this type of button. If it finds the file and the key corresponding to this button type, it returns the i18n value.
If none of the above conditions are met, it returns default text.
public void setLabel(java.lang.String label)
Sets the label text for the button.
To assign a shortcut key, simply place an underscore character ("_") in front of the desired shortcut character.
label
- String consisting of the desired button text.public javafx.scene.Node getIcon()
Returns the graphic file (if one is assigned) for this button.
public void setIcon(java.lang.String iconFile)
Sets the graphic for use on the button, either alone or with text. Graphic format must be .png, .jpg (others?) supported by ImageView.
iconFile
- String containing the location and name of a graphic file
(.png, .jpg) for use as an icon on the button face.ImageView
public boolean isDefaultButton()
Indicates if this button is designated as the "default" button.
public void setDefaultButton(boolean defaultButton)
Designates this button as the "default" button - or not.
defaultButton
- Boolean.public boolean isCancelButton()
Indicates if this button is designated as the "cancel" button.
public void setCancelButton(boolean cancelButton)
Designates this button as the "cancel" button - or not.
cancelButton
- Boolean.