|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--objectivehtml.oms.OMSObject | +--objectivehtml.htmlwidget.HtmlElement | +--objectivehtml.htmlwidget.HtmlWidget
This abstract class is the base class of all the html widget classes.
A html widget represents a visual or interactive component of a html form.
All html widgets must have a parent widget, the only exception being the HtmlForm object which has no parent and is the top-most object. All HtmlWidget objects live within the context of a HtmlForm object. If a HtmlForm object has not been created then no other HtmlWidget objects can be created. A HtmlForm object cannot contain another HtmlForm object. Only HtmlContainerWidget objects can be parent objects.
All html widgets have a visibility flag. If a html widget object is visible then its html representation will be written out when the printHtml methods are called. If a html widget is invisible then its html representation is not written out. A widget cannot be made visible if its parent widget is invisible.
To remove a HtmlWidget object you should call the destroy method. Since Java has no destructors you must explicity call this method to correctly remove an object. The method will delink itself from its parent and clean up itself.
setVisible(boolean)
,
destroy()
,
HtmlContainerWidget
,
HtmlForm
Field Summary | |
protected boolean |
m_bDestroyed
Indicates whether the widget has been destroyed |
protected boolean |
m_bVisible
Indicates the visibility of the widget |
protected HtmlForm |
m_objHtmlForm
A reference to the form the widget is contained in |
protected HtmlContainerWidget |
m_objParentWidget
A reference to the parent widget |
Fields inherited from class objectivehtml.htmlwidget.HtmlElement |
m_hmAttributes, m_sEndTag, m_sQuoteType, m_sStartTag |
Constructor Summary | |
HtmlWidget()
Creates an instance of the HtmlWidget object with no parent. |
|
HtmlWidget(HtmlContainerWidget objParent)
Creates an instance of the HtmlWidget object with the specified parent. |
Method Summary | |
protected void |
changeParent(HtmlContainerWidget objNewParent)
Changes the parent of this object to be objNewParent. |
protected void |
changeParent(HtmlContainerWidget objNewParent,
int nPosition)
Changes the parent of this object to be objNewParent. |
protected void |
destroy()
Removes this object from the form. |
java.lang.String |
getClassAttribute()
Returns the style-sheet class of this object. |
HtmlForm |
getHtmlForm()
Returns a reference to the HtmlForm object that contains this object. |
java.lang.String |
getID()
Returns the ID of this object. |
java.lang.String |
getOnClick()
Returns the onclick event of this object. |
java.lang.String |
getOnDblClick()
Returns the ondblclick event of this object. |
java.lang.String |
getOnKeyDown()
Returns the onkeydown event of this object. |
java.lang.String |
getOnKeyPress()
Returns the onkeypress event of this object. |
java.lang.String |
getOnKeyUp()
Returns the onkeyup event of this object. |
java.lang.String |
getOnMouseDown()
Returns the onmousedown event of this object. |
java.lang.String |
getOnMouseMove()
Returns the onmousemove event of this object. |
java.lang.String |
getOnMouseOut()
Returns the onmouseout event of this object. |
java.lang.String |
getOnMouseOver()
Returns the onmouseover event of this object. |
java.lang.String |
getOnMouseUp()
Returns the onmouseup event of this object. |
HtmlContainerWidget |
getParent()
Returns a reference to the parent of this object. |
java.lang.String |
getStyle()
Returns the style of this object. |
boolean |
isDestroyed()
Indicates whether this widget has been destroyed and should no longer be accessed. |
boolean |
isVisible()
Returns the visibility of this object. |
void |
setClassAttribute(java.lang.String sClass)
Sets the style-sheet class of this object. |
void |
setID(java.lang.String sID)
Sets the ID of this object. |
void |
setOnClick(java.lang.String sOnClick)
Sets the onclick event of this object. |
void |
setOnDblClick(java.lang.String sOnDblClick)
Sets the ondblclick event of this object. |
void |
setOnKeyDown(java.lang.String sOnKeyDown)
Sets the onkeydown event of this object. |
void |
setOnKeyPress(java.lang.String sOnKeyPress)
Sets the onkeypress event of this object. |
void |
setOnKeyUp(java.lang.String sOnKeyUp)
Sets the onkeyup event of this object. |
void |
setOnMouseDown(java.lang.String sOnMouseDown)
Sets the onmousedown event of this object. |
void |
setOnMouseMove(java.lang.String sOnMouseMove)
Sets the onmousemove event of this object. |
void |
setOnMouseOut(java.lang.String sOnMouseOut)
Sets the onmouseout event of this object. |
void |
setOnMouseOver(java.lang.String sOnMouseOver)
Sets the onmouseover event of this object. |
void |
setOnMouseUp(java.lang.String sOnMouseUp)
Sets the onmouseup event of this object. |
void |
setStyle(java.lang.String sStyle)
Sets the style of this object. |
protected void |
setVisible(boolean bVisible)
Sets the visibility of this object. |
Methods inherited from class objectivehtml.htmlwidget.HtmlElement |
genEndTag, genStartTag, genStartTag, getAttribute, getAttributes, getBooleanAttribute, getQuoteType, printHtml, printHtml, printHtml, printHtml, printHtml, printHtml, printHtml, printHtml, setAttribute, setBooleanAttribute, setQuoteType, toString, toString |
Methods inherited from class objectivehtml.oms.OMSObject |
compareClasses, connect, disconnect, emit, isAlive, setAlive, signal, slot, slot |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean m_bVisible
protected boolean m_bDestroyed
protected HtmlContainerWidget m_objParentWidget
protected HtmlForm m_objHtmlForm
Constructor Detail |
public HtmlWidget(HtmlContainerWidget objParent) throws InvalidParentWidgetException, InvalidChildWidgetException
Creates an instance of the HtmlWidget object with the specified parent.
The widget is created with the same visibility of its parent.
objParent
- the parent widgetInvalidParentWidgetException
- if the specified parent widget is not validInvalidChildWidgetException
- if the parent widget does not accept this widget as a childpublic HtmlWidget()
Creates an instance of the HtmlWidget object with no parent. This version is used by HtmlForm class and should not be used by any other html widgets.
The default visibility is visible.
Method Detail |
public HtmlContainerWidget getParent()
public HtmlForm getHtmlForm()
protected void changeParent(HtmlContainerWidget objNewParent) throws NotEqualsHtmlFormException, InvalidChildWidgetException
objNewParent
- a reference to the new parent objectNotEqualsHtmlFormException
- if the new parent belongs to a different HtmlForm objectInvalidChildWidgetException
- if the new parent does not this widget to be a childprotected void changeParent(HtmlContainerWidget objNewParent, int nPosition) throws NotEqualsHtmlFormException, InvalidChildWidgetException
objNewParent
- a reference to the new parent objectnPosition
- the position the new object is to be inserted into in the new parentNotEqualsHtmlFormException
- if the new parent belongs to a different HtmlForm objectInvalidChildWidgetException
- if the new parent does not this widget to be a childprotected void setVisible(boolean bVisible)
Sets the visibility of this object.
By default this method should only be accessed by other classes of this library. If users are allowed to explicity show/hide this html widget then it needs to be made public. You can only make a widget visible if its parent widget is also visible.
bVisible
- true indicates the object is visible,
false indicates that the object is not visibleisVisible()
public boolean isVisible()
public void setID(java.lang.String sID)
Sets the ID of this object.
The html attribute it sets is "id".
If null is specified the attribute is cleared.
sID
- the id for this elementHtmlElement.setAttribute(String, String)
,
getID()
public java.lang.String getID()
setID(String)
,
HtmlElement.getAttribute(String)
public void setClassAttribute(java.lang.String sClass)
Sets the style-sheet class of this object.
The html attribute it sets is "class".
If null is specified the attribute is cleared.
sClass
- the class for this elementHtmlElement.setAttribute(String, String)
,
getClassAttribute()
public java.lang.String getClassAttribute()
setClassAttribute(String)
,
HtmlElement.getAttribute(String)
public void setStyle(java.lang.String sStyle)
Sets the style of this object.
The html attribute it sets is "style".
If null is specified the attribute is cleared.
sStyle
- the style for this elementHtmlElement.setAttribute(String, String)
,
getStyle()
public java.lang.String getStyle()
setStyle(String)
,
HtmlElement.getAttribute(String)
public void setOnClick(java.lang.String sOnClick)
Sets the onclick event of this object. The onclick event will fire when the html widget is clicked and will execute any client-side scripting code set.
The html attribute it sets is "onclick".
If null is specified the attribute is cleared.
sOnClick
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnClick()
public java.lang.String getOnClick()
setOnClick(String)
,
HtmlElement.getAttribute(String)
public void setOnDblClick(java.lang.String sOnDblClick)
Sets the ondblclick event of this object. The ondblclick event will fire when the html widget is double-clicked and will execute any client-side scripting code set.
The html attribute it sets is "ondblclick".
If null is specified the attribute is cleared.
sOnDblClick
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnDblClick()
public java.lang.String getOnDblClick()
setOnDblClick(String)
,
HtmlElement.getAttribute(String)
public void setOnMouseDown(java.lang.String sOnMouseDown)
Sets the onmousedown event of this object. The onmousedown event will fire when the html widget has the mouse button pressed over it and will execute any client-side scripting code set.
The html attribute it sets is "onmousedown".
If null is specified the attribute is cleared.
sOnMouseDown
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnMouseDown()
public java.lang.String getOnMouseDown()
setOnMouseDown(String)
,
HtmlElement.getAttribute(String)
public void setOnMouseUp(java.lang.String sOnMouseUp)
Sets the onmouseup event of this object. The onmouseup event will fire when the html widget has the mouse button released over it and will execute any client-side scripting code set.
The html attribute it sets is "onmouseup".
If null is specified the attribute is cleared.
sOnMouseUp
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnMouseUp()
public java.lang.String getOnMouseUp()
setOnMouseUp(String)
,
HtmlElement.getAttribute(String)
public void setOnMouseOver(java.lang.String sOnMouseOver)
Sets the onmouseover event of this object. The onmouseover event will fire when the html widget has the mouse pointer moved onto it and will execute any client-side scripting code set.
The html attribute it sets is "onmouseover".
If null is specified the attribute is cleared.
sOnMouseOver
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnMouseOver()
public java.lang.String getOnMouseOver()
setOnMouseOver(String)
,
HtmlElement.getAttribute(String)
public void setOnMouseMove(java.lang.String sOnMouseMove)
Sets the onmousemove event of this object. The onmousemove event will fire when the html widget has the mouse pointer moved while over it and will execute any client-side scripting code set.
The html attribute it sets is "onmousemove".
If null is specified the attribute is cleared.
sOnMouseMove
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnMouseMove()
public java.lang.String getOnMouseMove()
setOnMouseMove(String)
,
HtmlElement.getAttribute(String)
public void setOnMouseOut(java.lang.String sOnMouseOut)
Sets the onmouseout event of this object. The onmouseout event will fire when the html widget has the mouse pointer moved off it and will execute any client-side scripting code set.
The html attribute it sets is "onmouseout".
If null is specified the attribute is cleared.
sOnMouseOut
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnMouseOut()
public java.lang.String getOnMouseOut()
setOnMouseOut(String)
,
HtmlElement.getAttribute(String)
public void setOnKeyPress(java.lang.String sOnKeyPress)
Sets the onkeypress event of this object. The onkeypress event will fire when the html widget has focus and a key is pressed and released and will execute any client-side scripting code set.
The html attribute it sets is "onkeypress".
If null is specified the attribute is cleared.
sOnKeyPress
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnKeyPress()
public java.lang.String getOnKeyPress()
setOnKeyPress(String)
,
HtmlElement.getAttribute(String)
public void setOnKeyDown(java.lang.String sOnKeyDown)
Sets the onkeydown event of this object. The onkeydown event will fire when the html widget has focus and a key is pressed and will execute any client-side scripting code set.
The html attribute it sets is "onkeydown".
If null is specified the attribute is cleared.
sOnKeyDown
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnKeyDown()
public java.lang.String getOnKeyDown()
setOnKeyDown(String)
,
HtmlElement.getAttribute(String)
public void setOnKeyUp(java.lang.String sOnKeyUp)
Sets the onkeyup event of this object. The onkeyup event will fire when the html widget has focus and a key is released and will execute any client-side scripting code set.
The html attribute it sets is "onkeyup".
If null is specified the attribute is cleared.
sOnKeyUp
- the style for this elementHtmlElement.setAttribute(String, String)
,
getOnKeyUp()
public java.lang.String getOnKeyUp()
setOnKeyUp(String)
,
HtmlElement.getAttribute(String)
protected void destroy()
Removes this object from the form. Since Java has no destructors you must explicity call this method to correctly remove an object. The method will delink itself from its parent and clean up itself.
By default this method should only be accessed by other classes of this library. If users are allowed to explicity destroy this html widget then it needs to be made public.
isDestroyed()
public boolean isDestroyed()
Indicates whether this widget has been destroyed and should no longer be accessed.
destroy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |