com.dynamide
Class Widget

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
                      extended by com.dynamide.Widget
All Implemented Interfaces:
IChangeListener, IPropertyProvider, IContext, IGet, org.xml.sax.EntityResolver
Direct Known Subclasses:
Page

public class Widget
extends AbstractWidget

Runtime object representing a Widget. (See also WidgetType, which is a representation of the component and its defining file, and contains all the valid/default properties.) This class should give access to that information but also the runtime properties set by the app designer. In the xml file that persists the design-time Page, all Widget instances are persisted, in widget elements. Properties for the Widget (that are legal from the WidgetType) are stored in the Widget instance's widget element in the page file. Properties that are named in any attached Field object are stored there instead.

Widget and Widget type were made separate classes because the persistence is separate and represents the difference between type (WidgetType) and instance (Widget), not to be confused with types and instances of these java classes. This class descends from AbstractWidget, as does com.dynamide.Page. AbstractWidget abstracts the code for dealing with the WidgetType.

The lookup for properties is done in three steps then:

When setting properties, the lookup is:

Note that when setting, properties are NOT persisted into WidgetType, since this would change the component type. There is no GUI or any other way now to change the WidgetType properties. These must be edited in the component xml file.

Also, note that Widgets do not save themselves to a file like Page does. They are persisted in the Page file's persistence of the Page they are on.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.dynamide.Persistent
Persistent.Source
 
Field Summary
 
Fields inherited from class com.dynamide.AbstractWidget
debugFrom, m_type, 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
Widget(DynamideObject owner, Session session)
           
Widget(DynamideObject owner, java.lang.String filename, Session newSession)
           
 
Method Summary
 java.lang.Object call(java.lang.String eventFullName)
           
 java.lang.Object call(java.lang.String eventFullName, java.lang.Object inputObject)
           
 void cleanup()
           
 java.lang.String eventShortNameToFullName(java.lang.String eventShortName)
          There's also a version of this in Page, but not polymorphic.
 void finalize()
           
 ScriptEvent fire_beforeOutput()
           
 ScriptEvent fire_onLoad()
           
 ScriptEvent fireEvent(java.lang.Object inputObject, java.lang.String eventShortName)
           
 ScriptEvent fireEvent(java.lang.Object inputObject, java.lang.String eventFullName, java.lang.String pageID, java.lang.String action)
          Fires a "class event", that is, fires an event defined in the widget type source (e.g int com.dynamide.edit.xml which looks like com_dynamide_edit_onLoad), but passes in an instance of the actual Widget; This is different from calling a wired Widget event, which is in the Page source (e.g. page1.xml, which looks like page1_datasource1_beforePost); If you wish to do the latter, use the overload that has no pageID.
 boolean getDesignMode()
           
 java.lang.String getEventPrefixName()
           
 java.lang.String getName()
           
 Page getPage()
           
 void initFromElement(org.jdom.Element new_value)
           
 void printSerialized(java.io.Writer out, int indentLevel)
          this is called by XMLWidgetOutputter as it attempts to output the tree.
 void printSerialized(java.io.Writer out, int indentLevel, boolean wantWidgetSpan)
           
 java.lang.String render()
           
 java.lang.String render(boolean wantWidgetSpan)
           
 void setDesignMode(boolean new_value)
           
 void setID(java.lang.String new_value)
           
 void setName(java.lang.String new_value)
           
 void setPage(Page new_value)
           
 org.jdom.Element toElement()
          Persist to Element, rather than just returning the m_element, since this saves any in-memory changes
 java.lang.String toString()
           
 
Methods inherited from class com.dynamide.AbstractWidget
addChangeListener, changeProperty, changePropertyOLDDDDDDD, clearCachedDotName, clearError, clearErrorMessage, close, formatFullFieldName, formatFullFieldName, get, get, getDatasource, getDotName, getError, getErrorMessage, getErrorMessageHTML, getEventByOrdinal, getEventCount, getEventNameByOrdinal, getField, getField, getFieldID, getFieldID, getFieldStringValue, getObject, getPropertyByOrdinal, getPropertyCount, getPropertyDefault, getPropertyDefaultValue, getPropertyNameByOrdinal, getTableModel, getType, getValue, getWidgetType, logFromInfo, notifyChangeListeners, propertyChanged, removeChangeListener, setError, setErrorMessage, setObject, setPropertiesFromURL, setProperty, setTableModel, setType, setValue, widgetTypeToScriptName
 
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
 
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
 

Constructor Detail

Widget

public Widget(DynamideObject owner,
              Session session)

Widget

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

finalize

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

cleanup

public void cleanup()

toString

public java.lang.String toString()
Overrides:
toString in class Persistent

getDesignMode

public boolean getDesignMode()

setDesignMode

public void setDesignMode(boolean new_value)

getPage

public Page getPage()

setPage

public void setPage(Page new_value)

toElement

public org.jdom.Element toElement()
Persist to Element, rather than just returning the m_element, since this saves any in-memory changes


getName

public java.lang.String getName()

setName

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

setID

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

getEventPrefixName

public java.lang.String getEventPrefixName()

eventShortNameToFullName

public java.lang.String eventShortNameToFullName(java.lang.String eventShortName)
There's also a version of this in Page, but not polymorphic.


initFromElement

public void initFromElement(org.jdom.Element new_value)
                     throws DatatypeException
Throws:
DatatypeException

printSerialized

public void printSerialized(java.io.Writer out,
                            int indentLevel)
                     throws java.lang.Exception
this is called by XMLWidgetOutputter as it attempts to output the tree. We respond by using WebMacro to output the node.

Throws:
java.lang.Exception

printSerialized

public void printSerialized(java.io.Writer out,
                            int indentLevel,
                            boolean wantWidgetSpan)
                     throws java.lang.Exception
Throws:
java.lang.Exception

render

public java.lang.String render()

render

public java.lang.String render(boolean wantWidgetSpan)

fire_onLoad

public ScriptEvent fire_onLoad()

fire_beforeOutput

public ScriptEvent fire_beforeOutput()

call

public java.lang.Object call(java.lang.String eventFullName)

call

public java.lang.Object call(java.lang.String eventFullName,
                             java.lang.Object inputObject)

fireEvent

public ScriptEvent fireEvent(java.lang.Object inputObject,
                             java.lang.String eventFullName,
                             java.lang.String pageID,
                             java.lang.String action)
Fires a "class event", that is, fires an event defined in the widget type source (e.g int com.dynamide.edit.xml which looks like com_dynamide_edit_onLoad), but passes in an instance of the actual Widget; This is different from calling a wired Widget event, which is in the Page source (e.g. page1.xml, which looks like page1_datasource1_beforePost); If you wish to do the latter, use the overload that has no pageID.


fireEvent

public ScriptEvent fireEvent(java.lang.Object inputObject,
                             java.lang.String eventShortName)


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