net.rim.device.api.ui.component.table
Class TableView

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.ScrollView
          extended by net.rim.device.api.ui.Manager
              extended by net.rim.device.api.ui.component.table.DataView
                  extended by net.rim.device.api.ui.component.table.TableView
All Implemented Interfaces:
AdjustmentListener

public class TableView
extends DataView

A view interface for TableView as part of a Model-View-Controller paradigm. Implementations of TableView should handle painting, layout and focus events.

Since:
BlackBerry API 6.0.0

Field Summary
 
Fields inherited from class net.rim.device.api.ui.Manager
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, HORIZONTAL_SCROLL_MASK, LEAVE_BLANK_SPACE, LEFTMOST, LEFTWARD, NO_HORIZONTAL_SCROLL, NO_HORIZONTAL_SCROLLBAR, NO_SCROLL_RESET, NO_VERTICAL_SCROLL, NO_VERTICAL_SCROLLBAR, QUANTA_FONT, RIGHTMOST, RIGHTWARD, TOPMOST, UPWARD, VERTICAL_SCROLL, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_MASK, VERTICAL_SCROLL_MASK
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, AXIS_HORIZONTAL, AXIS_SEQUENTIAL, AXIS_VERTICAL, EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEADING, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_TRAILING, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, NON_SPELLCHECKABLE, READONLY, SPELLCHECKABLE, SPELLCHECKABLE_MASK, STATUS_MOVE_FOCUS_HORIZONTALLY, STATUS_MOVE_FOCUS_VERTICALLY, USE_ALL_HEIGHT, USE_ALL_WIDTH, VISUAL_STATE_ACTIVE, VISUAL_STATE_DISABLED, VISUAL_STATE_DISABLED_FOCUS, VISUAL_STATE_FOCUS, VISUAL_STATE_NORMAL
 
Constructor Summary
TableView(DataModel model)
          Creates a TableView instance attached to a specific DataModel object.
 
Method Summary
 void addDockedHeader(Field field)
          Creates a docked header field onto the TableView.
 Background getDataTemplateFocus()
          Retrieves a Background object that describes the background look of a DataTemplate that has focus.
 int getRegionNumberWithFocus()
          Get the region number that has focus.
 int getRowNumberWithFocus()
          Retrieves the model row index that corresponds to a DataTemplate that currently has focus.
protected  boolean modelChanged(DataModelChangeEvent event)
          Processes a DataModelChangeEvent that the DataView listens for.
 void setDataTemplateFocus(Background focusBackground)
          Set a Background object that will describe the background look of a DataTemplate that has focus.
protected  void sublayout(int width, int height)
          This method organizes the layout out of the contents of this TableView object.
 
Methods inherited from class net.rim.device.api.ui.component.table.DataView
getController, getDataTemplate, getDataTemplate, getModel, setController, setDataTemplate, setDataTemplate, setModel
 
Methods inherited from class net.rim.device.api.ui.Manager
add, addAll, delete, deleteAll, deleteRange, getAccessibleContext, getField, getFieldAtLocation, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, insert, insertAll, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, layoutChild, makeMenu, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, nextFocus, nextFocus, onFocus, onUnfocus, paint, paintChild, replace, setDirty, setFocus, setHorizontalQuantization, setPositionChild, setScrollingInertial, setVerticalQuantization, setVirtualExtent, subpaint, touchEvent, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.ScrollView
configurationChanged, getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onDisplay, onUndisplay, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, valueChanged, waitForScrolling
 
Methods inherited from class net.rim.device.api.ui.Field
drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getCommandItemProvider, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPreferredHeight, getPreferredWidth, getScreen, getStyle, getTop, getVisualState, getWidth, invalidateAll, isEditable, isEnabled, isFocus, isPasteable, isScrollCopyable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setEditable, setEnabled, setFocus, setFocusListener, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

TableView

public TableView(DataModel model)
Creates a TableView instance attached to a specific DataModel object.

Parameters:
model - A specific DataModel object
Throws:
IllegalArgumentException - If model is passed in as null.
Since:
BlackBerry API 6.0.0


Method Detail

sublayout

protected void sublayout(int width,
                         int height)
This method organizes the layout out of the contents of this TableView object. The contents in this case are the headers and the TableFieldManager.

Specified by:
sublayout in class Manager
Parameters:
width - The width in pixels available for layout
height - The height in pixels available for layout
Since:
BlackBerry API 6.0.0

addDockedHeader

public void addDockedHeader(Field field)
Creates a docked header field onto the TableView. It will stay in one place. This header field will lie above the stuck headers but below previously added docked headers.

Parameters:
field - A Field object that will serve as a docked header.
Since:
BlackBerry API 6.0.0

getDataTemplateFocus

public Background getDataTemplateFocus()
Retrieves a Background object that describes the background look of a DataTemplate that has focus.

Returns:
A Background object which describes the background look of a DataTemplate that has focus.
Since:
BlackBerry API 6.0.0

setDataTemplateFocus

public void setDataTemplateFocus(Background focusBackground)
Set a Background object that will describe the background look of a DataTemplate that has focus.

Parameters:
focusBackground - A Background object which describes the background look of a Datatemplate that has focus.
Since:
BlackBerry API 6.0.0

getRowNumberWithFocus

public int getRowNumberWithFocus()
Retrieves the model row index that corresponds to a DataTemplate that currently has focus.

Returns:
An integer representing the model row index for a DataTemplate that is currently in focus.
Since:
BlackBerry API 6.0.0

getRegionNumberWithFocus

public int getRegionNumberWithFocus()
Get the region number that has focus.

Returns:
The region number that has focus or -1 if there is no region with focus.
Since:
BlackBerry API 6.0.0

modelChanged

protected boolean modelChanged(DataModelChangeEvent event)
Processes a DataModelChangeEvent that the DataView listens for. Currently, this method processes DataModelChangeEvent.MODEL_RESET, TableModelChangeEvent.ELEMENT_UPDATED, TableModelChangeEvent.COLUMN_ADDED, TableModelChangeEvent.COLUMN_REMOVED, TableModelChangeEvent.COLUMN_UPDATED, TableModelChangeEvent.ROW_ADDED, TableModelChangeEvent.ROW_REMOVED and TableModelChangeEvent.ROW_UPDATED It should be overridden to process other events.

Overrides:
modelChanged in class DataView
Parameters:
event - An object that contains the relevant data regarding a change in the DataModel to which this DataView is attached
Returns:
A boolean value of true if the event was consumed or a value of false if it was not consumed
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.