org.xulux.api.core
Interface IPart


public interface IPart

Version:
$Id: $
Author:
Martin van den Bemt

Method Summary
 void activate()
          Activates the part Which means setting starting rule processing The defaultrule should initialize the view.
 void addWidget(IWidget widget)
          Add the specified widget to the part
 void addWidget(IWidget widget, IWidget parent)
          Add a widget to the specified parent..
 void destroy()
          Destroys the applicationPart (does a lot of cleanups) After the destroy the object is not usable anymore.
 java.lang.Object getBean()
           
 IXuluxListener getFieldEventHandler(IWidget widget)
          Returns a new instance of the fieldEventHandler.
 java.lang.Object getGuiValue(java.lang.String widgetName)
           
 IInvalidValueStrategy getInvalidValueStrategy()
           
 java.lang.String getName()
           
 IPart getParentPart()
           
 java.lang.String getProvider()
           
 java.lang.Object getRootWidget()
          If the root widget is null, the part is contained in itself
 java.util.List getRules()
           
 ISession getSession()
           
 IWidget getWidget(java.lang.String widgetName)
           
 java.util.List getWidgets()
           
 void initialize(java.lang.Object caller)
          NOTE : Is actually not doing anything Initialize the part, which makes the gui visible, processes fields, etc.
 boolean isActivating()
           
 boolean isPartDestroyed()
           
 boolean needToStopAllRules(java.lang.Object caller)
          Checks to see if all rules should stop processing.
 void refreshAllWidgets()
          Refreshes all widgets
 void refreshFields(IWidget widget)
          Refreshes all fields that reference the field used by the passed in widget When field is null nothing will be done.
 void refreshWidgets(IWidget caller)
          Refreshes widgets which have a pointer to the caller in their use.
 void removeWidget(IWidget widget, java.lang.Object caller)
          Removes a widget.
 void setGuiValue(java.lang.String name, java.lang.Object value)
          Set the gui value
 void setInvalidValueStrategy(java.lang.String strategy)
           
 void setName(java.lang.String name)
          Set the name
 void setParentPart(IPart part)
          Set the parent part.
 void setParentWidget(java.lang.Object widget)
          The parent widget for all child widgets to be added
 void updateDependandWidgets(IWidget widget)
          Updates the widgets that depends on the widget passed in.
 

Method Detail

getWidgets

java.util.List getWidgets()
Returns:
the widgets of this part

getName

java.lang.String getName()
Returns:
the name

setName

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

Parameters:
name - the name

getSession

ISession getSession()

getGuiValue

java.lang.Object getGuiValue(java.lang.String widgetName)
Parameters:
widgetName - the name of the widget to get the value from
Returns:
the current value of the specified field

getWidget

IWidget getWidget(java.lang.String widgetName)
Parameters:
widgetName - the name of the widget to get.
Returns:
the widget that is connected to the field, null if not found or no widgets are present.

addWidget

void addWidget(IWidget widget)
Add the specified widget to the part

Parameters:
widget - the widget to add

destroy

void destroy()
Destroys the applicationPart (does a lot of cleanups) After the destroy the object is not usable anymore. Maybe a lot of unecessary code, but you never know when swing stuff still stays in memory..


getRules

java.util.List getRules()
Returns:
the part rules

needToStopAllRules

boolean needToStopAllRules(java.lang.Object caller)
Checks to see if all rules should stop processing.

Parameters:
caller - the caller of needToStopAllRules. This prevents the applicationcontext from stopping all rules.
Returns:
true if all rules need to be stopped

refreshAllWidgets

void refreshAllWidgets()
Refreshes all widgets


getBean

java.lang.Object getBean()
Returns:
the plain bean

removeWidget

void removeWidget(IWidget widget,
                  java.lang.Object caller)
Removes a widget. It will call the destroy method on the widget and if the widget is calling this, it will remove it from the application part widget registry. TODO : this method should automatically be called

Parameters:
widget - the widget to remove.
caller - - the caller of the object. Always pass this.

initialize

void initialize(java.lang.Object caller)
NOTE : Is actually not doing anything Initialize the part, which makes the gui visible, processes fields, etc. Can only be called from the DefaultPartRule

Parameters:
caller - - the caller

getRootWidget

java.lang.Object getRootWidget()
If the root widget is null, the part is contained in itself

Returns:
null when the part is standalone, else the rootwidget (which is normally a native widget!

setGuiValue

void setGuiValue(java.lang.String name,
                 java.lang.Object value)
Set the gui value

Parameters:
name - the widget name
value - the value to set

getProvider

java.lang.String getProvider()
Returns:
the provider name

getParentPart

IPart getParentPart()
Returns:
the parentpart or null when there is none

getInvalidValueStrategy

IInvalidValueStrategy getInvalidValueStrategy()
Returns:
the invalidvalue strategy

refreshFields

void refreshFields(IWidget widget)
Refreshes all fields that reference the field used by the passed in widget When field is null nothing will be done.

Parameters:
widget - the widget to refresh the fields for

updateDependandWidgets

void updateDependandWidgets(IWidget widget)
Updates the widgets that depends on the widget passed in.

Parameters:
widget - the widget that other depends on

refreshWidgets

void refreshWidgets(IWidget caller)
Refreshes widgets which have a pointer to the caller in their use.

Parameters:
caller - the caller of refreshwidgets (normally pass in this)

getFieldEventHandler

IXuluxListener getFieldEventHandler(IWidget widget)
Returns a new instance of the fieldEventHandler. You can override this in the applicationpart xml by adding the listener tag with the class specified.

Parameters:
widget - the widget to get the fieldeventhandler for
Returns:
PrePostFieldListener

isActivating

boolean isActivating()
Returns:
if the part is currently activating or not

activate

void activate()
Activates the part Which means setting starting rule processing The defaultrule should initialize the view.


setParentPart

void setParentPart(IPart part)
Set the parent part. This way a part knows that the bean provided should be passed to the parent.

Parameters:
part - the applicationpart that serves as a parent

setInvalidValueStrategy

void setInvalidValueStrategy(java.lang.String strategy)
Parameters:
strategy - the name of the strategy to use or the class of the strategy

setParentWidget

void setParentWidget(java.lang.Object widget)
The parent widget for all child widgets to be added

Parameters:
widget - the widget to set the parent for

addWidget

void addWidget(IWidget widget,
               IWidget parent)
Add a widget to the specified parent..

Parameters:
widget - the widget to add
parent - the parent of the widget.

isPartDestroyed

boolean isPartDestroyed()
Returns:
if the part has been destroyed


Copyright © 2002-2007 Martin van den Bemt. All Rights Reserved.