| java.lang.Object org.millstone.base.ui.AbstractComponent
All known Subclasses: org.millstone.base.ui.Link, org.millstone.base.ui.AbstractField, org.millstone.base.ui.AbstractComponentContainer, org.millstone.base.ui.Upload, org.millstone.base.ui.Label, org.millstone.examples.gogame.Board, org.millstone.base.ui.Embedded,
AbstractComponent | abstract public class AbstractComponent implements Component,MethodEventSource(Code) | | An abstract class that defines default implementation for the
Component interface. Basic UI components that are not derived
from an external component can inherit this class to easily qualify as a
MillStone component. Most components in the MillStone base UI package do
just that.
author: IT Mill Ltd. version: 3.1.1 since: 3.0 |
Method Summary | |
public void | addListener(RepaintRequestListener listener) | public void | addListener(Class eventType, Object object, Method method) Registers a new listener with the specified activation method to
listen events generated by this component. | public void | addListener(Class eventType, Object object, String methodName) Registers a new listener with the specified activation method to
listen events generated by this component. | public void | addListener(Component.Listener listener) | public void | attach() | public void | changeVariables(Object source, Map variables) | public void | childRequestedRepaint(Collection alreadyNotified) | public void | dependsOn(VariableOwner depended) | public void | detach() | protected void | fireComponentErrorEvent() Emits a component error event. | protected void | fireComponentEvent() Emits a component event. | protected void | fireEvent(Component.Event event) | public Application | getApplication() | public String | getCaption() | public ErrorMessage | getComponentError() Gets the component's error message. | public Object | getData() Gets application specific data. | public String | getDescription() Gets the component's description. | public Set | getDirectDependencies() | public ErrorMessage | getErrorMessage() Get the error message for this component.
ErrorMessage containing the description of the error stateof the component or null, if the component contains no errors. | public Resource | getIcon() | public Locale | getLocale() | public Component | getParent() | public String | getStyle() | abstract public String | getTag() Gets the UIDL tag corresponding to the component. | public Window | getWindow() | public boolean | isEnabled() | public boolean | isImmediate() | public boolean | isReadOnly() | public boolean | isVisible() | final public void | paint(PaintTarget target) | public void | paintContent(PaintTarget target) Paints any needed component-specific things to the given UIDL
stream. | public void | removeDirectDependency(VariableOwner depended) | public void | removeListener(RepaintRequestListener listener) | public void | removeListener(Class eventType, Object target) Removes all registered listeners matching the given parameters. | public void | removeListener(Class eventType, Object target, Method method) Removes one registered listener method. | public void | removeListener(Class eventType, Object target, String methodName) Removes one registered listener method. | public void | removeListener(Component.Listener listener) | public void | requestRepaint() | public void | requestRepaintRequests() | public void | setCaption(String caption) Sets the component's caption String . | public void | setComponentError(ErrorMessage componentError) Sets the component's error message. | public void | setData(Object data) Sets application specific data object. | public void | setDescription(String description) Sets the component's description. | public void | setEnabled(boolean enabled) | public void | setIcon(Resource icon) Sets the component's icon. | public void | setImmediate(boolean immediate) Sets the component's immediate mode to the specified status. | public void | setLocale(Locale locale) Sets the locale of this component. | public void | setParent(Component parent) | public void | setReadOnly(boolean readOnly) | public void | setStyle(String style) | public void | setVisible(boolean visible) |
AbstractComponent | public AbstractComponent()(Code) | | Constructs a new Component
|
addListener | public void addListener(RepaintRequestListener listener)(Code) | | |
addListener | public void addListener(Class eventType, Object object, Method method)(Code) | | Registers a new listener with the specified activation method to
listen events generated by this component. If the activation method
does not have any arguments the event object will not be passed to it
when it's called.
For more information on the MillStone inheritable event mechanism
see the
org.millstone.base.event org.millstone.base.event package documentation .
Parameters: eventType - type of the listened event. Events of this type orits subclasses activate the listener. Parameters: object - the object instance who owns the activation method Parameters: method - the activation method throws: java.lang.IllegalArgumentException - unless method has exactly one match in object |
addListener | public void addListener(Class eventType, Object object, String methodName)(Code) | | Registers a new listener with the specified activation method to
listen events generated by this component. If the activation method
does not have any arguments the event object will not be passed to it
when it's called.
This version of addListener gets the name of the
activation method as a parameter. The actual method is reflected from
object , and unless exactly one match is found,
java.lang.IllegalArgumentException is thrown.
For more information on the MillStone inheritable event mechanism
see the
org.millstone.base.event org.millstone.base.event package documentation .
Parameters: eventType - type of the listened event. Events of this type orits subclasses activate the listener. Parameters: object - the object instance who owns the activation method Parameters: methodName - the name of the activation method throws: java.lang.IllegalArgumentException - unless method has exactly one match in object |
attach | public void attach()(Code) | | |
changeVariables | public void changeVariables(Object source, Map variables)(Code) | | |
childRequestedRepaint | public void childRequestedRepaint(Collection alreadyNotified)(Code) | | |
detach | public void detach()(Code) | | |
fireComponentErrorEvent | protected void fireComponentErrorEvent()(Code) | | Emits a component error event. It is transmitted to all registered
listeners interested in such events.
|
fireComponentEvent | protected void fireComponentEvent()(Code) | | Emits a component event. It is transmitted to all registered
listeners interested in such events.
|
fireEvent | protected void fireEvent(Component.Event event)(Code) | | Send event to all listeners
Parameters: event - Event to be sent to all listeners |
getComponentError | public ErrorMessage getComponentError()(Code) | | Gets the component's error message.
Terminal.ErrorMessage#ErrorMessage(String, int) component's error message |
getData | public Object getData()(Code) | | Gets application specific data.
Application specific data set with setData function. since: 3.1 |
getDescription | public String getDescription()(Code) | | Gets the component's description. The description can be used to
briefly describe the state of the component to the user. The
description string may contain certain XML tags:
Tag |
Description |
Example |
<b> |
bold |
bold text |
<i> |
italic |
italic text |
<u> |
underlined |
underlined text |
<br> |
linebreak |
N/A |
<ul> <li>item1 <li>item1 </ul> |
item list |
|
These tags may be nested.
component's description String |
getDirectDependencies | public Set getDirectDependencies()(Code) | | |
getErrorMessage | public ErrorMessage getErrorMessage()(Code) | | Get the error message for this component.
ErrorMessage containing the description of the error stateof the component or null, if the component contains no errors. Extendingclasses should override this method if they support other error messagetypes such as validation errors or buffering errors. The returned errormessage contains information about all the errors. |
getTag | abstract public String getTag()(Code) | | Gets the UIDL tag corresponding to the component.
component's UIDL tag as String |
isEnabled | public boolean isEnabled()(Code) | | |
isImmediate | public boolean isImmediate()(Code) | | |
isReadOnly | public boolean isReadOnly()(Code) | | |
isVisible | public boolean isVisible()(Code) | | |
paintContent | public void paintContent(PaintTarget target) throws PaintException(Code) | | Paints any needed component-specific things to the given UIDL
stream. The more general
AbstractComponent.paint(PaintTarget) method handles
all general attributes common to all components, and it calls this
method to paint any component-specific attributes to the UIDL stream.
Parameters: target - target UIDL stream where the component should paintitself to throws: PaintException - if the operation failed |
removeListener | public void removeListener(RepaintRequestListener listener)(Code) | | |
removeListener | public void removeListener(Class eventType, Object target)(Code) | | Removes all registered listeners matching the given parameters.
Since this method receives the event type and the listener object as
parameters, it will unregister all object 's methods that
are registered to listen to events of type eventType
generated by this component.
For more information on the MillStone inheritable event mechanism
see the
org.millstone.base.event org.millstone.base.event package documentation .
Parameters: eventType - exact event type the object listens to Parameters: target - target object that has registered to listen to eventsof type eventType with one or more methods |
removeListener | public void removeListener(Class eventType, Object target, Method method)(Code) | | Removes one registered listener method. The given method owned by
the given object will no longer be called when the specified events
are generated by this component.
For more information on the MillStone inheritable event mechanism
see the
org.millstone.base.event org.millstone.base.event package documentation .
Parameters: eventType - exact event type the object listens to Parameters: target - target object that has registered to listen to eventsof type eventType with one or more methods Parameters: method - the method owned by target that'sregistered to listen to events of type eventType |
removeListener | public void removeListener(Class eventType, Object target, String methodName)(Code) | | Removes one registered listener method. The given method owned by
the given object will no longer be called when the specified events
are generated by this component.
This version of removeListener gets the name of the
activation method as a parameter. The actual method is reflected from
target , and unless exactly one match is found,
java.lang.IllegalArgumentException is thrown.
For more information on the MillStone inheritable event mechanism
see the
org.millstone.base.event org.millstone.base.event package documentation .
Parameters: eventType - exact event type the object listens to Parameters: target - target object that has registered to listen to eventsof type eventType with one or more methods Parameters: methodName - name of the method owned by target that's registered to listen to events of type eventType |
requestRepaint | public void requestRepaint()(Code) | | |
requestRepaintRequests | public void requestRepaintRequests()(Code) | | |
setCaption | public void setCaption(String caption)(Code) | | Sets the component's caption String . Caption is the
visible name of the component. This method will trigger a
org.millstone.base.terminal.Paintable.RepaintRequestEvent RepaintRequestEvent .
Parameters: caption - new caption String for the component |
setComponentError | public void setComponentError(ErrorMessage componentError)(Code) | | Sets the component's error message. The message may contain certain
XML tags, for more information see
Component.ErrorMessage#ErrorMessage(String, int) Parameters: errorMessage - new ErrorMessage of the component |
setData | public void setData(Object data)(Code) | | Sets application specific data object.
Parameters: data - Application specific data. since: 3.1 |
setDescription | public void setDescription(String description)(Code) | | Sets the component's description. See
AbstractComponent.getDescription() for
more information on what the description is. This method will trigger
a
org.millstone.base.terminal.Paintable.RepaintRequestEvent RepaintRequestEvent .
Parameters: description - new description string for the component |
setEnabled | public void setEnabled(boolean enabled)(Code) | | |
setIcon | public void setIcon(Resource icon)(Code) | | Sets the component's icon. This method will trigger a
org.millstone.base.terminal.Paintable.RepaintRequestEvent RepaintRequestEvent .
Parameters: icon - the icon to be shown with the component's caption |
setImmediate | public void setImmediate(boolean immediate)(Code) | | Sets the component's immediate mode to the specified status. This
method will trigger a
org.millstone.base.terminal.Paintable.RepaintRequestEvent RepaintRequestEvent .
Parameters: immediate - boolean value specifying if the component shouldbe in the immediate mode after the call. See Also: Component.isImmediate |
setLocale | public void setLocale(Locale locale)(Code) | | Sets the locale of this component.
Parameters: locale - The locale to become this component's locale. |
setReadOnly | public void setReadOnly(boolean readOnly)(Code) | | |
setVisible | public void setVisible(boolean visible)(Code) | | |
|
|