WUI : API


org.westofj.wui.table
Class WTable

java.lang.Object
  extended byorg.westofj.wui.Widget
      extended byorg.westofj.wui.table.WTable

public class WTable
extends Widget

Author:
bill

Constructor Summary
WTable(WTableModel dm, Object[] columnNames)
          Constructs a table widget with the specified data model and column names.
WTable(WTableModel dm, Object[] columnNames, boolean lineNumbers)
           
WTable(WTableModel dm, WTableColumnModel cm)
           
 
Method Summary
 void addColumnSelection(int column)
           
 void addRowSelection(int row)
           
 void addSelectionListener(WTableSelectionListener l)
          Adds a selection listener to the tables list of selection listener.
 void clearColumnSelection()
           
 void clearRowSelection()
           
 WTableColumnModel getColumnModel()
           
 WTableSelectionMode getColumnSelectionMode()
           
static String getDisplayValue(WRunner runner, WTableModel tm, int row, WTableColumn column)
           
 WTableSelectionMode getRowSelectionMode()
           
 WTableModel getTableModel()
           
 boolean hasSelectionListeners()
          Returns true if the list has a change listener, false otherwise.
 boolean isSelectedColumn(int column)
          Returns true if the specified row is selected, false othewise.
 boolean isSelectedRow(int row)
          Returns true if the specified row is selected, false othewise.
 void removeColumnSelection(int column)
           
 void removeRowSelection(int row)
           
 void removeSelectionListener(WTableSelectionListener l)
          Removes the specified selection listener from the tables list of selection listeners.
 void render(WRunner runner, WRenderContext context, PrintWriter pw)
          Renders the widget to the display.
 void setColumnModel(WTableColumnModel model)
           
 void setColumnSelectionMode(WTableSelectionMode mode)
           
 void setLayout(WTableLayout layout)
           
 void setRowSelection(Set indices)
           
 void setRowSelectionMode(WTableSelectionMode mode)
           
 void setTableModel(WTableModel model)
           
 
Methods inherited from class org.westofj.wui.Widget
addChangeListener, getRunner, handleNoParams, handleParams, hasChangeListeners, removeChangeListener, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WTable

public WTable(WTableModel dm,
              WTableColumnModel cm)

WTable

public WTable(WTableModel dm,
              Object[] columnNames)
Constructs a table widget with the specified data model and column names.

Parameters:
dm - the model containing the data to display.
columnNames - the headers of the columns.

WTable

public WTable(WTableModel dm,
              Object[] columnNames,
              boolean lineNumbers)
Method Detail

render

public void render(WRunner runner,
                   WRenderContext context,
                   PrintWriter pw)
            throws WRenderException
Description copied from class: Widget
Renders the widget to the display.

Specified by:
render in class Widget
Parameters:
runner - the current runner context.
pw - the output for the display.
Throws:
WRenderException

setLayout

public void setLayout(WTableLayout layout)

getColumnModel

public WTableColumnModel getColumnModel()
Returns:

getTableModel

public WTableModel getTableModel()
Returns:

setColumnModel

public void setColumnModel(WTableColumnModel model)
Parameters:
model -

setTableModel

public void setTableModel(WTableModel model)
Parameters:
model -

isSelectedColumn

public boolean isSelectedColumn(int column)
Returns true if the specified row is selected, false othewise.

Returns:
boolean true if the specified row is selected, false othewise.

isSelectedRow

public boolean isSelectedRow(int row)
Returns true if the specified row is selected, false othewise.

Parameters:
row - the row to check.
Returns:
boolean true if the specified row is selected, false othewise.

getColumnSelectionMode

public WTableSelectionMode getColumnSelectionMode()
Returns:

getRowSelectionMode

public WTableSelectionMode getRowSelectionMode()
Returns:

setColumnSelectionMode

public void setColumnSelectionMode(WTableSelectionMode mode)
Parameters:
mode -

setRowSelectionMode

public void setRowSelectionMode(WTableSelectionMode mode)
Parameters:
mode -

clearColumnSelection

public void clearColumnSelection()

clearRowSelection

public void clearRowSelection()

addColumnSelection

public void addColumnSelection(int column)

addRowSelection

public void addRowSelection(int row)

setRowSelection

public void setRowSelection(Set indices)

removeColumnSelection

public void removeColumnSelection(int column)

removeRowSelection

public void removeRowSelection(int row)

addSelectionListener

public void addSelectionListener(WTableSelectionListener l)
Adds a selection listener to the tables list of selection listener.

Parameters:
l - the selection listener to add.

removeSelectionListener

public void removeSelectionListener(WTableSelectionListener l)
Removes the specified selection listener from the tables list of selection listeners.

Parameters:
l - the selection listener to remove.

hasSelectionListeners

public boolean hasSelectionListeners()
Returns true if the list has a change listener, false otherwise.

Returns:
true if the list has a change listener, false otherwise.

getDisplayValue

public static String getDisplayValue(WRunner runner,
                                     WTableModel tm,
                                     int row,
                                     WTableColumn column)

Copyright (c) 2003 West of J - All rights reserved.