com.smartgwt.client.widgets
Class BaseWidget
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
- All Implemented Interfaces:
- HasHandlers, com.google.gwt.user.client.EventListener
- Direct Known Subclasses:
- Canvas
public abstract class BaseWidget
- extends com.google.gwt.user.client.ui.Widget
- implements HasHandlers
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
protected com.google.gwt.core.client.JavaScriptObject |
config
|
protected boolean |
configOnly
|
protected java.lang.String |
id
|
protected boolean |
isElementSet
|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
DEBUG_ID_PREFIX |
Method Summary |
HandlerRegistration |
addDrawHandler(DrawHandler handler)
|
protected com.google.gwt.core.client.JavaScriptObject |
create()
|
void |
destroy()
|
protected
|
doAddHandler(H handler,
GwtEvent.Type<H> type)
Adds this handler to the widget. |
protected void |
doInit()
|
void |
doOnRender(Function function)
|
void |
draw()
Draws the widget on the page.
|
boolean |
equals(java.lang.Object obj)
|
protected void |
error(java.lang.String message)
|
protected void |
errorIfNotCreated(java.lang.String property)
|
void |
fireEvent(GwtEvent<?> event)
Fires the given event to all the appropriate handlers. |
protected java.lang.String |
getAttribute(java.lang.String attribute)
|
protected java.lang.Boolean |
getAttributeAsBoolean(java.lang.String attribute)
|
protected java.util.Date |
getAttributeAsDate(java.lang.String attribute)
|
protected java.lang.Double |
getAttributeAsDouble(java.lang.String attribute)
|
protected com.google.gwt.user.client.Element |
getAttributeAsElement(java.lang.String attribute)
|
protected java.lang.Float |
getAttributeAsFloat(java.lang.String attribute)
|
protected java.lang.Integer |
getAttributeAsInt(java.lang.String attribute)
|
protected com.google.gwt.core.client.JavaScriptObject |
getAttributeAsJavaScriptObject(java.lang.String attribute)
|
protected java.util.Map |
getAttributeAsMap(java.lang.String attribute)
|
protected java.lang.String |
getAttributeAsString(java.lang.String attribute)
|
protected java.lang.String[] |
getAttributeAsStringArray(java.lang.String attribute)
|
com.google.gwt.core.client.JavaScriptObject |
getConfig()
|
com.google.gwt.user.client.Element |
getDOM()
|
com.google.gwt.user.client.Element |
getElement()
|
com.google.gwt.user.client.Element |
getElement(boolean allowPreRender)
|
int |
getHandlerCount(GwtEvent.Type<?> type)
|
java.lang.String |
getID()
|
java.lang.String |
getInnerHTML()
Return the inner HTML for this canvas. |
com.google.gwt.core.client.JavaScriptObject |
getJsObj()
|
com.google.gwt.core.client.JavaScriptObject |
getOrCreateJsObj()
|
static BaseWidget |
getRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
java.lang.String |
getTitle()
|
int |
hashCode()
|
boolean |
isConfigOnly()
|
boolean |
isCreated()
|
protected java.lang.Boolean |
isDrawn()
|
protected void |
onDestroy()
|
protected void |
onDraw()
|
protected void |
onInit()
|
protected void |
setAttribute(java.lang.String attribute,
BaseClass[] value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
BaseWidget[] value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
BaseWidget value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
java.lang.Boolean value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
DataClass[] value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
DataClass value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
java.util.Date value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
double value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
com.google.gwt.user.client.Element value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
float value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
int[] value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
java.lang.Integer value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
com.google.gwt.core.client.JavaScriptObject[] value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
com.google.gwt.core.client.JavaScriptObject value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
java.util.Map value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
java.lang.Object[] value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
java.lang.String[] value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
java.lang.String value,
boolean allowPostCreate)
|
protected void |
setAttribute(java.lang.String attribute,
ValueEnum value,
boolean allowPostCreate)
|
void |
setConfig(com.google.gwt.core.client.JavaScriptObject config)
|
void |
setConfigOnly(boolean configOnly)
|
protected boolean |
setDragTracker()
|
protected void |
setElement(com.google.gwt.user.client.Element elem)
|
void |
setHtmlElement(com.google.gwt.user.client.Element element)
|
void |
setID(java.lang.String id)
|
void |
setNullProperty(java.lang.String property)
|
void |
setPosition(java.lang.String position)
|
void |
setProperty(java.lang.String property,
boolean value)
|
void |
setProperty(java.lang.String property,
double value)
|
void |
setProperty(java.lang.String property,
com.google.gwt.user.client.Element value)
|
void |
setProperty(java.lang.String property,
float value)
|
void |
setProperty(java.lang.String property,
int value)
|
void |
setProperty(java.lang.String property,
com.google.gwt.core.client.JavaScriptObject value)
|
void |
setProperty(java.lang.String property,
java.lang.String value)
|
void |
setTitle(java.lang.String title)
|
java.lang.String |
toString()
|
Methods inherited from class com.google.gwt.user.client.ui.Widget |
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, setWidth, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
id
protected java.lang.String id
config
protected com.google.gwt.core.client.JavaScriptObject config
isElementSet
protected boolean isElementSet
configOnly
protected boolean configOnly
BaseWidget
public BaseWidget()
BaseWidget
protected BaseWidget(com.google.gwt.core.client.JavaScriptObject jsObj)
BaseWidget
public BaseWidget(java.lang.String id)
fireEvent
public void fireEvent(GwtEvent<?> event)
- Description copied from interface:
HasHandlers
- Fires the given event to all the appropriate handlers.
- Specified by:
fireEvent
in interface HasHandlers
- Parameters:
event
- the event to be fired
doAddHandler
protected final <H extends EventHandler> HandlerRegistration doAddHandler(H handler,
GwtEvent.Type<H> type)
- Adds this handler to the widget.
- Type Parameters:
H
- the type of handler to add- Parameters:
type
- the event typehandler
- the handler
- Returns:
HandlerRegistration
used to remove the handler
getHandlerCount
public int getHandlerCount(GwtEvent.Type<?> type)
getRef
public static BaseWidget getRef(com.google.gwt.core.client.JavaScriptObject jsObj)
setElement
protected void setElement(com.google.gwt.user.client.Element elem)
- Overrides:
setElement
in class com.google.gwt.user.client.ui.UIObject
doInit
protected final void doInit()
onInit
protected void onInit()
isConfigOnly
public boolean isConfigOnly()
setConfigOnly
public void setConfigOnly(boolean configOnly)
setDragTracker
protected boolean setDragTracker()
getInnerHTML
public java.lang.String getInnerHTML()
- Return the inner HTML for this canvas. Called when the canvas is drawn or redrawn;
override to customize.
Note : Canvas.setRedrawOnResize(java.lang.Boolean)
should be set to true for components whose inner HTML
will not automatically reflow to fit the component's new size.
- Returns:
- HTML contents of this canvas
draw
public void draw()
- Draws the widget on the page.
destroy
public void destroy()
doOnRender
public void doOnRender(Function function)
addDrawHandler
public HandlerRegistration addDrawHandler(DrawHandler handler)
onDraw
protected void onDraw()
onDestroy
protected void onDestroy()
getElement
public com.google.gwt.user.client.Element getElement()
- Overrides:
getElement
in class com.google.gwt.user.client.ui.UIObject
getElement
public com.google.gwt.user.client.Element getElement(boolean allowPreRender)
setPosition
public void setPosition(java.lang.String position)
setHtmlElement
public void setHtmlElement(com.google.gwt.user.client.Element element)
getDOM
public com.google.gwt.user.client.Element getDOM()
getID
public java.lang.String getID()
setID
public void setID(java.lang.String id)
getConfig
public com.google.gwt.core.client.JavaScriptObject getConfig()
setConfig
public void setConfig(com.google.gwt.core.client.JavaScriptObject config)
isCreated
public boolean isCreated()
isDrawn
protected java.lang.Boolean isDrawn()
getJsObj
public com.google.gwt.core.client.JavaScriptObject getJsObj()
getOrCreateJsObj
public com.google.gwt.core.client.JavaScriptObject getOrCreateJsObj()
create
protected com.google.gwt.core.client.JavaScriptObject create()
getAttribute
protected java.lang.String getAttribute(java.lang.String attribute)
getAttributeAsString
protected java.lang.String getAttributeAsString(java.lang.String attribute)
getAttributeAsStringArray
protected java.lang.String[] getAttributeAsStringArray(java.lang.String attribute)
getAttributeAsDate
protected java.util.Date getAttributeAsDate(java.lang.String attribute)
getAttributeAsDouble
protected java.lang.Double getAttributeAsDouble(java.lang.String attribute)
getAttributeAsElement
protected com.google.gwt.user.client.Element getAttributeAsElement(java.lang.String attribute)
getAttributeAsJavaScriptObject
protected com.google.gwt.core.client.JavaScriptObject getAttributeAsJavaScriptObject(java.lang.String attribute)
getAttributeAsInt
protected java.lang.Integer getAttributeAsInt(java.lang.String attribute)
getAttributeAsFloat
protected java.lang.Float getAttributeAsFloat(java.lang.String attribute)
getAttributeAsBoolean
protected java.lang.Boolean getAttributeAsBoolean(java.lang.String attribute)
getAttributeAsMap
protected java.util.Map getAttributeAsMap(java.lang.String attribute)
errorIfNotCreated
protected void errorIfNotCreated(java.lang.String property)
throws java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
error
protected void error(java.lang.String message)
throws java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
setAttribute
protected void setAttribute(java.lang.String attribute,
java.lang.String value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
ValueEnum value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
BaseWidget value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
java.util.Map value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
int[] value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
DataClass value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
DataClass[] value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
com.google.gwt.core.client.JavaScriptObject[] value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
BaseClass[] value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
BaseWidget[] value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
float value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
double value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
java.lang.Integer value,
boolean allowPostCreate)
setNullProperty
public void setNullProperty(java.lang.String property)
setProperty
public void setProperty(java.lang.String property,
java.lang.String value)
setProperty
public void setProperty(java.lang.String property,
boolean value)
setProperty
public void setProperty(java.lang.String property,
int value)
setProperty
public void setProperty(java.lang.String property,
float value)
setProperty
public void setProperty(java.lang.String property,
double value)
setProperty
public void setProperty(java.lang.String property,
com.google.gwt.user.client.Element value)
setProperty
public void setProperty(java.lang.String property,
com.google.gwt.core.client.JavaScriptObject value)
setAttribute
protected void setAttribute(java.lang.String attribute,
java.util.Date value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
com.google.gwt.core.client.JavaScriptObject value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
java.lang.String[] value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
java.lang.Object[] value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
java.lang.Boolean value,
boolean allowPostCreate)
setAttribute
protected void setAttribute(java.lang.String attribute,
com.google.gwt.user.client.Element value,
boolean allowPostCreate)
setTitle
public void setTitle(java.lang.String title)
- Overrides:
setTitle
in class com.google.gwt.user.client.ui.UIObject
getTitle
public java.lang.String getTitle()
- Overrides:
getTitle
in class com.google.gwt.user.client.ui.UIObject
toString
public java.lang.String toString()
- Overrides:
toString
in class com.google.gwt.user.client.ui.UIObject
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object