org.formaria.aria
Interface PageSupport

All Superinterfaces:
ExceptionHandler, PersistentState
All Known Subinterfaces:
DialogSupport, Page
All Known Implementing Classes:
DateChooserDialog, DateChooserDialog, Dialog, Dialog, Dialog, DialogTable, DialogTableAddColumn, DialogTableAddItem, DialogTableSetValueColumnItem, GroovyPage, LanguageChooserDialog, LanguageChooserDialog, LanguageChooserDialog, MessageBox, MessageBox, NavigationHelper, Page, Page, PageSizeDialog, PasswordDlg, PojoDialog, SwtPage, Toolbar

public interface PageSupport
extends ExceptionHandler, PersistentState

Some common page methods, the page support is used as a common abstraction of the various page implementations. The interface includes those methods needed by the Aria framework to manage pages.

Copyright (c) Formaria Ltd., 2008

License: see license.txt

$Revision: 1.9 $


Nested Class Summary
static interface PageSupport.IDialog
          A bare interface used to distinguish dialogs from normal pages and checked by the PageManager when loading pages
 
Field Summary
static int ACTIVATED
          The page has been activated
static java.lang.String ANNOTATEDIMAGE
          Deprecated. merged with imagemap
static java.lang.String ARIA_AWT_PACKAGE
          The package name for the built-in AWT component
static java.lang.String ARIA_HTML_PACKAGE
          The package name for the built-in HTML components
static java.lang.String ARIA_SWING_PACKAGE
          The package name for the built-in Swing component
static java.lang.String ARIA_SWT_PACKAGE
          The package name for the built-in SWT components
static int BORDER_LAYOUT
          ID for a border layout
static int BOX_LAYOUT
          This type of layout simulates the Swing layout by using a GridLayout such that the layoutStyle attribute indicates vertical or horizontal layout.
static java.lang.String BUTTON
          Tag for a push button
static int CARD_LAYOUT
          ID for a card layout
static java.lang.String CHECK
          Tag for a checkbox
static int COLUMN_LAYOUT
          ColumnLayout ID
static java.lang.String COMBO
          Tag for a combo box or drop down list
static int CREATED
          The page has been created
static int DEACTIVATED
          The page has been deactivated
static int DISCARDED
          The page has been discarded
static int DISPLAYED
          The page has been activated and displayed
static java.lang.String EDIT
          A single text editing field
static int FLOW_LAYOUT
          ID for a flow layout
static int GRID_LAYOUT
          ID for a grid layout
static int GRIDBAG_LAYOUT
          ID for a grid bag layout
static java.lang.String GROUP
          Tag for a radio button group
static int GUIDE_LAYOUT
          GuideLayout ID
static java.lang.String HOTSPOTIMAGE
          Tag for a hotspot image
static java.lang.String IMAGE
          Tag for an image component
static java.lang.String IMAGEMAP
          Tag for an image map
static java.lang.String LABEL
          Tag for a label component
static int LAYER_LAYOUT
          LayerLayout ID
static java.lang.String LIST
          Tag for a list box
static int LOADED
          The page has been loaded
static java.lang.String MENU
          Tag for a menu
static java.lang.String MENUBAR
          Tag for a menubar
static java.lang.String MENUITEM
          Tag for a menu item
static java.lang.String METACONTENT
          Tag for Tagged text
static int NULL_LAYOUT
          ID for an NULL layout
static java.lang.String PANEL
          Tag for a panel
static java.lang.String PASSWORD
          Tag for a password edit field
static java.lang.String RADIO
          Tag for a radio button
static int SCALE_LAYOUT
          ScaleLayout ID
static java.lang.String SCROLLABLEMETACONTENT
          Tag for a Scrollable tagged text
static java.lang.String SCROLLPANE
          Tag for a scroll pane
static java.lang.String SPLITPANE
          Tag for a splitter
static int SPRING_LAYOUT
          SpringLayout ID
static java.lang.String TABLE
          Tag for a table component
static java.lang.String TABPANEL
          Tag for a tabbed panel
static java.lang.String TEXTAREA
          Tag for a multiline text field
static java.lang.String UNKNOWN
          Tag for an unknown component type (not one of the built-in types)
static int UNKNOWN_PAGE_STATE
          The page state is unknown
static java.lang.String WMF
          Tag for a vector image
 
Method Summary
 int accumulateMessages(boolean start, int level)
          Informs the handler when a page validation is starting or stopping.
 void addBinding(DataBinding b)
          Add a binding of a component to the data model.
 void addHandler(java.lang.Object comp, long eventType, java.lang.String methodName)
          Adds an event handler.
 void addHandler(java.lang.Object srcObj, java.lang.String methodName, java.lang.String adderMethod, java.lang.String listenerInterface, long eventMask, java.lang.Object listener)
          Adds a handler for action events
 void addListener(java.lang.Object comp, java.lang.String listenerName, java.lang.String argType, java.lang.Object listener)
          Adds a listener for an event type.
 void addNestedPage(PageSupport ps)
          Add a nested page reference
 Validator addValidation(java.lang.Object comp, java.lang.String validationName)
          Adds a validation to this page.
 Validator addValidation(java.lang.Object comp, java.lang.String validationName, java.lang.String method)
          Adds a validation to this page.
 Validator addValidation(java.lang.Object comp, java.lang.String validationName, java.lang.String method, int mask, XmlElement pageEle)
          Adds a validation to this page.
 int checkValidations(java.lang.Object scope)
          Check all validations for this page.
 void clearValidations()
          Reset/removes all validations
 void doLayout()
          Layout the page
 void enterDataBindingContext(java.lang.String contextName)
          Gets the named DataBindingContext object bound to this PageHelper object, creating the context if necessary.
 java.lang.Object evaluateAttribute(java.lang.String attribValue)
          Evaluates an attribute value.
 java.lang.String evaluatePath(java.lang.String path)
          Evaluates a path (potentially) containing a method call
 void exitDataBindingContext()
          Exit the data binding context and return to the parent context if any
 java.lang.Object findComponent(java.lang.Object container, java.lang.String name)
          Find a named component in the container.
 java.lang.Object findComponent(java.lang.String name)
          Find a named component in the container.
 java.lang.Object getAttribute(java.lang.String attribName)
          Gets an attribute value
 java.lang.Object getAttribute(java.lang.String attribName, java.lang.String compName)
          Gets an attribute value
 DataBinding getBinding(java.lang.Object targetComp)
          Find the data binding associated with a component
 DataBinding getBinding(java.lang.String targetPath)
          Find the data binding associated with a data source path
 java.util.Vector getBindings()
          Get the data bindings for the page
 ComponentFactory getComponentFactory()
          Get the component factory instance being used by this page.
 java.lang.String getComponentName(java.lang.Object comp)
          Get a name for a component.
 java.util.EventObject getCurrentEvent()
          Get the current event
 DataBindingContext getDataBindingContext()
          Get the DataBindingContext object bound to this page
 DataBindingContext getDataBindingContext(java.lang.String contextName)
          Gets the named DataBindingContext context
 java.lang.Object getEventAttribute(java.lang.Object c, java.lang.String attribName)
          Gets an attribute value belonging to a component
 AriaEventHandler getEventHandler()
          Get the current event handler
 java.lang.String getExtension()
          Get the file extension of the page
 java.lang.String getName()
          Get the name of the page
 java.lang.Object getOwner()
          Get the parent
 java.awt.Dimension getPageSize()
          Get the size
 Project getProject()
          Get the current project, the project that owns this page
 int getStatus()
          Get the page status
 ValidationHandler getValidationHandler()
          Gets the validation handler
 boolean handleEventHandlerException(Project project, java.lang.Object container, java.lang.Throwable error)
          Handle an exception during the invocation of a page's event handler.
 boolean handleException(java.lang.Object comp, java.lang.Exception ex, java.lang.Object validator)
          A method called when a validation exeption has been trapped.
 boolean isFocusChangeSuppressed()
          Check the focus change status
 void pageActivated()
          A method called once the page has been created and initialized but just prior to display
 void pageAdded()
          A method called once the page has been added to its parent container but not yet displayed
 void pageCreated()
          A method called once the page has been created but not yet initialized.
 void pageDeactivated()
          Called when the page is about to loose scope and be hidden.
 void removeBinding(DataBinding b)
          Remove a binding of a component to the data model.
 int saveBoundComponentValues()
          Save the component values to the model
 void setAttribute(java.lang.String attribName, java.lang.String compName, java.lang.Object attribValue)
          Set a named attributes.
 void setBackground(java.awt.Color c)
          Set the background color
 void setClearPage(boolean value)
          Modify the clearPage flag.
 void setComponentFactory(StyleFactory factory)
          Set the component factory instance being used by this page when constructing new pages.
 void setEventHandler(AriaEventHandler eh)
          Set the current event handler
 void setExceptionHandler(ExceptionHandler eh)
          Set the validation exception handler called when a validation exception is trapped
 void setExtension(java.lang.String ext)
          Set the file extension of the page
 void setLayout(java.lang.Object obj)
          Set the layout manager
 void setLocation(int x, int y)
          Set the page location
 void setName(java.lang.String name)
          Set the name of the component
 void setSize(int width, int height)
          Set the page size
 void setStatus(int newStatus)
          Set the page status
 void setValidationFactory(ValidationFactory vf)
          Sets the factory used to create Validator objects
 void setVisible(boolean state)
          Set the visible state of the component
 void showComponents(java.lang.Object container, boolean visible, int recursionLevel)
          Show or hide the components.
 void showHandCursor(java.lang.Object comp)
          Show the hand/pointer cursor for this component
 void showMessage(java.lang.Object parent, java.lang.String title, java.lang.String msg)
          Shows a modal message box
 void showMessage(java.lang.String title, java.lang.String msg)
          Shows a modal message box
 java.lang.String stripAttributeValues(java.lang.String path)
          Remove the attribute paths from a path e.g.
 java.lang.String translate(java.lang.String key)
          Get the translatation refernced by the key
 void updateBinding(DataBinding binding)
          Update the bound model node for the binding.
 int updateBindings()
          Iterate all of the bindings in the page to reflect the model state.
 int updateBoundComponentValues()
          Update the UI with values from the model
 void validate()
          Validates this container and all of its subcomponents.
 int validationHandler()
          Invoke the validators for the last event.
 boolean wasMouseClicked()
          A utility method used to determine if the last event corrseponds to a mouse click.
 boolean wasMouseDoubleClicked()
          A utility method used to determine if the last event corrseponds to a mouse double click.
 boolean wasMouseRightClicked()
          A utility method used to determine if the last event corrseponds to a mouse right click.
 
Methods inherited from interface org.formaria.aria.PersistentState
restoreState, saveState
 

Field Detail

ARIA_AWT_PACKAGE

static final java.lang.String ARIA_AWT_PACKAGE
The package name for the built-in AWT component

See Also:
Constant Field Values

ARIA_SWING_PACKAGE

static final java.lang.String ARIA_SWING_PACKAGE
The package name for the built-in Swing component

See Also:
Constant Field Values

ARIA_SWT_PACKAGE

static final java.lang.String ARIA_SWT_PACKAGE
The package name for the built-in SWT components

See Also:
Constant Field Values

ARIA_HTML_PACKAGE

static final java.lang.String ARIA_HTML_PACKAGE
The package name for the built-in HTML components

See Also:
Constant Field Values

UNKNOWN

static final java.lang.String UNKNOWN
Tag for an unknown component type (not one of the built-in types)

See Also:
Constant Field Values

PANEL

static final java.lang.String PANEL
Tag for a panel

See Also:
Constant Field Values

LABEL

static final java.lang.String LABEL
Tag for a label component

See Also:
Constant Field Values

RADIO

static final java.lang.String RADIO
Tag for a radio button

See Also:
Constant Field Values

CHECK

static final java.lang.String CHECK
Tag for a checkbox

See Also:
Constant Field Values

COMBO

static final java.lang.String COMBO
Tag for a combo box or drop down list

See Also:
Constant Field Values

LIST

static final java.lang.String LIST
Tag for a list box

See Also:
Constant Field Values

IMAGE

static final java.lang.String IMAGE
Tag for an image component

See Also:
Constant Field Values

EDIT

static final java.lang.String EDIT
A single text editing field

See Also:
Constant Field Values

BUTTON

static final java.lang.String BUTTON
Tag for a push button

See Also:
Constant Field Values

METACONTENT

static final java.lang.String METACONTENT
Tag for Tagged text

See Also:
Constant Field Values

GROUP

static final java.lang.String GROUP
Tag for a radio button group

See Also:
Constant Field Values

SCROLLPANE

static final java.lang.String SCROLLPANE
Tag for a scroll pane

See Also:
Constant Field Values

SCROLLABLEMETACONTENT

static final java.lang.String SCROLLABLEMETACONTENT
Tag for a Scrollable tagged text

See Also:
Constant Field Values

HOTSPOTIMAGE

static final java.lang.String HOTSPOTIMAGE
Tag for a hotspot image

See Also:
Constant Field Values

TABLE

static final java.lang.String TABLE
Tag for a table component

See Also:
Constant Field Values

WMF

static final java.lang.String WMF
Tag for a vector image

See Also:
Constant Field Values

ANNOTATEDIMAGE

static final java.lang.String ANNOTATEDIMAGE
Deprecated. merged with imagemap
Tag for an annotated image component

See Also:
Constant Field Values

MENUBAR

static final java.lang.String MENUBAR
Tag for a menubar

See Also:
Constant Field Values

MENU

static final java.lang.String MENU
Tag for a menu

See Also:
Constant Field Values

MENUITEM

static final java.lang.String MENUITEM
Tag for a menu item

See Also:
Constant Field Values

TEXTAREA

static final java.lang.String TEXTAREA
Tag for a multiline text field

See Also:
Constant Field Values

PASSWORD

static final java.lang.String PASSWORD
Tag for a password edit field

See Also:
Constant Field Values

IMAGEMAP

static final java.lang.String IMAGEMAP
Tag for an image map

See Also:
Constant Field Values

TABPANEL

static final java.lang.String TABPANEL
Tag for a tabbed panel

See Also:
Constant Field Values

SPLITPANE

static final java.lang.String SPLITPANE
Tag for a splitter

See Also:
Constant Field Values

NULL_LAYOUT

static final int NULL_LAYOUT
ID for an NULL layout

See Also:
Constant Field Values

BORDER_LAYOUT

static final int BORDER_LAYOUT
ID for a border layout

See Also:
Constant Field Values

FLOW_LAYOUT

static final int FLOW_LAYOUT
ID for a flow layout

See Also:
Constant Field Values

CARD_LAYOUT

static final int CARD_LAYOUT
ID for a card layout

See Also:
Constant Field Values

GRID_LAYOUT

static final int GRID_LAYOUT
ID for a grid layout

See Also:
Constant Field Values

GRIDBAG_LAYOUT

static final int GRIDBAG_LAYOUT
ID for a grid bag layout

See Also:
Constant Field Values

BOX_LAYOUT

static final int BOX_LAYOUT
This type of layout simulates the Swing layout by using a GridLayout such that the layoutStyle attribute indicates vertical or horizontal layout. A layoutStyle of '0' indicates a vertical layout and any other value indicates a horizontal layout.

See Also:
Constant Field Values

SPRING_LAYOUT

static final int SPRING_LAYOUT
SpringLayout ID

See Also:
Constant Field Values

SCALE_LAYOUT

static final int SCALE_LAYOUT
ScaleLayout ID

See Also:
Constant Field Values

GUIDE_LAYOUT

static final int GUIDE_LAYOUT
GuideLayout ID

See Also:
Constant Field Values

LAYER_LAYOUT

static final int LAYER_LAYOUT
LayerLayout ID

See Also:
Constant Field Values

COLUMN_LAYOUT

static final int COLUMN_LAYOUT
ColumnLayout ID

See Also:
Constant Field Values

UNKNOWN_PAGE_STATE

static final int UNKNOWN_PAGE_STATE
The page state is unknown

See Also:
Constant Field Values

LOADED

static final int LOADED
The page has been loaded

See Also:
Constant Field Values

CREATED

static final int CREATED
The page has been created

See Also:
Constant Field Values

ACTIVATED

static final int ACTIVATED
The page has been activated

See Also:
Constant Field Values

DISPLAYED

static final int DISPLAYED
The page has been activated and displayed

See Also:
Constant Field Values

DEACTIVATED

static final int DEACTIVATED
The page has been deactivated

See Also:
Constant Field Values

DISCARDED

static final int DISCARDED
The page has been discarded

See Also:
Constant Field Values
Method Detail

getProject

Project getProject()
Get the current project, the project that owns this page

Returns:
the owner project

setBackground

void setBackground(java.awt.Color c)
Set the background color

Parameters:
c - The color

setLayout

void setLayout(java.lang.Object obj)
Set the layout manager

Parameters:
obj - the layout manager instance

doLayout

void doLayout()
Layout the page


getName

java.lang.String getName()
Get the name of the page

Returns:
the name

getExtension

java.lang.String getExtension()
Get the file extension of the page

Returns:
the file extension

setVisible

void setVisible(boolean state)
Set the visible state of the component

Parameters:
state - true to make the component visible

setClearPage

void setClearPage(boolean value)
Modify the clearPage flag. This flag determines if the default behaviour is used to update the page whereby the background is first erased and then the content painted or alternatively if the erase is suppressed.

Parameters:
value - the new flag value, true to clear

showComponents

void showComponents(java.lang.Object container,
                    boolean visible,
                    int recursionLevel)
Show or hide the components. In the AWT the heavyweight peers are created visible and paint themselves once created and therefore cause problems for page transitions.

Parameters:
recursionLevel - a counter of the recursion level
container - the container
visible - true to show the components

findComponent

java.lang.Object findComponent(java.lang.String name)
Find a named component in the container. Any child containers of the container will be searched recursively till the named component is found. The first component with a matching name will be returned.

Parameters:
name - the name to locate
Returns:
the component ornull if nothing is found

findComponent

java.lang.Object findComponent(java.lang.Object container,
                               java.lang.String name)
Find a named component in the container. Any child containers of the container will be searched recursively till the named component is found. The first component with a matching name will be returned.

Parameters:
container - the page or container to search
name - the name to locate
Returns:
the component or null if nothing is found

setName

void setName(java.lang.String name)
Set the name of the component

Parameters:
name - the new name for the page

setExtension

void setExtension(java.lang.String ext)
Set the file extension of the page

Parameters:
ext - the file extension

setExceptionHandler

void setExceptionHandler(ExceptionHandler eh)
Set the validation exception handler called when a validation exception is trapped

Parameters:
eh - the new event handler

handleException

boolean handleException(java.lang.Object comp,
                        java.lang.Exception ex,
                        java.lang.Object validator)
A method called when a validation exeption has been trapped.

Specified by:
handleException in interface ExceptionHandler
Parameters:
comp - Component being validated
ex - The exception caused
validator - The validator being used to validate.
Returns:
true to continue with error validation or false to suppress further validation.

handleEventHandlerException

boolean handleEventHandlerException(Project project,
                                    java.lang.Object container,
                                    java.lang.Throwable error)
Handle an exception during the invocation of a page's event handler. The page normally implements this interface and has the first chance at handling the error. Thereafter if false is returned a central (optional) exception handler owned by the project is invoked.

Specified by:
handleEventHandlerException in interface ExceptionHandler
Parameters:
project - the current project
container - the page
error - the exception or error that was thrown
Returns:
true to continue processing, false to stop processing

clearValidations

void clearValidations()
Reset/removes all validations


checkValidations

int checkValidations(java.lang.Object scope)
Check all validations for this page. Typically this method should be invoked prior to a page transition or a critical transaction.

Parameters:
scope - the container whose children or check, or null for all children
Returns:
the maximum error level raised by the validators

accumulateMessages

int accumulateMessages(boolean start,
                       int level)
Informs the handler when a page validation is starting or stopping. Typically when it starts the page will begin to accumulate message which are to be displayed. When the parameter is false the page will usually display the accumulated messages

Specified by:
accumulateMessages in interface ExceptionHandler
Parameters:
start - boolean to indicate whether the accumulation is started or stopped.
level - int which indicates the most serious level of error encountered
Returns:
the new level which might be set to zero if a confirm dialog is displayed

addValidation

Validator addValidation(java.lang.Object comp,
                        java.lang.String validationName,
                        java.lang.String method,
                        int mask,
                        XmlElement pageEle)
Adds a validation to this page.

Parameters:
comp - the component being validated
validationName - the name of the validation in the validation file
method - the method used to get the component's value if any
mask - the event mask used to filter the events that trigger the validation
pageEle - the XML element which is declared in the page
Returns:
the new and initialized Validator

addValidation

Validator addValidation(java.lang.Object comp,
                        java.lang.String validationName,
                        java.lang.String method)
Adds a validation to this page. It is assumed that the validation will be invoked in response to FocusEvent.FOCUS_LOST events

Parameters:
comp - the component being validated
validationName - the name of the validation in the validation file
method - the method used to get the component's value if any
Returns:
the new and initialized Validator

addValidation

Validator addValidation(java.lang.Object comp,
                        java.lang.String validationName)
Adds a validation to this page. It is assumed that the validation will be invoked in response to FocusEvent.FOCUS_LOST events

Parameters:
comp - the component being validated
validationName - the name of the validation in the validation file
Returns:
the new and initialized Validator

setValidationFactory

void setValidationFactory(ValidationFactory vf)
Sets the factory used to create Validator objects

Parameters:
vf - The validation factory

getValidationHandler

ValidationHandler getValidationHandler()
Gets the validation handler

Returns:
the validation handler

validationHandler

int validationHandler()
Invoke the validators for the last event. Multiple validations are checked in the order in which they were added.

Returns:
the maximum level returned by the validators

getEventHandler

AriaEventHandler getEventHandler()
Get the current event handler

Returns:
the event handler

setEventHandler

void setEventHandler(AriaEventHandler eh)
Set the current event handler

Parameters:
eh - The event handler

getCurrentEvent

java.util.EventObject getCurrentEvent()
Get the current event

Returns:
the AWTEvent that was last triggered

addListener

void addListener(java.lang.Object comp,
                 java.lang.String listenerName,
                 java.lang.String argType,
                 java.lang.Object listener)
Adds a listener for an event type. This method should not normally be called by an application

Parameters:
comp - the component that fires events
listenerName - the name of the listener interface
argType - the listener arguments
listener - the listener implementation

addHandler

void addHandler(java.lang.Object comp,
                long eventType,
                java.lang.String methodName)
                throws java.lang.Exception
Adds an event handler. A specific handler such as the addActionHandler should be used instead of calling this method

Parameters:
comp - the component that fires the event
eventType - the event ID/mask
methodName - the method to be invoked in response to the object
Throws:
java.lang.Exception - couldn't find or add the event handler

addHandler

void addHandler(java.lang.Object srcObj,
                java.lang.String methodName,
                java.lang.String adderMethod,
                java.lang.String listenerInterface,
                long eventMask,
                java.lang.Object listener)
Adds a handler for action events

Parameters:
srcObj - the menu item that fires the events
methodName - the method to be invoked in response to the action event
adderMethod - the adder method name e.g. addActionListener
listenerInterface - the listener interface e.g. java.awt.event.ActionListener
eventMask - the event mask e.g. AWTEvent.ACTION_EVENT_MASK
listener - the listener implementation, usually the page's this pointer
See Also:
ActionListener, ActionEvent

isFocusChangeSuppressed

boolean isFocusChangeSuppressed()
Check the focus change status

Returns:
true if the focus change events are being suppressed.

wasMouseClicked

boolean wasMouseClicked()
A utility method used to determine if the last event corrseponds to a mouse click. The notion of a click is extended by assuming the a mouse press and release within a single component constitutes a click even if not at the same coordinate. A MouseEvent.MOUSE_CLICKED is only triggered when the press and release are at the same location and this is often inadequate for end-user interaction.

Returns:
true if the mouse was clicked

wasMouseDoubleClicked

boolean wasMouseDoubleClicked()
A utility method used to determine if the last event corrseponds to a mouse double click. The notion of a click is extended by assuming the a mouse press and release within a single component constitutes a click even if not at the same coordinate. A MouseEvent.MOUSE_CLICKED is only triggered when the press and release are at the same location and this is often inadequate for end-user interaction.

Returns:
true if the mouse was double clicked

wasMouseRightClicked

boolean wasMouseRightClicked()
A utility method used to determine if the last event corrseponds to a mouse right click. The notion of a click is extended by assuming the a mouse press and release within a single component constitutes a click even if not at the same coordinate. A MouseEvent.MOUSE_CLICKED is only triggered when the press and release are at the same location and this is often inadequate for end-user interaction.

Returns:
true if the mouse was right clicked

showHandCursor

void showHandCursor(java.lang.Object comp)
Show the hand/pointer cursor for this component

Parameters:
comp - the component

getBindings

java.util.Vector getBindings()
Get the data bindings for the page

Returns:
the bindings

addBinding

void addBinding(DataBinding b)
Add a binding of a component to the data model. If the page has already been activated this method will update the binding automatically.

Parameters:
b - the binding

removeBinding

void removeBinding(DataBinding b)
Remove a binding of a component to the data model.

Parameters:
b - the binding

updateBindings

int updateBindings()
Iterate all of the bindings in the page to reflect the model state.

Returns:
non zero if errors are detected

updateBinding

void updateBinding(DataBinding binding)
Update the bound model node for the binding. First the output path is reevaluated and then updated by setting the output node. Then the source path is reevaluated and set. Evaluation of the paths allows derived classes to dynamically modify the bindings. Some bindings may save the selection or state information to the output node and subsequently use it to restore the component state. This method does not alter the data held by the bound model nodes. To actually save the data use saveBoundComponentValues and to update the UI use updateBoundComponentValues.

Parameters:
binding - the data binding to update

updateBoundComponentValues

int updateBoundComponentValues()
Update the UI with values from the model

Returns:
non zero if errors are detected

saveBoundComponentValues

int saveBoundComponentValues()
Save the component values to the model

Returns:
non zero if errors are detected

getBinding

DataBinding getBinding(java.lang.Object targetComp)
Find the data binding associated with a component

Parameters:
targetComp - the component whose binding is required
Returns:
the binding or null if no binding is found

getBinding

DataBinding getBinding(java.lang.String targetPath)
Find the data binding associated with a data source path

Parameters:
targetPath - the path to the bound model
Returns:
the binding or null if no binding is found

enterDataBindingContext

void enterDataBindingContext(java.lang.String contextName)
Gets the named DataBindingContext object bound to this PageHelper object, creating the context if necessary. The context is set as the default data binding context by this method.

Parameters:
contextName - the data binding context name

exitDataBindingContext

void exitDataBindingContext()
Exit the data binding context and return to the parent context if any

Parameters:
contextName - the data binding context name

getDataBindingContext

DataBindingContext getDataBindingContext()
Get the DataBindingContext object bound to this page

Returns:
DataBindingContext object

getDataBindingContext

DataBindingContext getDataBindingContext(java.lang.String contextName)
Gets the named DataBindingContext context

Parameters:
contextName - the name of the context
Returns:
DataBindingContext object

getStatus

int getStatus()
Get the page status

Returns:
the current status

setStatus

void setStatus(int newStatus)
Set the page status

Parameters:
newStatus - the new page status

pageActivated

void pageActivated()
A method called once the page has been created and initialized but just prior to display


pageAdded

void pageAdded()
A method called once the page has been added to its parent container but not yet displayed


pageCreated

void pageCreated()
A method called once the page has been created but not yet initialized.


pageDeactivated

void pageDeactivated()
Called when the page is about to loose scope and be hidden.


setAttribute

void setAttribute(java.lang.String attribName,
                  java.lang.String compName,
                  java.lang.Object attribValue)

Set a named attributes. The attributes are stored in a hashtable owned by the page. Derived classes may access the hashtable directly but the preferred method of access is the getAttribute method. Attributes are used by the AriaBuilder class for component attributes other than those it handles directly. The attributes can be thought of as component properties or extra data and need not be used directly by the component.

Attributes are stored using a key in the form attribName_compName or just the attribName if compName is null.

Parameters:
attribName - the attribute name
compName - the component name or null if it is a page attribute
attribValue - the attribute value
See Also:
getAttribute(java.lang.String)

getAttribute

java.lang.Object getAttribute(java.lang.String attribName)
Gets an attribute value

Parameters:
attribName - the name of the attribute
Returns:
the value

getAttribute

java.lang.Object getAttribute(java.lang.String attribName,
                              java.lang.String compName)
Gets an attribute value

Parameters:
attribName - the name of the attribute
compName - the component name
Returns:
the value

getComponentName

java.lang.String getComponentName(java.lang.Object comp)
Get a name for a component. If the component doesn't have one use the component hashcode

Parameters:
comp - the component
Returns:
the name

getEventAttribute

java.lang.Object getEventAttribute(java.lang.Object c,
                                   java.lang.String attribName)
Gets an attribute value belonging to a component

Parameters:
c - the component/container
attribName - the name of the attribute
Returns:
the value

evaluateAttribute

java.lang.Object evaluateAttribute(java.lang.String attribValue)
Evaluates an attribute value. An attribute may be a value or a method call. If brackets are part of the value it is assumed that a method call is intended. The method call is indicated by the '$' symbol e.g. ${myMethod()}

Parameters:
attribValue - the raw attribute value
Returns:
the evaluated attribute

evaluatePath

java.lang.String evaluatePath(java.lang.String path)
Evaluates a path (potentially) containing a method call

Parameters:
path - the raw path
Returns:
the evaluated path

stripAttributeValues

java.lang.String stripAttributeValues(java.lang.String path)
Remove the attribute paths from a path e.g. remove @value=ignore

Parameters:
path - the path to strip
Returns:
the stripped path

getComponentFactory

ComponentFactory getComponentFactory()
Get the component factory instance being used by this page.

Returns:
the component factory

setComponentFactory

void setComponentFactory(StyleFactory factory)
Set the component factory instance being used by this page when constructing new pages.

Parameters:
factory - the component factory used for component creation

translate

java.lang.String translate(java.lang.String key)
Get the translatation refernced by the key

Parameters:
key - the language string lookup key
Returns:
The translated text

showMessage

void showMessage(java.lang.String title,
                 java.lang.String msg)
Shows a modal message box

Parameters:
title - the message dialog title
msg - the text of the message

showMessage

void showMessage(java.lang.Object parent,
                 java.lang.String title,
                 java.lang.String msg)
Shows a modal message box

Parameters:
parent - the message dialog parent
title - the message dialog title
msg - the text of the message

validate

void validate()
Validates this container and all of its subcomponents.


getOwner

java.lang.Object getOwner()
Get the parent

Returns:
The owner container

getPageSize

java.awt.Dimension getPageSize()
Get the size

Returns:
The page's dimensions

setSize

void setSize(int width,
             int height)
Set the page size

Parameters:
width - the new page width
height - the new page height

setLocation

void setLocation(int x,
                 int y)
Set the page location

Parameters:
x - the new page's left edge coordinate
y - the new page's top coordinate

addNestedPage

void addNestedPage(PageSupport ps)
Add a nested page reference

Parameters:
ps - the nested page