com.cc.framework.ui.model.imp
Class ListDesignModelImp

java.lang.Object
  extended bycom.cc.framework.ui.model.imp.ClientHandlerImp
      extended bycom.cc.framework.ui.model.imp.ControlDesignModelImp
          extended bycom.cc.framework.ui.model.imp.ListDesignModelImp
All Implemented Interfaces:
AccessControlled, ActionBehavior, AjaxSupport, ButtonContainer, ClientHandler, ColumnContainer, ControlDesignModel, DesignModel, FrameContainer, ListDesignModel, ScrollSupport, java.io.Serializable
Direct Known Subclasses:
TreelistDesignModelImp

public class ListDesignModelImp
extends ControlDesignModelImp
implements ListDesignModel

Designmodel for the ListControl

Since:
1.0
Version:
$Revision: 1.36 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  ButtonContainer buttons
          The users permission which is necessary to see any buttons
private  int cellPadding
          Cell padding factor (-1 = Painter default)
private  int cellSpacing
          Cell spacing factor (-1 = Painter default)
private  ColumnContainer columns
          The buffer with the columns of the list control
private  java.lang.String emptyText
          Text to display if a empty list is shown.
private  java.util.ArrayList frames
          Inner Frames
private  int headerHeight
          The height of the header.
private  ImageModel image
          The optional title image
private  int minRowCount
          Number of minimal displayed lines
private  int pageButtons
          The number of paging buttons to show
private  int rowCount
          Number of displayed lines.
private  int rowHeight
          Height of a row.
private  java.lang.String scrollHeight
          The height of the scroll container
private  SelectMode selectMode
          The selection mode for optional checkboxes.
private static long serialVersionUID
          Serial Version UID
private  boolean showFrame
          Enables or disables the lists frame
private  boolean showHeader
          This flag indicates if the header should be painted
private  OrientationType tabOrientation
          Specifies the tabulator orientation
private  java.lang.String title
          The caption of the listcontrol
 
Fields inherited from class com.cc.framework.ui.model.imp.ControlDesignModelImp
 
Fields inherited from class com.cc.framework.ui.model.imp.ClientHandlerImp
 
Constructor Summary
ListDesignModelImp()
          Constructor for ListDesignModelImp
 
Method Summary
 void addColumn(ColumnDesignModel column)
          Adds a new column definition to the ListControl
 void addInnerFrame(InnerFrame frame)
          Adds a inner frame to the List
 Permission getButtonPermission(ControlButton button)
          Retrieves the permission for the given button
 int getCellPadding()
          Returns the cell padding for the list cells
 int getCellSpacing()
          Returns the cell spacing for the list cells
 ColumnDesignModel getColumn(int index)
          Returns the column with the given index
 ColumnDesignModel[] getColumns()
          Returns an array with all column definitions
 java.lang.String getEmptyText()
          A text that is output in the body of the list element if there are no lines available
 int getHeaderHeight()
          Returns the height of the header (pixel)
 ImageModel getImage()
          Returns the image for the frames title
 InnerFrame[] getInnerFrames(Principal principal, java.lang.Object layoutHint)
          Retrieves a list of only the inner frames that are matching the given layout hint
 int getMinRowCount()
          Returns the minimal number of rows which should be displayed(rendered) by the control.
 int getPageButtons()
          Returns the number of page buttons to displayed.
 int getRowCount()
          Returns the number of rows which should be displayed(rendered) by the control.
 int getRowHeight()
          Returns the height of a row (pixel)
 java.lang.String getScrollHeight()
          Returns the height of the scroll container
 SelectMode getSelectMode()
          Specifies the selection mode of the list.
 OrientationType getTabOrientation()
          Retrieves the tabulator orientation
 java.lang.String getTitle()
          Returns the Title
 void removeColumn(ColumnDesignModel column)
          Removes a column
 void setButtonPermission(ControlButton button, Permission permission)
          Sets whether a command button should be displayed by specifying an Access Control List.
 void setCellPadding(int padding)
          Sets the cell padding for the list cells
 void setCellSpacing(int spacing)
          Sets the cell spacing for the list cells
 void setCreateButtonPermission(Permission permission)
          Deprecated. use setButtonPermission(ControlButton.CREATE, permission)
 void setEmptyText(java.lang.String emptyText)
          Sets the text that is output in the body of the list element if there are no lines available
 void setImage(ImageModel img)
          Sets an image for the frames title
 void setMinRowCount(int rows)
          This attribute is used to specify the minimum number of lines that are depicted simultaneously.
 void setPageButtons(int buttons)
          Specifies the number of buttons that should be displayed for direct page navigation.
 void setRefreshButtonPermission(Permission permission)
          Deprecated. use setButtonPermission(ControlButton.REFRESH, permission)
 void setRowCount(int rows)
          This attribute is used to specify the maximum number of lines that are depicted simultaneously.
 void setScrollHeight(java.lang.String height)
          Sets the height of the scroll container
 void setSelectMode(SelectMode mode)
          Sets the selection mode of the list.
 void setShowFrame(boolean show)
          Disables the lists frame
 void setShowHeader(boolean showHeader)
          This flag allows to hide the header within the list.
 void setTabOrientation(OrientationType orientation)
          Specifies the tabulator orientation: horizontal = from top to bottom vertical = from left to right
 void setTitle(java.lang.String title)
          Sets the title of the ListControl which is display in the Header
 boolean showButton(ControlButton button, Principal principal)
          Checks if the button can be displayed.
 boolean showCreateButton(Principal principal)
          Deprecated. use showButton(ControlButton.CREATE, principal)
 boolean showFrame()
           
 boolean showHeader()
          Returns if the header of the control is suppressed
 boolean showRefreshButton(Principal principal)
          Deprecated. use showButton(ControlButton.REFRESH, principal)
 int size()
          Returns the number of columns
 
Methods inherited from class com.cc.framework.ui.model.imp.ControlDesignModelImp
addDesignRule, enableAjax, getAction, getBorder, getDesignRules, getHeight, getHelp, getId, getLocaleName, getName, getPermission, getProperty, getRunAt, getStyle, getStyleClass, getStyleId, getSummary, getTabIndex, getTooltip, getTransaction, getWidth, hasShadow, isAjaxEnabled, isDisabled, isDynamicDesignModel, isFormElement, setAction, setBorder, setDisabled, setDynamicDesignModel, setFormElement, setHeight, setHelp, setId, setLocaleName, setName, setPermission, setProperty, setRunAt, setShadow, setStyle, setStyleClass, setStyleId, setSummary, setTabIndex, setTooltip, setTransaction, setWidth, show
 
Methods inherited from class com.cc.framework.ui.model.imp.ClientHandlerImp
evaluate, getHandler, getHandlers, setHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cc.framework.ui.model.ControlDesignModel
addDesignRule, getAction, getBorder, getDesignRules, getHeight, getHelp, getId, getLocaleName, getName, getProperty, getRunAt, getStyle, getStyleClass, getStyleId, getSummary, getTabIndex, getTooltip, getTransaction, getWidth, hasShadow, isDisabled, isDynamicDesignModel, isFormElement, setAction, setBorder, setDisabled, setDynamicDesignModel, setFormElement, setHeight, setHelp, setId, setLocaleName, setName, setPermission, setProperty, setRunAt, setShadow, setStyle, setStyleClass, setStyleId, setSummary, setTabIndex, setTooltip, setTransaction, setWidth
 
Methods inherited from interface com.cc.framework.ui.model.ClientHandler
getHandler, getHandlers, setHandler
 
Methods inherited from interface com.cc.framework.ui.model.AccessControlled
getPermission, show
 
Methods inherited from interface com.cc.framework.ui.model.ActionBehavior
isAjaxEnabled
 
Methods inherited from interface com.cc.framework.ui.model.AjaxSupport
enableAjax, isAjaxEnabled
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

rowCount

private int rowCount
Number of displayed lines. The default value is -1 which displays all lines.


minRowCount

private int minRowCount
Number of minimal displayed lines


headerHeight

private int headerHeight
The height of the header. Default is 24px


rowHeight

private int rowHeight
Height of a row. Default is 20px


cellSpacing

private int cellSpacing
Cell spacing factor (-1 = Painter default)


cellPadding

private int cellPadding
Cell padding factor (-1 = Painter default)


title

private java.lang.String title
The caption of the listcontrol


emptyText

private java.lang.String emptyText
Text to display if a empty list is shown. The default text is "no items in list".


scrollHeight

private java.lang.String scrollHeight
The height of the scroll container


selectMode

private SelectMode selectMode
The selection mode for optional checkboxes.


buttons

private ButtonContainer buttons
The users permission which is necessary to see any buttons


pageButtons

private int pageButtons
The number of paging buttons to show


columns

private ColumnContainer columns
The buffer with the columns of the list control


showFrame

private boolean showFrame
Enables or disables the lists frame


image

private ImageModel image
The optional title image


showHeader

private boolean showHeader
This flag indicates if the header should be painted


tabOrientation

private OrientationType tabOrientation
Specifies the tabulator orientation


frames

private java.util.ArrayList frames
Inner Frames

Constructor Detail

ListDesignModelImp

public ListDesignModelImp()
Constructor for ListDesignModelImp

Method Detail

getRowCount

public int getRowCount()
Description copied from interface: ListDesignModel
Returns the number of rows which should be displayed(rendered) by the control. If the data model has more rows then specified. The buttons for navigation (prev page, next page..) are displayed.

Specified by:
getRowCount in interface ListDesignModel
Returns:
Number of rows to display (render). If set to -1 all rows were rendered.
See Also:
ListDesignModel.getRowCount()

setMinRowCount

public void setMinRowCount(int rows)
Description copied from interface: ListDesignModel
This attribute is used to specify the minimum number of lines that are depicted simultaneously. When the total number of available lines in the data model is lower than the number of lines displayed, empty lines are appended to the list. If this attribute is set to -1, no empty lines will be generated.

Specified by:
setMinRowCount in interface ListDesignModel
Parameters:
rows - Number of lines
See Also:
ListDesignModel.setMinRowCount(int)

getMinRowCount

public int getMinRowCount()
Description copied from interface: ListDesignModel
Returns the minimal number of rows which should be displayed(rendered) by the control. If the data model has less rows then specified the control will be filled with empty lines.

Specified by:
getMinRowCount in interface ListDesignModel
Returns:
Number of minimal rows to display (render). If set to -1 no empty lines will be added.
See Also:
ListDesignModel.getMinRowCount()

setRowCount

public void setRowCount(int rows)
Description copied from interface: ListDesignModel
This attribute is used to specify the maximum number of lines that are depicted simultaneously. When the total number of available lines in the data model is greater than the number of lines displayed, scrollbars are automatically generated for slowly scrolling through pages. If this attribute is set to -1, all lines are always displayed.

Specified by:
setRowCount in interface ListDesignModel
Parameters:
rows - Number of lines
See Also:
ListDesignModel.setRowCount(int)

getTitle

public java.lang.String getTitle()
Description copied from interface: ListDesignModel
Returns the Title

Specified by:
getTitle in interface ListDesignModel
Returns:
Title
See Also:
ListDesignModel.getTitle()

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: ListDesignModel
Sets the title of the ListControl which is display in the Header

Specified by:
setTitle in interface ListDesignModel
Parameters:
title - The main title of the control
See Also:
ListDesignModel.setTitle(String)

getEmptyText

public java.lang.String getEmptyText()
Description copied from interface: ListDesignModel
A text that is output in the body of the list element if there are no lines available

Specified by:
getEmptyText in interface ListDesignModel
Returns:
message text for empty list elements
See Also:
ListDesignModel.getEmptyText()

setEmptyText

public void setEmptyText(java.lang.String emptyText)
Description copied from interface: ListDesignModel
Sets the text that is output in the body of the list element if there are no lines available

Specified by:
setEmptyText in interface ListDesignModel
Parameters:
emptyText - The text that is output in the body of the list element if there are no lines available
See Also:
ListDesignModel.setEmptyText(String)

addColumn

public void addColumn(ColumnDesignModel column)
Description copied from interface: ColumnContainer
Adds a new column definition to the ListControl

Specified by:
addColumn in interface ColumnContainer
Parameters:
column - The column definition to add
See Also:
ColumnContainer.addColumn(com.cc.framework.ui.model.ColumnDesignModel)

getColumns

public ColumnDesignModel[] getColumns()
Description copied from interface: ColumnContainer
Returns an array with all column definitions

Specified by:
getColumns in interface ColumnContainer
Returns:
array of ColumnDesignModels
See Also:
ColumnContainer.getColumns()

getColumn

public ColumnDesignModel getColumn(int index)
Description copied from interface: ColumnContainer
Returns the column with the given index

Specified by:
getColumn in interface ColumnContainer
Parameters:
index - column index
Returns:
ColumnDesignModel
See Also:
ColumnContainer.getColumn(int)

removeColumn

public void removeColumn(ColumnDesignModel column)
Description copied from interface: ColumnContainer
Removes a column

Specified by:
removeColumn in interface ColumnContainer
Parameters:
column - The column to remove
See Also:
ColumnContainer.removeColumn(com.cc.framework.ui.model.ColumnDesignModel)

size

public int size()
Description copied from interface: ColumnContainer
Returns the number of columns

Specified by:
size in interface ColumnContainer
Returns:
int The number of columns
See Also:
ColumnContainer.size()

getHeaderHeight

public int getHeaderHeight()
Description copied from interface: ListDesignModel
Returns the height of the header (pixel)

Specified by:
getHeaderHeight in interface ListDesignModel
Returns:
The height of the header
See Also:
ListDesignModel.getHeaderHeight()

getRowHeight

public int getRowHeight()
Description copied from interface: ListDesignModel
Returns the height of a row (pixel)

Specified by:
getRowHeight in interface ListDesignModel
Returns:
The height of the row
See Also:
ListDesignModel.getRowHeight()

getSelectMode

public SelectMode getSelectMode()
Description copied from interface: ListDesignModel
Specifies the selection mode of the list. This is only used if a Check column is to be displayed here as well.

Specified by:
getSelectMode in interface ListDesignModel
Returns:
SelectMode
See Also:
ListDesignModel.getSelectMode()

setSelectMode

public void setSelectMode(SelectMode mode)
Description copied from interface: ListDesignModel
Sets the selection mode of the list.

Specified by:
setSelectMode in interface ListDesignModel
Parameters:
mode - the selection mode
See Also:
ListDesignModel.setSelectMode(SelectMode)

getButtonPermission

public Permission getButtonPermission(ControlButton button)
Description copied from interface: ButtonContainer
Retrieves the permission for the given button

Specified by:
getButtonPermission in interface ButtonContainer
Parameters:
button - Button constant
Returns:
Permission or null
See Also:
ButtonContainer.getButtonPermission(com.cc.framework.ui.control.ControlButton)

showButton

public boolean showButton(ControlButton button,
                          Principal principal)
Description copied from interface: ButtonContainer
Checks if the button can be displayed.

Specified by:
showButton in interface ButtonContainer
Parameters:
button - The Button to query
principal - The principal object
Returns:
boolean true if the button should be displayed
See Also:
ButtonContainer.showButton(com.cc.framework.ui.control.ControlButton, com.cc.framework.security.Principal)

setButtonPermission

public void setButtonPermission(ControlButton button,
                                Permission permission)
Description copied from interface: ButtonContainer
Sets whether a command button should be displayed by specifying an Access Control List.

Specified by:
setButtonPermission in interface ButtonContainer
Parameters:
button - The Button to query
permission - Permission
See Also:
ButtonContainer.setButtonPermission(com.cc.framework.ui.control.ControlButton, com.cc.framework.security.Permission)

showRefreshButton

public boolean showRefreshButton(Principal principal)
Deprecated. use showButton(ControlButton.REFRESH, principal)

Checks if the refresh button can be displayed.

Parameters:
principal - The principal object
Returns:
boolean true if the button should be displayed

setRefreshButtonPermission

public void setRefreshButtonPermission(Permission permission)
Deprecated. use setButtonPermission(ControlButton.REFRESH, permission)

Specifies whether a button should be displayed for updating the elements. The list of permissions is set to specifies when the button should be display.

Parameters:
permission - Permission

showCreateButton

public boolean showCreateButton(Principal principal)
Deprecated. use showButton(ControlButton.CREATE, principal)

Checks if the create button can be displayed.

Parameters:
principal - The principal object
Returns:
boolean true if the button should be displayed

setCreateButtonPermission

public void setCreateButtonPermission(Permission permission)
Deprecated. use setButtonPermission(ControlButton.CREATE, permission)

Sets whether a button for creating a new data record should be displayed. By specifying an Access Control List, the creation of new records can be restricted to certain users.

Parameters:
permission - Permission

getPageButtons

public int getPageButtons()
Description copied from interface: ListDesignModel
Returns the number of page buttons to displayed.

Specified by:
getPageButtons in interface ListDesignModel
Returns:
number of page buttons
See Also:
ListDesignModel.getPageButtons()

setPageButtons

public void setPageButtons(int buttons)
Description copied from interface: ListDesignModel
Specifies the number of buttons that should be displayed for direct page navigation.

Specified by:
setPageButtons in interface ListDesignModel
Parameters:
buttons - Button count
See Also:
ListDesignModel.setPageButtons(int)

setShowFrame

public void setShowFrame(boolean show)
Description copied from interface: ListDesignModel
Disables the lists frame

Specified by:
setShowFrame in interface ListDesignModel
Parameters:
show - true if the lists frame should be shown
See Also:
ListDesignModel.setShowFrame(boolean)

showFrame

public boolean showFrame()
Specified by:
showFrame in interface ListDesignModel
Returns:
true if the frame should be shown
See Also:
ListDesignModel.showFrame()

showHeader

public boolean showHeader()
Description copied from interface: ListDesignModel
Returns if the header of the control is suppressed

Specified by:
showHeader in interface ListDesignModel
Returns:
false if the header of the control is suppressed; true otherwise.
See Also:
ListDesignModel.showHeader()

setShowHeader

public void setShowHeader(boolean showHeader)
Description copied from interface: ListDesignModel
This flag allows to hide the header within the list. Default is true.

Specified by:
setShowHeader in interface ListDesignModel
Parameters:
showHeader - If set to false the header of the control will be suppressed
See Also:
ListDesignModel.setShowHeader(boolean)

getCellPadding

public int getCellPadding()
Description copied from interface: ListDesignModel
Returns the cell padding for the list cells

Specified by:
getCellPadding in interface ListDesignModel
Returns:
Padding factor
See Also:
ListDesignModel.getCellPadding()

getCellSpacing

public int getCellSpacing()
Description copied from interface: ListDesignModel
Returns the cell spacing for the list cells

Specified by:
getCellSpacing in interface ListDesignModel
Returns:
spacing factor
See Also:
ListDesignModel.getCellSpacing()

setCellPadding

public void setCellPadding(int padding)
Description copied from interface: ListDesignModel
Sets the cell padding for the list cells

Specified by:
setCellPadding in interface ListDesignModel
Parameters:
padding - Padding factor
See Also:
ListDesignModel.setCellPadding(int)

setCellSpacing

public void setCellSpacing(int spacing)
Description copied from interface: ListDesignModel
Sets the cell spacing for the list cells

Specified by:
setCellSpacing in interface ListDesignModel
Parameters:
spacing - Spacing factor
See Also:
ListDesignModel.setCellSpacing(int)

addInnerFrame

public void addInnerFrame(InnerFrame frame)
Description copied from interface: FrameContainer
Adds a inner frame to the List

Specified by:
addInnerFrame in interface FrameContainer
Parameters:
frame - the inner frame to add
See Also:
FrameContainer.addInnerFrame(com.cc.framework.ui.model.InnerFrame)

getInnerFrames

public InnerFrame[] getInnerFrames(Principal principal,
                                   java.lang.Object layoutHint)
Description copied from interface: FrameContainer
Retrieves a list of only the inner frames that are matching the given layout hint

Specified by:
getInnerFrames in interface FrameContainer
Parameters:
principal - The principal object for permission tests. This parameter can be null
layoutHint - The layout hint that specifies what frames should be selected: AlignmentType.TOP - header frames AlignmentType.BOTTOM - footer frames
Returns:
Frame list
See Also:
FrameContainer.getInnerFrames(com.cc.framework.security.Principal, java.lang.Object)

getImage

public ImageModel getImage()
Description copied from interface: FrameContainer
Returns the image for the frames title

Specified by:
getImage in interface FrameContainer
Returns:
ImageModel
See Also:
FrameContainer.getImage()

setImage

public void setImage(ImageModel img)
Description copied from interface: FrameContainer
Sets an image for the frames title

Specified by:
setImage in interface FrameContainer
Parameters:
img - ImageModel
See Also:
FrameContainer.setImage(com.cc.framework.ui.model.ImageModel)

setTabOrientation

public void setTabOrientation(OrientationType orientation)
Specifies the tabulator orientation:

Specified by:
setTabOrientation in interface ListDesignModel
Parameters:
orientation - The tabulator orientation

getTabOrientation

public OrientationType getTabOrientation()
Retrieves the tabulator orientation

Specified by:
getTabOrientation in interface ListDesignModel
Returns:
the orientation

getScrollHeight

public java.lang.String getScrollHeight()
Description copied from interface: ScrollSupport
Returns the height of the scroll container

Specified by:
getScrollHeight in interface ScrollSupport
Returns:
String
See Also:
ScrollSupport.getScrollHeight()

setScrollHeight

public void setScrollHeight(java.lang.String height)
Description copied from interface: ScrollSupport
Sets the height of the scroll container

Specified by:
setScrollHeight in interface ScrollSupport
Parameters:
height - height
See Also:
ScrollSupport.setScrollHeight(java.lang.String)


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.