org.itsnat.comp
Interface ItsNatComponent

All Superinterfaces:
ItsNatUserData
All Known Subinterfaces:
ItsNatButton, ItsNatButtonCheckBox, ItsNatButtonLabel, ItsNatButtonNormal, ItsNatButtonRadio, ItsNatButtonToggle, ItsNatComboBox, ItsNatElementComponent, ItsNatFormattedTextField, ItsNatFreeButtonNormal, ItsNatFreeButtonNormalLabel, ItsNatFreeButtonToggle, ItsNatFreeCheckBox, ItsNatFreeCheckBoxLabel, ItsNatFreeComboBox, ItsNatFreeComponent, ItsNatFreeInclude, ItsNatFreeLabel, ItsNatFreeList, ItsNatFreeListMultSel, ItsNatFreeRadioButton, ItsNatFreeRadioButtonLabel, ItsNatFreeTable, ItsNatFreeTableHeader, ItsNatFreeTree, ItsNatHTMLAnchor, ItsNatHTMLAnchorLabel, ItsNatHTMLButton, ItsNatHTMLButtonLabel, ItsNatHTMLElementComponent, ItsNatHTMLForm, ItsNatHTMLFormComponent, ItsNatHTMLIFrame, ItsNatHTMLInput, ItsNatHTMLInputButton, ItsNatHTMLInputButtonNormal, ItsNatHTMLInputButtonToggle, ItsNatHTMLInputCheckBox, ItsNatHTMLInputFile, ItsNatHTMLInputHidden, ItsNatHTMLInputImage, ItsNatHTMLInputPassword, ItsNatHTMLInputRadio, ItsNatHTMLInputReset, ItsNatHTMLInputSubmit, ItsNatHTMLInputText, ItsNatHTMLInputTextBased, ItsNatHTMLInputTextFormatted, ItsNatHTMLLabel, ItsNatHTMLSelect, ItsNatHTMLSelectComboBox, ItsNatHTMLSelectMult, ItsNatHTMLTable, ItsNatHTMLTableHeader, ItsNatHTMLTextArea, ItsNatInclude, ItsNatLabel, ItsNatList, ItsNatListMultSel, ItsNatModalLayer, ItsNatPasswordField, ItsNatTable, ItsNatTableHeader, ItsNatTextArea, ItsNatTextComponent, ItsNatTextField, ItsNatTree

public interface ItsNatComponent
extends ItsNatUserData

Is the base interface which every ItsNat component implements.

Some components have property change tracking like ItsNatLabel and ItsNatHTMLInputTextFormatted components. If no property is tracked by the component, listeners registered using addPropertyChangeListener(PropertyChangeListener) addPropertyChangeListener(String,PropertyChangeListener) or addVetoableChangeListener(VetoableChangeListener) are never called.

Author:
Jose Maria Arranz Santamaria
See Also:
ItsNatComponentManager.createItsNatComponent(org.w3c.dom.Node,String,org.itsnat.core.NameValue[])

Method Summary
 void addEventListener(ClientDocument clientDoc, java.lang.String type, org.w3c.dom.events.EventListener listener)
          Registers the specified event listener to the component node for the specific client.
 void addEventListener(ClientDocument clientDoc, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean before)
          Registers the specified event listener to the component node for the specific client.
 void addEventListener(java.lang.String type, org.w3c.dom.events.EventListener listener)
          Registers the specified event listener to the component node.
 void addEventListener(java.lang.String type, org.w3c.dom.events.EventListener listener, boolean before)
          Registers the specified event listener to the component node.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Registers a new property change listener listening for any property change.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Registers a new property change listener listening for the specified property name.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Registers a new vetoable property change listener listening for any property change.
 void disableEventListener(ClientDocument clientDoc, java.lang.String type)
          Disables the component to receive events of the specified type and client.
 void disableEventListener(java.lang.String type)
          Disables the component to receive events of the specified type.
 void dispose()
          Disposes this component.
 void enableEventListener(ClientDocument clientDoc, java.lang.String type)
          Enable the component to receive events of the specified type and client.
 void enableEventListener(java.lang.String type)
          Enable the component to receive events of the specified type.
 java.lang.Object getArtifact(java.lang.String name)
          Returns the artifact with the specified name.
 java.lang.Object getArtifact(java.lang.String name, boolean cascade)
          Returns the artifact with the specified name.
 ItsNatComponentManager getItsNatComponentManager()
          Returns the ItsNat component manager parent of this component.
 ItsNatComponentUI getItsNatComponentUI()
          Returns the user interface manager of this component.
 ItsNatDocument getItsNatDocument()
          Returns the ItsNat document this document is associated to.
 org.w3c.dom.Node getNode()
          Returns the associated DOM node to this component.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners()
          Returns all registered listeners listening for any property change.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
          Returns all registered listeners listening for changes in the specified property.
 java.beans.VetoableChangeListener[] getVetoableChangeListeners()
          Returns all registered listeners listening for any vetoable property change.
 boolean isDisposed()
          Informs whether this component was disposed.
 boolean isEnabled()
          Informs whether this component receives UI events.
 void registerArtifact(java.lang.String name, java.lang.Object value)
          Registers an artifact with the specified name.
 java.lang.Object removeArtifact(java.lang.String name)
          Removes the artifact with the specified name.
 void removeEventListener(ClientDocument clientDoc, java.lang.String type, org.w3c.dom.events.EventListener listener)
          Unregisters the specified event listener from the component node for the specific client.
 void removeEventListener(ClientDocument clientDoc, java.lang.String type, org.w3c.dom.events.EventListener listener, boolean before)
          Unregisters the specified event listener from the component node for the specific client.
 void removeEventListener(java.lang.String type, org.w3c.dom.events.EventListener listener)
          Unregisters the specified event listener from the component node.
 void removeEventListener(java.lang.String type, org.w3c.dom.events.EventListener listener, boolean before)
          Unregisters the specified event listener from the component node.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes the specified property change listener listening for any property change.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Removes the specified property change listener listening for the specified property name.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes the specified vetoable property change listener listening for any property change.
 void setEnabled(boolean b)
          Sets whether this component can receive UI events.
 void setEventListenerParams(ClientDocument clientDoc, java.lang.String type, boolean useCapture, int commMode, ParamTransport[] extraParams, java.lang.String preSendCode, long eventTimeout)
          Sets the parameters used to fire and receive AJAX/SCRIPT events by this component and specified client.
 void setEventListenerParams(java.lang.String type, boolean useCapture, int commMode, ParamTransport[] extraParams, java.lang.String preSendCode, long eventTimeout)
          Sets the parameters used to fire and receive AJAX/SCRIPT events by this component.
 void setNode(org.w3c.dom.Node node)
          Changes the associated DOM node (reattachment).
 
Methods inherited from interface org.itsnat.core.ItsNatUserData
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
 

Method Detail

getNode

org.w3c.dom.Node getNode()
Returns the associated DOM node to this component.

Returns:
the associated DOM node.

setNode

void setNode(org.w3c.dom.Node node)
Changes the associated DOM node (reattachment).

Parameters:
node - the new DOM node.

addEventListener

void addEventListener(java.lang.String type,
                      org.w3c.dom.events.EventListener listener,
                      boolean before)
Registers the specified event listener to the component node.

The specified event type is automatically enabled (see enableEventListener(String)).

If this component has a default behavior associated to the specified event type, the listener is executed before this default behavior if before parameter is true, otherwise is executed after.

Several listeners may be registered to the same event type.

Parameters:
type - the event type to listen.
listener - the listener to be executed.
before - if true the listener is executed before the default behavior of the component.
See Also:
removeEventListener(String,EventListener,boolean), addEventListener(ClientDocument,String,EventListener,boolean)

removeEventListener

void removeEventListener(java.lang.String type,
                         org.w3c.dom.events.EventListener listener,
                         boolean before)
Unregisters the specified event listener from the component node.

Parameters:
type - the event type of the listener to unregister.
listener - to unregister.
before - if the listener to unregister is a "before" or "after" listener.
See Also:
addEventListener(String,EventListener,boolean), removeEventListener(ClientDocument,String,EventListener,boolean)

addEventListener

void addEventListener(java.lang.String type,
                      org.w3c.dom.events.EventListener listener)
Registers the specified event listener to the component node.

Current implementation calls addEventListener(String,EventListener,boolean) with before parameter set to false (executed after).

Parameters:
type - the event type to listen.
listener - the listener to be executed.
See Also:
addEventListener(ClientDocument,String,EventListener)

removeEventListener

void removeEventListener(java.lang.String type,
                         org.w3c.dom.events.EventListener listener)
Unregisters the specified event listener from the component node.

Current implementation calls removeEventListener(String,EventListener,boolean) with before parameter set to false (unregisters the "after" listener).

Parameters:
type - the event type of the listener to unregister.
listener - to unregister.
See Also:
removeEventListener(ClientDocument,String,EventListener)

addEventListener

void addEventListener(ClientDocument clientDoc,
                      java.lang.String type,
                      org.w3c.dom.events.EventListener listener,
                      boolean before)
Registers the specified event listener to the component node for the specific client.

The specified event type is automatically enabled (see enableEventListener(String)).

If this component has a default behavior associated to the specified event type, the listener is executed before this default behavior if before parameter is true, otherwise is executed after.

Several listeners may be registered to the same event type.

Parameters:
clientDoc - the client source of events.
type - the event type to listen.
listener - the listener to be executed.
before - if true the listener is executed before the default behavior of the component.
See Also:
removeEventListener(String,EventListener,boolean), addEventListener(String,EventListener,boolean)

removeEventListener

void removeEventListener(ClientDocument clientDoc,
                         java.lang.String type,
                         org.w3c.dom.events.EventListener listener,
                         boolean before)
Unregisters the specified event listener from the component node for the specific client.

Parameters:
clientDoc - the client source of events.
type - the event type of the listener to unregister.
listener - to unregister.
before - if the listener to unregister is a "before" or "after" listener.
See Also:
addEventListener(String,EventListener,boolean), removeEventListener(String,EventListener,boolean)

addEventListener

void addEventListener(ClientDocument clientDoc,
                      java.lang.String type,
                      org.w3c.dom.events.EventListener listener)
Registers the specified event listener to the component node for the specific client.

Current implementation calls addEventListener(String,EventListener,boolean) with before parameter set to false (executed after).

Parameters:
clientDoc - the client source of events.
type - the event type to listen.
listener - the listener to be executed.
See Also:
addEventListener(String,EventListener)

removeEventListener

void removeEventListener(ClientDocument clientDoc,
                         java.lang.String type,
                         org.w3c.dom.events.EventListener listener)
Unregisters the specified event listener from the component node for the specific client.

Current implementation calls removeEventListener(String,EventListener,boolean) with before parameter set to false (unregisters the "after" listener).

Parameters:
clientDoc - the client source of events.
type - the event type of the listener to unregister.
listener - to unregister.
See Also:
removeEventListener(String,EventListener)

enableEventListener

void enableEventListener(java.lang.String type)
Enable the component to receive events of the specified type.

If this component has a default behavior associated to the specified type (and is disabled by default) then is enabled.

Parameters:
type - the event type to enable.
See Also:
addEventListener(String,org.w3c.dom.events.EventListener), enableEventListener(ClientDocument,String)

disableEventListener

void disableEventListener(java.lang.String type)
Disables the component to receive events of the specified type.

No event listener added with addEventListener(String,org.w3c.dom.events.EventListener) is unregistered.

Parameters:
type - the event type to enable.
See Also:
disableEventListener(ClientDocument,String)

enableEventListener

void enableEventListener(ClientDocument clientDoc,
                         java.lang.String type)
Enable the component to receive events of the specified type and client.

If this component has a default behavior associated to the specified type (and is disabled by default) then is enabled.

Parameters:
clientDoc - the client source of events.
type - the event type to enable.
See Also:
addEventListener(String,org.w3c.dom.events.EventListener), enableEventListener(String)

disableEventListener

void disableEventListener(ClientDocument clientDoc,
                          java.lang.String type)
Disables the component to receive events of the specified type and client.

No event listener added with addEventListener(String,org.w3c.dom.events.EventListener) is unregistered.

Parameters:
clientDoc - the client source of events.
type - the event type to enable.
See Also:
disableEventListener(String)

setEventListenerParams

void setEventListenerParams(java.lang.String type,
                            boolean useCapture,
                            int commMode,
                            ParamTransport[] extraParams,
                            java.lang.String preSendCode,
                            long eventTimeout)
Sets the parameters used to fire and receive AJAX/SCRIPT events by this component.

All current registered event listeners are affected.

Parameters:
type - the DOM event type name (click, change etc).
useCapture - if event capture is enabled. False is the most portable value (MSIE v6 does not support event capture).
commMode - communication mode.
extraParams - optional client to server data transport and synchronization rules. May be null.
preSendCode - custom JavaScript code to execute before an event of this listener type is fired. May be null.
eventTimeout - the timeout of events. If negative no timeout is defined.
See Also:
ItsNatDocument.addEventListener(org.w3c.dom.events.EventTarget,String,org.w3c.dom.events.EventListener,boolean,int,org.itsnat.core.event.ParamTransport[],String,long), setEventListenerParams(ClientDocument,String,boolean,int,ParamTransport[],String,long)

setEventListenerParams

void setEventListenerParams(ClientDocument clientDoc,
                            java.lang.String type,
                            boolean useCapture,
                            int commMode,
                            ParamTransport[] extraParams,
                            java.lang.String preSendCode,
                            long eventTimeout)
Sets the parameters used to fire and receive AJAX/SCRIPT events by this component and specified client.

All current registered event listeners are affected.

Parameters:
clientDoc - the client source of events.
type - the DOM event type name (click, change etc).
useCapture - if event capture is enabled. False is the most portable value (MSIE v6 does not support event capture).
commMode - communication mode.
extraParams - optional client to server data transport and synchronization rules. May be null.
preSendCode - custom JavaScript code to execute before an event of this listener type is fired. May be null.
eventTimeout - the timeout of events. If negative no timeout is defined.
See Also:
ItsNatDocument.addEventListener(org.w3c.dom.events.EventTarget,String,org.w3c.dom.events.EventListener,boolean,int,org.itsnat.core.event.ParamTransport[],String,long), setEventListenerParams(String,boolean,int,ParamTransport[],String,long)

getItsNatDocument

ItsNatDocument getItsNatDocument()
Returns the ItsNat document this document is associated to.

Returns:
the associated ItsNat document.

getItsNatComponentManager

ItsNatComponentManager getItsNatComponentManager()
Returns the ItsNat component manager parent of this component.

Returns:
the parent ItsNat component manager.

getItsNatComponentUI

ItsNatComponentUI getItsNatComponentUI()
Returns the user interface manager of this component.

Returns:
the user interface manager.

dispose

void dispose()
Disposes this component. A disposed component can no longer be used.

Typical dispose operations are: disable event listeners and disconnect data and selection models. A component "disposed" should be garbage collected.

See Also:
isDisposed(), disableEventListener(String).

isDisposed

boolean isDisposed()
Informs whether this component was disposed.

Returns:
true if this component was disposed.
See Also:
dispose()

addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers a new property change listener listening for any property change.

Parameters:
listener - the property change listener to register.

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified property change listener listening for any property change.

Parameters:
listener - the property change listener to unregister.

getPropertyChangeListeners

java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Returns all registered listeners listening for any property change.

Returns:
a listener array.

addPropertyChangeListener

void addPropertyChangeListener(java.lang.String propertyName,
                               java.beans.PropertyChangeListener listener)
Registers a new property change listener listening for the specified property name.

Parameters:
propertyName - the property name.
listener - the property change listener to register.

removePropertyChangeListener

void removePropertyChangeListener(java.lang.String propertyName,
                                  java.beans.PropertyChangeListener listener)
Removes the specified property change listener listening for the specified property name.

Parameters:
propertyName - the property name.
listener - the property change listener to unregister.

getPropertyChangeListeners

java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
Returns all registered listeners listening for changes in the specified property.

Parameters:
propertyName - the property name.
Returns:
a listener array.

addVetoableChangeListener

void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Registers a new vetoable property change listener listening for any property change.

Parameters:
listener - the vetoable property change listener to register.

removeVetoableChangeListener

void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the specified vetoable property change listener listening for any property change.

Parameters:
listener - the vetoable property change listener to unregister.

getVetoableChangeListeners

java.beans.VetoableChangeListener[] getVetoableChangeListeners()
Returns all registered listeners listening for any vetoable property change.

Returns:
a listener array.

registerArtifact

void registerArtifact(java.lang.String name,
                      java.lang.Object value)
Registers an artifact with the specified name.

Parameters:
name - the artifact name
value - the artifact.
See Also:
getArtifact(String), removeArtifact(String), NameValue

getArtifact

java.lang.Object getArtifact(java.lang.String name)
Returns the artifact with the specified name.

Parameters:
name - the artifact name to look for.
Returns:
the artifact or null if not found.
See Also:
registerArtifact(String,Object), getArtifact(String,boolean)

removeArtifact

java.lang.Object removeArtifact(java.lang.String name)
Removes the artifact with the specified name.

Parameters:
name - the artifact name to look for.
Returns:
the removed artifact.
See Also:
registerArtifact(String,Object)

getArtifact

java.lang.Object getArtifact(java.lang.String name,
                             boolean cascade)
Returns the artifact with the specified name.

If no artifact is found and cascade is true, the method ItsNatDocument.getArtifact(String,boolean) is called with cascade set to true to continue searching.

Parameters:
name - the artifact name to look for.
Returns:
the artifact or null if not found.
See Also:
getArtifact(String)

isEnabled

boolean isEnabled()
Informs whether this component receives UI events.

Returns:
true if this component is enabled. By default is true.

setEnabled

void setEnabled(boolean b)
Sets whether this component can receive UI events.

Parameters:
b - true to enable this component.


Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.