com.smartgwt.client.core
Class BaseClass

java.lang.Object
  extended by com.smartgwt.client.core.BaseClass
Direct Known Subclasses:
DataSource, DrawItem, ProcessElement, RecordList, SimpleType, Tree, ValuesManager

public abstract class BaseClass
extends Object


Field Summary
protected  JavaScriptObject config
           
protected  String id
           
protected  String scClassName
           
 
Constructor Summary
  BaseClass()
           
protected BaseClass(JavaScriptObject jsObj)
           
 
Method Summary
protected abstract  JavaScriptObject create()
           
 void destroy()
          Destroy this object.
protected
<H extends EventHandler>
HandlerRegistration
doAddHandler(H handler, GwtEvent.Type<H> type)
           
protected  void error(String message)
           
protected  void error(String attribute, String value, boolean allowPostCreate)
           
protected  void errorIfNotCreated(String property)
           
 void fireEvent(GwtEvent<?> event)
           
 String getAttribute(String attribute)
           
 Boolean getAttributeAsBoolean(String property)
           
 Date getAttributeAsDate(String property)
           
 Double getAttributeAsDouble(String property)
           
 Element getAttributeAsElement(String property)
           
 Float getAttributeAsFloat(String property)
           
 Integer getAttributeAsInt(String property)
           
 JavaScriptObject getAttributeAsJavaScriptObject(String property)
           
 Map getAttributeAsMap(String property)
           
 String getAttributeAsString(String property)
           
 JavaScriptObject getConfig()
           
 int getHandlerCount(GwtEvent.Type<?> type)
           
 String getID()
          Return the ID
 JavaScriptObject getJsObj()
           
 JavaScriptObject getOrCreateJsObj()
           
static BaseClass getRef(JavaScriptObject jsObj)
           
 String getScClassName()
          Get the name of the underlying SmartClient class
 boolean isCreated()
           
protected  void onInit()
           
 void setAttribute(String attribute, BaseClass[] value, boolean allowPostCreate)
           
protected  void setAttribute(String attribute, boolean value, boolean allowPostCreate)
           
 void setAttribute(String attribute, Boolean value, boolean allowPostCreate)
           
 void setAttribute(String attribute, DataClass[] value, boolean allowPostCreate)
           
 void setAttribute(String attribute, DataClass value, boolean allowPostCreate)
           
 void setAttribute(String attribute, Date value, boolean allowPostCreate)
           
 void setAttribute(String attribute, double value, boolean allowPostCreate)
           
 void setAttribute(String attribute, Element value, boolean allowPostCreate)
           
 void setAttribute(String attribute, int[] value, boolean allowPostCreate)
           
 void setAttribute(String attribute, int value, boolean allowPostCreate)
           
 void setAttribute(String attribute, JavaScriptObject value, boolean allowPostCreate)
           
 void setAttribute(String attribute, Map value, boolean allowPostCreate)
           
 void setAttribute(String attribute, String[] value, boolean allowPostCreate)
           
 void setAttribute(String attribute, String value, boolean allowPostCreate)
           
 void setAttribute(String attribute, ValueEnum[] value, boolean allowPostCreate)
           
 void setID(String id)
           
 void setProperty(String property, boolean value)
           
 void setProperty(String property, double value)
           
 void setProperty(String property, JavaScriptObject value)
           
 void setProperty(String property, String value)
           
 void setScClassName(String scClassName)
          Set the name of the underlying SmartClient class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected String id

config

protected JavaScriptObject config

scClassName

protected String scClassName
Constructor Detail

BaseClass

public BaseClass()

BaseClass

protected BaseClass(JavaScriptObject jsObj)
Method Detail

getID

public String getID()
Return the ID

Returns:
the ID

setID

public void setID(String id)

getScClassName

public String getScClassName()
Get the name of the underlying SmartClient class

Returns:
the SmartClient class name

setScClassName

public void setScClassName(String scClassName)
Set the name of the underlying SmartClient class. This is an advanced setting.

Parameters:
scClassName - the SmartClient class

getConfig

public JavaScriptObject getConfig()

isCreated

public boolean isCreated()

getJsObj

public JavaScriptObject getJsObj()

getOrCreateJsObj

public JavaScriptObject getOrCreateJsObj()

getRef

public static BaseClass getRef(JavaScriptObject jsObj)

destroy

public void destroy()
Destroy this object.


error

protected void error(String attribute,
                     String value,
                     boolean allowPostCreate)
              throws IllegalStateException
Throws:
IllegalStateException

errorIfNotCreated

protected void errorIfNotCreated(String property)
                          throws IllegalStateException
Throws:
IllegalStateException

error

protected void error(String message)
              throws IllegalStateException
Throws:
IllegalStateException

create

protected abstract JavaScriptObject create()

onInit

protected void onInit()

getAttribute

public String getAttribute(String attribute)

getAttributeAsString

public String getAttributeAsString(String property)

getAttributeAsDate

public Date getAttributeAsDate(String property)

getAttributeAsInt

public Integer getAttributeAsInt(String property)

getAttributeAsDouble

public Double getAttributeAsDouble(String property)

getAttributeAsElement

public Element getAttributeAsElement(String property)

getAttributeAsJavaScriptObject

public JavaScriptObject getAttributeAsJavaScriptObject(String property)

getAttributeAsFloat

public Float getAttributeAsFloat(String property)

getAttributeAsBoolean

public Boolean getAttributeAsBoolean(String property)

getAttributeAsMap

public Map getAttributeAsMap(String property)

setAttribute

public void setAttribute(String attribute,
                         String value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         Boolean value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         Map value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         int[] value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         BaseClass[] value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         DataClass[] value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         double value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         int value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         Date value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         ValueEnum[] value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         DataClass value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         JavaScriptObject value,
                         boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         String[] value,
                         boolean allowPostCreate)

setAttribute

protected void setAttribute(String attribute,
                            boolean value,
                            boolean allowPostCreate)

setAttribute

public void setAttribute(String attribute,
                         Element value,
                         boolean allowPostCreate)

setProperty

public void setProperty(String property,
                        String value)

setProperty

public void setProperty(String property,
                        boolean value)

setProperty

public void setProperty(String property,
                        double value)

setProperty

public void setProperty(String property,
                        JavaScriptObject value)

fireEvent

public void fireEvent(GwtEvent<?> event)

doAddHandler

protected final <H extends EventHandler> HandlerRegistration doAddHandler(H handler,
                                                                          GwtEvent.Type<H> type)

getHandlerCount

public int getHandlerCount(GwtEvent.Type<?> type)