|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Component
The top-level component interface which must be implemented by all UI components that use IT Mill Toolkit.
| Nested Class Summary | |
|---|---|
static class |
Component.ErrorEvent
Class of all component originated ErrorEvents. |
static interface |
Component.ErrorListener
Listener interface for receiving Component.Errorss. |
static class |
Component.Event
Superclass of all component originated Events. |
static interface |
Component.Focusable
Interface implemented by components which can obtain input focus. |
static interface |
Component.Listener
Listener interface for receiving Component.Events. |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
| Method Summary | |
|---|---|
void |
addListener(Component.Listener listener)
Registers a new component event listener for this component. |
void |
attach()
Notifies the component that it is connected to an application. |
void |
childRequestedRepaint(Collection alreadyNotified)
The children must call this method when they need repainting. |
void |
detach()
Notifies the component that it is detached from the application. |
Application |
getApplication()
Gets the component's parent application. |
String |
getCaption()
Gets the caption of the component. |
Resource |
getIcon()
Gets the component's icon. |
Locale |
getLocale()
Gets the locale of this component. |
Component |
getParent()
Gets the visual parent of the component. |
String |
getStyle()
Gets the look-and-feel style of the component. |
Window |
getWindow()
Gets the component's parent window. |
boolean |
isEnabled()
Tests if the component is enabled or not. |
boolean |
isReadOnly()
Tests if the component is in read-only mode. |
boolean |
isVisible()
Tests if the component is visible or not. |
void |
removeListener(Component.Listener listener)
Removes a previously registered component event listener from this component. |
void |
setEnabled(boolean enabled)
Enables or disables the component. |
void |
setParent(Component parent)
Sets the component's parent component. |
void |
setReadOnly(boolean readOnly)
Sets the component's to read-only mode to the specified state. |
void |
setStyle(String style)
Sets the look-and-feel style of the component. |
void |
setVisible(boolean visible)
Sets the components visibility status. |
| Methods inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
addListener, paint, removeListener, requestRepaint, requestRepaintRequests |
| Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner |
|---|
changeVariables, dependsOn, getDirectDependencies, isImmediate, removeDirectDependency |
| Method Detail |
|---|
String getStyle()
void setStyle(String style)
RepaintRequestEvent.
style - the new style of the component.boolean isEnabled()
Tests if the component is enabled or not. All the variable change events are blocked from disabled components. Also the component should visually indicate that it is disabled (by shading the component for example). All hidden (isVisible() == false) components must return false.
Components should be enabled by default.
isEnabled in interface VariableOwnertrue if the component is enabled,
false if not.VariableOwner.isEnabled()void setEnabled(boolean enabled)
RepaintRequestEvent.
enabled - the boolean value specifying if the component should be
enabled after the call or notboolean isVisible()
true.
true if the component is visible in the UI,
false if notvoid setVisible(boolean visible)
visible - the Boolean value specifying if the component should be
visible after the call or not.Component getParent()
void setParent(Component parent)
This method calls automatically attach() if the parent is
attached to a window (or is itself a window}, and detach() if
parent is set null, but the component was
in the application.
This method is rarely called directly. Instead the
ComponentContainer.addComponent(Component) method is used to add
components to container, which call this method implicitly.
parent - the new parent component.boolean isReadOnly()
true if the component is in read-only mode,
false if not.void setReadOnly(boolean readOnly)
RepaintRequestEvent.
readOnly - the boolean value specifying if the component should be in
read-only mode after the call or not.String getCaption()
String.Resource getIcon()
null if it not defined.Window getWindow()
null is returned.
null.Application getApplication()
null is returned.
null.void attach()
Notifies the component that it is connected to an application. This
method is always called before the component is first time painted and is
suitable to be extended. The getApplication and
getWindow methods might return null before
this method is called.
The caller of this method is setParent(Component) if the parent
is already in the application. If the parent is not in the application,
it must call the attach() for all its children when it will be
added to the application.
void detach()
The getApplication() and getWindow() methods might
return null after this method is called.
The caller of this method is setParent(Component) if the parent
is in the application. When the parent is detached from the application
it is its response to call detach() for all the children and to
detach itself from the terminal.
Locale getLocale()
Locale.getDefautlt. Returns null if the component
does not have its own locale and has not yet been added to a
containment hierarchy such that the locale can be determined from
the containing parent.void childRequestedRepaint(Collection alreadyNotified)
alreadyNotified - the collection of repaint request listeners that have been
already notified by the child. This component should not
renotify the listed listeners again. The container given as
parameter must be modifiable as the component might modify it
and pass it forwards. Null parameter is interpreted as empty
collection.void addListener(Component.Listener listener)
listener - the new Listener to be registered.void removeListener(Component.Listener listener)
listener - the listener to be removed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||