public interface WidgetHandler
Definition of an interface for dealing with widgets.
A widget is an arbitrary GUI element. It can be an input element like a text field, or a checkbox, but also a simple graphical element like a label, or a panel. Through the methods provided by this interface such widgets can be manipulated; for instance they can be made invisible, or their colors can be changed. This way it is possible to change the GUI dynamically.
ComponentBuilderData
provides methods for obtaining
the widgets created during the latest builder operation by name. After a
WidgetHandler
has been obtained this way, it can be used for
doing something with the corresponding widget.
Note: This interface is not intended to be directly implemented by client code. It is subject to change even in minor releases as new features are made available.
Modifier and Type | Method and Description |
---|---|
Color |
getBackgroundColor()
Returns the background color of the underlying widget.
|
Object |
getFont()
Returns the font of this widget.
|
Color |
getForegroundColor()
Returns the foreground color of the underlying widget.
|
String |
getToolTip()
Returns the tool tip text of the underlying widget.
|
Object |
getWidget()
Returns a reference to the underlying widget.
|
boolean |
isVisible()
Returns a flag whether the wrapped widget is currently visible.
|
void |
setBackgroundColor(Color c)
Sets the background color of the underlying widget.
|
void |
setFont(Object font)
Sets the font of this widget.
|
void |
setForegroundColor(Color c)
Sets the foreground color of the underlying widget.
|
void |
setToolTip(String tip)
Sets the tool tip text of the underlying widget.
|
void |
setVisible(boolean f)
Sets the visible flag of the wrapped widget.
|
Object getWidget()
Component
object would be returned.boolean isVisible()
void setVisible(boolean f)
f
- the visible flag of the wrapped widgetColor getBackgroundColor()
void setBackgroundColor(Color c)
c
- the new background color (as a platform-independent
Color
object); if the passed in color object is null,
this operation has no effectColor getForegroundColor()
void setForegroundColor(Color c)
c
- the new background color (as a platform-independent
Color
object); if the passed in color object is null,
this operation has no effectString getToolTip()
setToolTip(String)
. This is due to the fact that certain control
characters like line feeds may have to be converted by a concrete
implementation. To avoid confusion related to changed tool tips client
code should only interact with the ToolTipManager
to manipulate
tool tips.void setToolTip(String tip)
ToolTipManager
should
be used for setting tool tips for widgets.tip
- the new tool tip textObject getFont()
void setFont(Object font)
<f:font>
tag or
directly using the createFont()
method of
ComponentManager
. Concrete implementations may throw a runtime
exception if the font object passed to this method is invalid.font
- the font to be setCopyright © 2016 The JGUIraffe Team. All rights reserved.