com.dynamide
Class AbstractWidget

java.lang.Object
  extended by com.dynamide.DynamideObject
      extended by com.dynamide.resource.ContextNode
          extended by com.dynamide.JDOMFile
              extended by com.dynamide.Persistent
                  extended by com.dynamide.AbstractWidget
All Implemented Interfaces:
IChangeListener, IPropertyProvider, IContext, IGet, org.xml.sax.EntityResolver
Direct Known Subclasses:
Widget

public abstract class AbstractWidget
extends Persistent
implements IChangeListener


Nested Class Summary
 
Nested classes/interfaces inherited from class com.dynamide.Persistent
Persistent.Source
 
Field Summary
static boolean debugFrom
           
protected  java.lang.String m_type
           
protected  WidgetType m_widgetType
           
 
Fields inherited from class com.dynamide.Persistent
DEBUG_PAGE_SAVE, DEBUG_PROPS
 
Fields inherited from class com.dynamide.DynamideObject
m_id
 
Constructor Summary
AbstractWidget(DynamideObject owner, Session session)
           
AbstractWidget(DynamideObject owner, java.lang.String filename, Session session)
           
 
Method Summary
 void addChangeListener(IChangeListener new_listener)
           
 void changeProperty(java.lang.String propertyName, java.lang.String propertyValue)
           
 void changePropertyOLDDDDDDD(java.lang.String propertyName, java.lang.String propertyValue)
           
 void clearCachedDotName()
           
 void clearError()
           
 void clearErrorMessage()
           
 void close()
           
 void finalize()
           
static java.lang.String formatFullFieldName(AbstractWidget widget, boolean doAutoWidget)
           
static java.lang.String formatFullFieldName(AbstractWidget widget, boolean doAutoWidget, java.lang.String fieldName)
           
 java.lang.Object get(java.lang.String what)
          Handles get("name") and get("field") specially, otherwise performs a lookup in the persisted and runtime properties, then from the WidgetType type definition as specified by the widget xml file.
 java.lang.Object get(java.lang.String what, boolean lookForField)
           
 IDatasource getDatasource()
           
 java.lang.String getDotName()
           
 boolean getError()
           
 java.lang.String getErrorMessage()
           
 java.lang.String getErrorMessageHTML()
           
 Property getEventByOrdinal(int row)
           
 int getEventCount()
           
 java.lang.String getEventNameByOrdinal(int row)
           
 Field getField()
          Only Widgets use fields right now, Pages don't.
 Field getField(java.lang.String fieldName)
           
 java.lang.String getFieldID()
          This method returns the full, formatted fieldname, qualified with the datasource and index, if any.
 java.lang.String getFieldID(java.lang.String fieldName)
          Call this overload to get the fieldname for a field other than "field", e.g.
 java.lang.String getFieldStringValue(java.lang.String fieldName)
           
 java.lang.Object getObject()
          Widgets may have an underlying Java Object that performs the real work of the Widget.
 Property getPropertyByOrdinal(int row)
           
 int getPropertyCount()
           
 Property getPropertyDefault(java.lang.String what)
           
 java.lang.String getPropertyDefaultValue(java.lang.String what)
           
 java.lang.String getPropertyNameByOrdinal(int row)
           
 java.lang.Object getTableModel()
           
 java.lang.String getType()
           
 java.lang.Object getValue()
           
 WidgetType getWidgetType()
           
static void logFromInfo(java.lang.Class theClass, java.lang.String from, java.lang.String fullname, java.lang.String value)
           
protected  void notifyChangeListeners(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
           
 void propertyChanged(ChangeEvent changeEvent)
           
 void removeChangeListener(IChangeListener listener)
           
 void setError(boolean new_value)
           
 void setErrorMessage(java.lang.String message)
           
 void setID(java.lang.String new_value)
           
 void setObject(java.lang.Object object)
           
 void setPropertiesFromURL()
           
 void setProperty(Property property)
           
 void setTableModel(java.lang.Object tableModel)
           
 void setType(java.lang.String new_value)
           
 void setValue(java.lang.Object newValue)
           
static java.lang.String widgetTypeToScriptName(java.lang.String type)
           
 
Methods inherited from class com.dynamide.Persistent
addProperties, addProperty, clonePropertiesTable, dumpHTML, dumpProperties, findEventElement, getEvents, getEventSignature, getEventSource, getEventSource, getEventSourceBody, getHtmlsrcElement, getHtmlsrcElement, getNamedObject, getProperties, getPropertiesElement, getPropertiesTable, getProperty, getPropertyNames, getPropertyStringValue, getPropertyValue, getRawHTMLSource, getRawHTMLSource, getSession, getSourceElement, getSourceElement, hasProperty, isPropertyTrue, isValueTrue, listEvents, listEventsHTML, listProperties, mergeProperties, mergeProperty, removeProperty, removeWidgetContents, removeWidgetContents, resetPropertiesTable, setEventSource, setHTMLSource, setHTMLSourceIE, setNamedObject, setProperty, setProperty, setPropertyValue, setSession, sortPropertiesTable, toString
 
Methods inherited from class com.dynamide.JDOMFile
addError, clearErrors, commitInMemoryChangesToDOM, createJDomXMLOutputter, findFirstElement, findFirstElement, findFirstElementWithAttribute, getAttributeValue, getDocument, getErrors, getFilename, getFullXMLSource, getRootElement, hideEntities, isValidXHTML, isValidXHTMLFragment, listNamedElement, main, output, output, output, output, output, prepare, prettyPrintHTML, prettyPrintHTML, prettyPrintHTMLSafe, read, readFromString, reload, resolveEntity, safeGetElementChildText, saveToFile, saveToFile, select, select, select, selectFirst, selectFirst, setFilename, testPrettyPrint, unHideEntities, valueOf, valueOf
 
Methods inherited from class com.dynamide.resource.ContextNode
bind, bind, bindAll, bindAllAttributes, bindAttribute, dump, dumpAttributes, dumpContext, find, find, find, firstContext, getAttribute, getAttributeCount, getAttributes, getContext, getContextCount, getContexts, getKey, getPermission, hasAttribute, hasContext, listAttributeNames, listAttributeNames, listContextNames, listContextNames, lockPermissions, rebind, rebind, rebindAttribute, remove, removeAttribute, removeFirstContext, setKey, unlockPermissions, update, writeCache
 
Methods inherited from class com.dynamide.DynamideObject
clearProfiler, dump, expand, findParentExpander, findParentPage, findParentSession, findTopParentPage, getCategoryID, getID, getNextGetter, getObjectID, getOwner, getProfiler, isDebugEnabled, isInfoEnabled, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logWarn, logWarn, logWarn, logWarn, popLogContext, printf, printProfiler, profileEnter, profileLeave, pushLogContext, setDotName, setNextGetter, setObjectID, setOwner, sprintf, useProfiler, walkParents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_widgetType

protected WidgetType m_widgetType

m_type

protected java.lang.String m_type

debugFrom

public static final boolean debugFrom
See Also:
Constant Field Values
Constructor Detail

AbstractWidget

public AbstractWidget(DynamideObject owner,
                      Session session)

AbstractWidget

public AbstractWidget(DynamideObject owner,
                      java.lang.String filename,
                      Session session)
               throws org.jdom.JDOMException,
                      java.io.IOException
Throws:
org.jdom.JDOMException
java.io.IOException
Method Detail

setTableModel

public void setTableModel(java.lang.Object tableModel)

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class DynamideObject
Throws:
java.lang.Throwable

close

public void close()

getTableModel

public java.lang.Object getTableModel()

getError

public boolean getError()

setError

public void setError(boolean new_value)

getErrorMessage

public java.lang.String getErrorMessage()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getErrorMessageHTML

public java.lang.String getErrorMessageHTML()

setErrorMessage

public void setErrorMessage(java.lang.String message)

clearError

public void clearError()

clearErrorMessage

public void clearErrorMessage()

getObject

public java.lang.Object getObject()
Widgets may have an underlying Java Object that performs the real work of the Widget. In this case, the Widget author will set the Widget's Object to the Java Object. For example, the com.dynamide.rdbdatasource.xml file defines a Widget, but the work is all done in com.dynamide.db.RDBDatasource.java. So the xml widget source sets the Object of the Widget on load. Then, application programmers can get the backing object with code like this: RDBDatasource ds = event.sender.getObject();


setObject

public void setObject(java.lang.Object object)

getWidgetType

public WidgetType getWidgetType()

getType

public java.lang.String getType()

setType

public void setType(java.lang.String new_value)
             throws DatatypeException
Throws:
DatatypeException

widgetTypeToScriptName

public static java.lang.String widgetTypeToScriptName(java.lang.String type)

clearCachedDotName

public void clearCachedDotName()

getDotName

public java.lang.String getDotName()
Overrides:
getDotName in class DynamideObject

setID

public void setID(java.lang.String new_value)
Overrides:
setID in class DynamideObject

getValue

public java.lang.Object getValue()

setValue

public void setValue(java.lang.Object newValue)

get

public java.lang.Object get(java.lang.String what)
                     throws java.lang.Exception

Handles get("name") and get("field") specially, otherwise performs a lookup in the persisted and runtime properties, then from the WidgetType type definition as specified by the widget xml file.

get("field") autocreates fields based on parent name and current object name when NOT in designMode. So, at runtime, if you didn't set field, it will be created for you so that widgets persist their values between screens even if you don't feel like adding a field to the fielddefs. This only happens at non designTime, so the autocreated fields do not get persisted to the pagefile or get seen in the property inspector. In the property inspector, you will just see "{autocreate}".

IMPORTANT: No checking is done to see if the field is missing. If you set the field to a value, then delete the field, the widet will not have a field.

Specified by:
get in interface IGet
Overrides:
get in class ContextNode
Throws:
java.lang.Exception

get

public java.lang.Object get(java.lang.String what,
                            boolean lookForField)
                     throws java.lang.Exception
Throws:
java.lang.Exception

logFromInfo

public static void logFromInfo(java.lang.Class theClass,
                               java.lang.String from,
                               java.lang.String fullname,
                               java.lang.String value)

getPropertyDefault

public Property getPropertyDefault(java.lang.String what)

getPropertyDefaultValue

public java.lang.String getPropertyDefaultValue(java.lang.String what)

getDatasource

public IDatasource getDatasource()

getField

public Field getField()
Only Widgets use fields right now, Pages don't.


getField

public Field getField(java.lang.String fieldName)

getFieldStringValue

public java.lang.String getFieldStringValue(java.lang.String fieldName)

getFieldID

public java.lang.String getFieldID(java.lang.String fieldName)
                            throws java.lang.Exception
Call this overload to get the fieldname for a field other than "field", e.g. "captionField".

Throws:
java.lang.Exception

getFieldID

public java.lang.String getFieldID()
                            throws java.lang.Exception
This method returns the full, formatted fieldname, qualified with the datasource and index, if any. Calling this method is equivalent to $widget.fieldID or $widget.FieldID in webmacro, because get("fieldID") is defined, and simply calls this method, and if you say $widget.FieldID (capital F) then Webmacro will call getFieldID() directly.

Throws:
java.lang.Exception

formatFullFieldName

public static java.lang.String formatFullFieldName(AbstractWidget widget,
                                                   boolean doAutoWidget)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

formatFullFieldName

public static java.lang.String formatFullFieldName(AbstractWidget widget,
                                                   boolean doAutoWidget,
                                                   java.lang.String fieldName)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

changeProperty

public void changeProperty(java.lang.String propertyName,
                           java.lang.String propertyValue)

changePropertyOLDDDDDDD

public void changePropertyOLDDDDDDD(java.lang.String propertyName,
                                    java.lang.String propertyValue)

setProperty

public void setProperty(Property property)
Overrides:
setProperty in class Persistent

setPropertiesFromURL

public void setPropertiesFromURL()

propertyChanged

public void propertyChanged(ChangeEvent changeEvent)
Specified by:
propertyChanged in interface IChangeListener

addChangeListener

public void addChangeListener(IChangeListener new_listener)

removeChangeListener

public void removeChangeListener(IChangeListener listener)

notifyChangeListeners

protected void notifyChangeListeners(java.lang.String propertyName,
                                     java.lang.Object oldValue,
                                     java.lang.Object newValue)

getPropertyCount

public int getPropertyCount()

getPropertyNameByOrdinal

public java.lang.String getPropertyNameByOrdinal(int row)

getPropertyByOrdinal

public Property getPropertyByOrdinal(int row)

getEventNameByOrdinal

public java.lang.String getEventNameByOrdinal(int row)

getEventByOrdinal

public Property getEventByOrdinal(int row)

getEventCount

public int getEventCount()


Copyright 2001-2013 DYNAMIDE.COM. All Rights Reserved.