at.spardat.xma.mdl.list
Class ListDomWMClient

java.lang.Object
  extended byat.spardat.xma.mdl.WModel
      extended byat.spardat.xma.mdl.list.ListDomWM
          extended byat.spardat.xma.mdl.list.ListDomWMClient
All Implemented Interfaces:
Descriptive, IListDomWM, IListDomWMClient, ISelectable, IWModelClient, Synchronization, Transactional

public class ListDomWMClient
extends ListDomWM
implements IListDomWMClient

Implementation of IListDomWMClient.


Field Summary
 
Fields inherited from class at.spardat.xma.mdl.WModel
S_NULL
 
Fields inherited from interface at.spardat.xma.mdl.list.IListDomWMClient
MANDATORY, ORDER_LONG, ORDER_NATURAL, ORDER_SHORT, SHOW_LONG, SHOW_SHORT, SHOW_SHORT_LONG
 
Constructor Summary
ListDomWMClient(short id, Page pm, java.lang.String dataSource, int style)
          Constructs with a provided data source.
 
Method Summary
 int getOrderStyle()
          Returns one of the SHOW_* constants.
 PageClient getPageModelC()
          Returns the PageClient this WidgetModelC belongs to.
 int getShowStyle()
          Returns one of the ORDER_* constants.
 UIDelegateClient getUIDelegate()
          Returns the attached UIDelegateClient.
 boolean handle(ModelChangeEvent event)
          All events that might change a WidgetModel are executed via this method.
 boolean isEditable()
          Returns true if this model's widget may be modified by the end-user.
 boolean isEnabled()
          Returns true, if this model's widget is enabled.
 boolean isMandatory()
          Returns true if the MANDATORY style has been set at construction time
 boolean isShowLongValueAsTooltips_()
          Returns if the selected long value should be shown as tooltip.
 void setEditable(boolean what)
          Sets the editable-state of this models's widget.
 void setEnabled(boolean what)
          Sets the enabled-state of this model's widget.
 void setMandatory(boolean what)
          Sets the mandatory-property.
 void setOrderStyle(int orderStyle)
          Sets the style that determines the sort order.
 void setShowLongValueToolTips()
          Changes the behaviour of the combo box to show the long values of the selected value as tooltips, instead of the value entered in the UI-designer.
 void setShowStyle(int showStyle)
          Sets the style that drives what is shown in the combo box.
 
Methods inherited from class at.spardat.xma.mdl.list.ListDomWM
changed, clear, commit, describe, deselect, deselectAll, equalsCS, estimateMemory, externalize, getDataSource, getPage, getSelected, getSelection, getSelectionCount, internalize, isDynamicDataSource, isMultiSelect, isSelected, isStrict, randomlyChange, rollback, select, setDataSource, setDynamicDataSource
 
Methods inherited from class at.spardat.xma.mdl.WModel
cleanUpAfterServerEvent, getId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface at.spardat.xma.mdl.list.IListDomWM
getDataSource, isDynamicDataSource, setDataSource
 
Methods inherited from interface at.spardat.xma.mdl.ISelectable
deselect, deselectAll, getSelected, getSelection, getSelectionCount, isMultiSelect, isSelected, isStrict, select
 

Constructor Detail

ListDomWMClient

public ListDomWMClient(short id,
                       Page pm,
                       java.lang.String dataSource,
                       int style)
Constructs with a provided data source.

Parameters:
id - a numeric id which identifies the WidgetModel within its Page.
pm - reference to the enclosing Page
dataSource - specifies a tabular data source
style - one of the SHOW_-constants or MANDATORY defined in IListDomWMClient.
Throws:
java.lang.IllegalArgumentException - if dataSource is null or empty.
Method Detail

setShowStyle

public void setShowStyle(int showStyle)
Sets the style that drives what is shown in the combo box. This method also determines the sort order. SHOW_LONG implies ORDER_LONG and SHOW_SHORT_LONG implies ORDER_SHORT.

This set method may only be called after construction. Calling it later won't effect the visual appearance of the combo.

Parameters:
showStyle - must be either SHOW_LONG or SHOW_SHORT_LONG. If non of these style is set, this method does nothing.

setOrderStyle

public void setOrderStyle(int orderStyle)
Sets the style that determines the sort order.

This method may only be called after construction. Calling it later won't affect the visual appearance of the combo.

Parameters:
orderStyle - may be ORDER_LONG, ORDER_SHORT or ORDER_NATURAL.

getOrderStyle

public int getOrderStyle()
Description copied from interface: IListDomWMClient
Returns one of the SHOW_* constants.

Specified by:
getOrderStyle in interface IListDomWMClient
See Also:
IListDomWMClient.getOrderStyle()

getShowStyle

public int getShowStyle()
Description copied from interface: IListDomWMClient
Returns one of the ORDER_* constants.

Specified by:
getShowStyle in interface IListDomWMClient
See Also:
IListDomWMClient.getShowStyle()

isMandatory

public boolean isMandatory()
Description copied from interface: IListDomWMClient
Returns true if the MANDATORY style has been set at construction time

Specified by:
isMandatory in interface IListDomWMClient
See Also:
IListDomWMClient.isMandatory()

setMandatory

public void setMandatory(boolean what)
Description copied from interface: IListDomWMClient
Sets the mandatory-property.

Specified by:
setMandatory in interface IListDomWMClient
Parameters:
what - the new value of the mandatory-value
See Also:
IListDomWMClient.setMandatory(boolean)

getUIDelegate

public UIDelegateClient getUIDelegate()
Description copied from interface: IWModelClient
Returns the attached UIDelegateClient.

Specified by:
getUIDelegate in interface IWModelClient
Returns:
the UIDelegateClient which never is null.
See Also:
IWModelClient.getUIDelegate()

handle

public boolean handle(ModelChangeEvent event)
Description copied from class: WModel
All events that might change a WidgetModel are executed via this method.

Overrides:
handle in class ListDomWM
See Also:
WModel.handle(at.spardat.xma.mdl.ModelChangeEvent)

getPageModelC

public PageClient getPageModelC()
Returns the PageClient this WidgetModelC belongs to.

Returns:
PageClient, never null.

isEditable

public boolean isEditable()
Description copied from interface: IWModelClient
Returns true if this model's widget may be modified by the end-user. Returns false, if the widget may not be edited, but the content of the widget should be readable and receive focus.

Specified by:
isEditable in interface IWModelClient
See Also:
IWModelClient.isEditable()

isEnabled

public boolean isEnabled()
Description copied from interface: IWModelClient
Returns true, if this model's widget is enabled. Returns false, if it is disabled. A disabled control is displayed in a greyed look and does not receive focus.

Specified by:
isEnabled in interface IWModelClient
See Also:
IWModelClient.isEnabled()

setEditable

public void setEditable(boolean what)
Description copied from interface: IWModelClient
Sets the editable-state of this models's widget. A widget which is not editable can not be modified by the end user. Unlike the disabled-state, its contents remains readable and still receives focus.

Usually, this method is called on all widget-models of a page to set the whole page to a read-only mode.

If this method is not called, the default is true.

Specified by:
setEditable in interface IWModelClient
Parameters:
what - true if the model's widget should be editable, false otherwise.
See Also:
IWModelClient.setEditable(boolean)

setEnabled

public void setEnabled(boolean what)
Description copied from interface: IWModelClient
Sets the enabled-state of this model's widget.

Specified by:
setEnabled in interface IWModelClient
Parameters:
what - the state to set.
See Also:
IWModelClient.setEnabled(boolean)

isShowLongValueAsTooltips_

public boolean isShowLongValueAsTooltips_()
Returns if the selected long value should be shown as tooltip.


setShowLongValueToolTips

public void setShowLongValueToolTips()
Description copied from interface: IListDomWMClient
Changes the behaviour of the combo box to show the long values of the selected value as tooltips, instead of the value entered in the UI-designer.

Specified by:
setShowLongValueToolTips in interface IListDomWMClient
See Also:
IListDomWMClient.setShowLongValueToolTips()