echopoint.table
Class PagedTableController

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by nextapp.echo.Container
          extended by echopoint.table.PagedTableController
All Implemented Interfaces:
Borderable, ReflectionSetter, java.io.Serializable, Component

public class PagedTableController
extends Container
implements Borderable, ReflectionSetter

PagedTableController is a component that can control the scrolling of a PagedTabelModel. Use it as the visual artefact that allows the user to control what page is currently seen in a Table.

This component provides a compound component that looks as follows :

 [next button]     'Page' [currentPage TextField] 'Of' [ maxPage TextField]  [rowsPerPage SelectField] 'Per Page'   [previous Button]
 

You can gain access to each of these child components to customise what the PagedTableController looks like.

See Also:
PagedTableModel, SortableTableModel, TableModel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface echopoint.positionable.Borderable
Borderable.NestedStyleInfo
 
Field Summary
 java.lang.String PAGED_TABLE_SCROLLER_CHANGED_PROPERTY
           
 
Fields inherited from interface echopoint.positionable.Borderable
BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_GROOVE, BORDER_INSET, BORDER_NONE, BORDER_OUTSET, BORDER_RIDGE, BORDER_SOLID, borderStyleSymbolics, STYLE_BORDER_COLOR, STYLE_BORDER_SIZE, STYLE_BORDER_STYLE, STYLE_BOTTOM_BORDER_COLOR, STYLE_BOTTOM_BORDER_SIZE, STYLE_BOTTOM_BORDER_STYLE, STYLE_LEFT_BORDER_COLOR, STYLE_LEFT_BORDER_SIZE, STYLE_LEFT_BORDER_STYLE, STYLE_RIGHT_BORDER_COLOR, STYLE_RIGHT_BORDER_SIZE, STYLE_RIGHT_BORDER_STYLE, STYLE_TOP_BORDER_COLOR, STYLE_TOP_BORDER_SIZE, STYLE_TOP_BORDER_STYLE
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
PagedTableController()
          Constructs a PagedTableController that controls no PagedTableModel.
PagedTableController(TableModel tableModel)
          Constructs a PagedTableController that pages the provided TableModel.
 
Method Summary
 void applyStyle(Style style)
          Sets stylistic properties of this component based on a Style object.
 Color getBackground()
          Returns the background color of the component.
 Color getBorderColor()
           
 int getBorderSize()
           
 int getBorderStyle()
          Returns the border style of the Borderable.
 Color getBottomBorderColor()
           
 int getBottomBorderSize()
           
 int getBottomBorderStyle()
           
 TextField getCurrentPage()
          Returns the current page TextField
 Font getFont()
          Returns the font.
 Color getForeground()
          Returns the foreground of the component.
 Color getLeftBorderColor()
           
 int getLeftBorderSize()
           
 int getLeftBorderStyle()
           
 TextField getMaxPages()
          Returns the maxPages TextField
 TableModel getModel()
          Returns the TableModel in use
 Button getNext()
          Returns the Next Button
 java.lang.String getOfText()
          Returns the text value for 'Of' as in Page 1 'Of' 10
 java.lang.String getPageText()
          Returns the text value for 'Page' as in 'Page' 1 Of 10
 java.lang.String getPerPageText()
          Returns the text value for 'Per Page' as in 10 'Per Page'
 Button getPrevious()
          Returns the Previous Button
 Color getRightBorderColor()
           
 int getRightBorderSize()
           
 int getRightBorderStyle()
           
 SelectField getRowsPerPage()
          Returns the Rows Per Page SelectField
 Color getTopBorderColor()
           
 int getTopBorderSize()
           
 int getTopBorderStyle()
           
 void init()
          Called exactly one time when a component is registered to a hierarchy for the first time.
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setBackground(Color newValue)
          Sets the background color of the component.
 void setBorderColor(Color borderColor)
          Sets the Color of the Borderable's border.
 void setBorderSize(int borderSize)
          Sets the size of the Borderables's border.
 void setBorderStyle(int borderStyle)
          Sets the border style of the Borderable.
 void setBottomBorderColor(Color borderColor)
          Sets the Color of the Borderable's bottom border.
 void setBottomBorderSize(int borderSize)
          Sets the size of the Borderables's bottom border.
 void setBottomBorderStyle(int borderStyle)
          Sets the border style of the Borderables's bottom border.
 void setCurrentPage(TextField field)
          Sets the CurrentPage TextField
 void setFont(Font newValue)
          Sets the font of the component.
 void setForeground(Color newValue)
          Sets the foreground color of the component.
 void setLeftBorderColor(Color borderColor)
          Sets the Color of the Borderable's left border.
 void setLeftBorderSize(int borderSize)
          Sets the size of the Borderables's left border.
 void setLeftBorderStyle(int borderStyle)
          Sets the border style of the Borderables's left border.
 void setMaxPages(TextField field)
          Sets the MaxPages TextField
 void setModel(TableModel tableModel)
          Sets the PagedTableModel to use.
 void setNext(Button button)
          Sets the Next Button
 void setOfText(java.lang.String string)
          Sets the text value for 'Of' as in Page 1 'Of' 10
 void setPageText(java.lang.String string)
          Sets the text value for 'Page' as in 'Page' 1 Of 10
 void setPerPageText(java.lang.String string)
          Sets the text value for 'Per Page' as in 10 'Per Page'
 void setPrevious(Button button)
          Sets the Previous Button
 void setRightBorderColor(Color borderColor)
          Sets the Color of the Borderable's right border.
 void setRightBorderSize(int borderSize)
          Sets the size of the Borderables's right border.
 void setRightBorderStyle(int borderStyle)
          Sets the border style of the Borderables's right border.
 void setRowsPerPage(SelectField field)
          Sets the Rows Per Page SelectField.
 void setTopBorderColor(Color borderColor)
          Sets the Color of the Borderable's top border.
 void setTopBorderSize(int borderSize)
          Sets the size of the Borderables's top border.
 void setTopBorderStyle(int borderStyle)
          Sets the border style of the Borderables's top border.
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getIdentifier, getListenerList, getLocale, getParent, indexOf, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setClientId, setEnabled, setFocused, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAGED_TABLE_SCROLLER_CHANGED_PROPERTY

public final java.lang.String PAGED_TABLE_SCROLLER_CHANGED_PROPERTY
See Also:
Constant Field Values
Constructor Detail

PagedTableController

public PagedTableController()
Constructs a PagedTableController that controls no PagedTableModel.


PagedTableController

public PagedTableController(TableModel tableModel)
Constructs a PagedTableController that pages the provided TableModel. If the TableModel does not implement PagedTableModel, then it is wrapped in one.

Parameters:
tableModel - - the TableModel to use
Method Detail

init

public void init()
Description copied from class: AbstractComponent
Called exactly one time when a component is registered to a hierarchy for the first time.

This method is intended to be overridden by applications that require constructor-like functionality of a Component but can only perform such functions after the component has been registered to a hierarchy. This is often necessary as application-specific and locale information are not available until registration occurs.

Developers overriding this method should ensure that super.init() is also invoked.

Specified by:
init in interface Component
Overrides:
init in class AbstractComponent
See Also:
Component.init()

getCurrentPage

public TextField getCurrentPage()
Returns the current page TextField

Returns:
the current page TextField

getMaxPages

public TextField getMaxPages()
Returns the maxPages TextField

Returns:
the maxPages TextField

getModel

public TableModel getModel()
Returns the TableModel in use

Returns:
the TableModel in use

getNext

public Button getNext()
Returns the Next Button

Returns:
the Next Button

getOfText

public java.lang.String getOfText()
Returns the text value for 'Of' as in Page 1 'Of' 10

Returns:
the text value for 'Of' as in Page 1 'Of' 10

getPageText

public java.lang.String getPageText()
Returns the text value for 'Page' as in 'Page' 1 Of 10

Returns:
the text value for 'Page' as in 'Page' 1 Of 10

getPerPageText

public java.lang.String getPerPageText()
Returns the text value for 'Per Page' as in 10 'Per Page'

Returns:
the text value for 'Per Page' as in 10 'Per Page'

getPrevious

public Button getPrevious()
Returns the Previous Button

Returns:
the Previous Button

getRowsPerPage

public SelectField getRowsPerPage()
Returns the Rows Per Page SelectField

Returns:
the Rows Per Page SelectField

setCurrentPage

public void setCurrentPage(TextField field)
Sets the CurrentPage TextField

Parameters:
field - a TextField

setMaxPages

public void setMaxPages(TextField field)
Sets the MaxPages TextField

Parameters:
field - a TextField

setModel

public void setModel(TableModel tableModel)
Sets the PagedTableModel to use. If the TableModel does not implement PagedTableModel, then it is wrapped in one.

Parameters:
tableModel - the TableModel to use

setNext

public void setNext(Button button)
Sets the Next Button

Parameters:
button - - the next button

setOfText

public void setOfText(java.lang.String string)
Sets the text value for 'Of' as in Page 1 'Of' 10

Parameters:
string - the text value

setPageText

public void setPageText(java.lang.String string)
Sets the text value for 'Page' as in 'Page' 1 Of 10

Parameters:
string - the text value

setPerPageText

public void setPerPageText(java.lang.String string)
Sets the text value for 'Per Page' as in 10 'Per Page'

Parameters:
string - the text value

setPrevious

public void setPrevious(Button button)
Sets the Previous Button

Parameters:
button - the Previous Button

setRowsPerPage

public void setRowsPerPage(SelectField field)
Sets the Rows Per Page SelectField. This must return only integer values.

Parameters:
field - the Rows Per Page SelectField

applyStyle

public void applyStyle(Style style)
Description copied from interface: Component
Sets stylistic properties of this component based on a Style object. The version of this method in Component will set foreground and background colors and the font from the style if they are present. Components should override this method if they allow more properties to be set from a style object, and should call super.applyStyle() if necessary.

Specified by:
applyStyle in interface Borderable
Specified by:
applyStyle in interface Component
Overrides:
applyStyle in class AbstractComponent
Parameters:
style - The style object from which to retrieve properties for this Component.
See Also:
Borderable.applyStyle(nextapp.echo.Style)

getBackground

public Color getBackground()
Description copied from interface: Component
Returns the background color of the component.

Specified by:
getBackground in interface Component
Overrides:
getBackground in class AbstractComponent
Returns:
The background color of the component.
See Also:
Component.getBackground()

getFont

public Font getFont()
Description copied from interface: Component
Returns the font.

Specified by:
getFont in interface Component
Overrides:
getFont in class AbstractComponent
Returns:
The font of the component.
See Also:
Component.getFont()

getForeground

public Color getForeground()
Description copied from interface: Component
Returns the foreground of the component.

Specified by:
getForeground in interface Component
Overrides:
getForeground in class AbstractComponent
Returns:
The foreground of the component.
See Also:
Component.getForeground()

setBackground

public void setBackground(Color newValue)
Description copied from interface: Component
Sets the background color of the component.

Specified by:
setBackground in interface Component
Overrides:
setBackground in class AbstractComponent
Parameters:
newValue - The new background color of the component.
See Also:
Component.setBackground(nextapp.echo.Color)

setFont

public void setFont(Font newValue)
Description copied from interface: Component
Sets the font of the component.

Specified by:
setFont in interface Component
Overrides:
setFont in class AbstractComponent
Parameters:
newValue - The new font of the component.
See Also:
Component.setFont(nextapp.echo.Font)

setForeground

public void setForeground(Color newValue)
Description copied from interface: Component
Sets the foreground color of the component.

Specified by:
setForeground in interface Component
Overrides:
setForeground in class AbstractComponent
Parameters:
newValue - The new foreground color of the component.
See Also:
Component.setForeground(nextapp.echo.Color)

getBorderColor

public Color getBorderColor()
Specified by:
getBorderColor in interface Borderable
Returns:
The Color of the Borderable's border.
See Also:
Borderable.getBorderColor()

getBorderSize

public int getBorderSize()
Specified by:
getBorderSize in interface Borderable
Returns:
The size of the Borderables's border.
See Also:
Borderable.getBorderSize()

getBorderStyle

public int getBorderStyle()
Description copied from interface: Borderable
Returns the border style of the Borderable. This will be one of the following values :

Specified by:
getBorderStyle in interface Borderable
Returns:
int the current border style
See Also:
Borderable.getBorderStyle()

setBorderColor

public void setBorderColor(Color borderColor)
Description copied from interface: Borderable
Sets the Color of the Borderable's border. This will also set the left, top, right and bottom border color.

Specified by:
setBorderColor in interface Borderable
See Also:
Borderable.setBorderColor(nextapp.echo.Color)

setBorderSize

public void setBorderSize(int borderSize)
Description copied from interface: Borderable
Sets the size of the Borderables's border. This will also set the left, top, right and bottom border size.

Specified by:
setBorderSize in interface Borderable
See Also:
Borderable.setBorderSize(int)

setBorderStyle

public void setBorderStyle(int borderStyle)
Description copied from interface: Borderable
Sets the border style of the Borderable. This must be one of the following values : This will also set the left, top, right and bottom border style.

Specified by:
setBorderStyle in interface Borderable
See Also:
Borderable.setBorderStyle(int)

getLeftBorderColor

public Color getLeftBorderColor()
Specified by:
getLeftBorderColor in interface Borderable
Returns:
The Color of the Borderable's left border.
See Also:
Borderable.getLeftBorderColor()

getLeftBorderSize

public int getLeftBorderSize()
Specified by:
getLeftBorderSize in interface Borderable
Returns:
The size of the Borderables's left border.
See Also:
Borderable.getLeftBorderSize()

getLeftBorderStyle

public int getLeftBorderStyle()
Specified by:
getLeftBorderStyle in interface Borderable
Returns:
The style of the Borderables's left border.
See Also:
Borderable.getLeftBorderStyle()

setLeftBorderColor

public void setLeftBorderColor(Color borderColor)
Description copied from interface: Borderable
Sets the Color of the Borderable's left border.

Specified by:
setLeftBorderColor in interface Borderable
See Also:
Borderable.setLeftBorderColor(nextapp.echo.Color)

setLeftBorderSize

public void setLeftBorderSize(int borderSize)
Description copied from interface: Borderable
Sets the size of the Borderables's left border.

Specified by:
setLeftBorderSize in interface Borderable
See Also:
Borderable.setLeftBorderSize(int)

setLeftBorderStyle

public void setLeftBorderStyle(int borderStyle)
Description copied from interface: Borderable
Sets the border style of the Borderables's left border.

Specified by:
setLeftBorderStyle in interface Borderable
See Also:
Borderable.setLeftBorderStyle(int)

getTopBorderColor

public Color getTopBorderColor()
Specified by:
getTopBorderColor in interface Borderable
Returns:
The Color of the Borderable's top border.
See Also:
Borderable.getTopBorderColor()

getTopBorderSize

public int getTopBorderSize()
Specified by:
getTopBorderSize in interface Borderable
Returns:
The size of the Borderables's top border.
See Also:
Borderable.getTopBorderSize()

getTopBorderStyle

public int getTopBorderStyle()
Specified by:
getTopBorderStyle in interface Borderable
Returns:
The style of the Borderables's top border.
See Also:
Borderable.getTopBorderStyle()

setTopBorderColor

public void setTopBorderColor(Color borderColor)
Description copied from interface: Borderable
Sets the Color of the Borderable's top border.

Specified by:
setTopBorderColor in interface Borderable
See Also:
Borderable.setTopBorderColor(nextapp.echo.Color)

setTopBorderSize

public void setTopBorderSize(int borderSize)
Description copied from interface: Borderable
Sets the size of the Borderables's top border.

Specified by:
setTopBorderSize in interface Borderable
See Also:
Borderable.setTopBorderSize(int)

setTopBorderStyle

public void setTopBorderStyle(int borderStyle)
Description copied from interface: Borderable
Sets the border style of the Borderables's top border.

Specified by:
setTopBorderStyle in interface Borderable
See Also:
Borderable.setTopBorderStyle(int)

getRightBorderColor

public Color getRightBorderColor()
Specified by:
getRightBorderColor in interface Borderable
Returns:
The Color of the Borderable's right border.
See Also:
Borderable.getRightBorderColor()

getRightBorderSize

public int getRightBorderSize()
Specified by:
getRightBorderSize in interface Borderable
Returns:
The size of the Borderables's right border.
See Also:
Borderable.getRightBorderSize()

getRightBorderStyle

public int getRightBorderStyle()
Specified by:
getRightBorderStyle in interface Borderable
Returns:
The style of the Borderables's right border.
See Also:
Borderable.getRightBorderStyle()

setRightBorderColor

public void setRightBorderColor(Color borderColor)
Description copied from interface: Borderable
Sets the Color of the Borderable's right border.

Specified by:
setRightBorderColor in interface Borderable
See Also:
Borderable.setRightBorderColor(nextapp.echo.Color)

setRightBorderSize

public void setRightBorderSize(int borderSize)
Description copied from interface: Borderable
Sets the size of the Borderables's right border.

Specified by:
setRightBorderSize in interface Borderable
See Also:
Borderable.setRightBorderSize(int)

setRightBorderStyle

public void setRightBorderStyle(int borderStyle)
Description copied from interface: Borderable
Sets the border style of the Borderables's right border.

Specified by:
setRightBorderStyle in interface Borderable
See Also:
Borderable.setRightBorderStyle(int)

getBottomBorderColor

public Color getBottomBorderColor()
Specified by:
getBottomBorderColor in interface Borderable
Returns:
The Color of the Borderable's bottom border.
See Also:
Borderable.getBottomBorderColor()

getBottomBorderSize

public int getBottomBorderSize()
Specified by:
getBottomBorderSize in interface Borderable
Returns:
The size of the Borderables's bottom border.
See Also:
Borderable.getBottomBorderSize()

getBottomBorderStyle

public int getBottomBorderStyle()
Specified by:
getBottomBorderStyle in interface Borderable
Returns:
The style of the Borderables's bottom border.
See Also:
Borderable.getBottomBorderStyle()

setBottomBorderColor

public void setBottomBorderColor(Color borderColor)
Description copied from interface: Borderable
Sets the Color of the Borderable's bottom border.

Specified by:
setBottomBorderColor in interface Borderable
See Also:
Borderable.setBottomBorderColor(nextapp.echo.Color)

setBottomBorderSize

public void setBottomBorderSize(int borderSize)
Description copied from interface: Borderable
Sets the size of the Borderables's bottom border.

Specified by:
setBottomBorderSize in interface Borderable
See Also:
Borderable.setBottomBorderSize(int)

setBottomBorderStyle

public void setBottomBorderStyle(int borderStyle)
Description copied from interface: Borderable
Sets the border style of the Borderables's bottom border.

Specified by:
setBottomBorderStyle in interface Borderable
See Also:
Borderable.setBottomBorderStyle(int)

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Parameters:
field - - the field to be set
newValue - - the new value to be set
Returns:
the oldValue of the field
Throws:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)