net.sourceforge.xwing.swing
Class XTableColumn

java.lang.Object
  extended bynet.sourceforge.xwing.swing.XTableColumn

public class XTableColumn
extends Object


Constructor Summary
XTableColumn(SourceSink labelSS, SourceSinkFactory valueFactory, boolean isEditable, ListModel choices, boolean isConstrainedToChoices)
           
XTableColumn(String label, SourceSinkFactory valueFactory, boolean isEditable, ListModel choices, boolean isConstrainedToChoices)
           
 
Method Summary
 boolean equals(Object obj)
           
 ListModel getChoices()
          What set of predefined values may cells be set to?
 Class getColumnClass()
          What class do this column's cell values belong to?
 String getLabel()
          Returns the label that should be used for this column.
 SourceSink getValue(Object context)
          An XTableModel has one context object per row.
 int hashCode()
           
 boolean isConstrainedToChoices()
          May cells be set to values values other than those returned by getChoices?
 boolean isEditable()
          Are the cell values in this column editable?
 void setChoices(ListModel choices)
           
 void setConstrainedToChoices(boolean isConstrainedToChoices)
           
 void setEditable(boolean isEditable)
           
 void setLabel(String label)
           
 void setLabelSS(SourceSink labelSS)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XTableColumn

public XTableColumn(String label,
                    SourceSinkFactory valueFactory,
                    boolean isEditable,
                    ListModel choices,
                    boolean isConstrainedToChoices)

XTableColumn

public XTableColumn(SourceSink labelSS,
                    SourceSinkFactory valueFactory,
                    boolean isEditable,
                    ListModel choices,
                    boolean isConstrainedToChoices)
Method Detail

getLabel

public String getLabel()
                throws Exception
Returns the label that should be used for this column.

Returns:
the label for this column
Throws:
Exception

getValue

public SourceSink getValue(Object context)
                    throws Exception
An XTableModel has one context object per row. It determines each of the cell values in hat row by calling getValue() on each of its columns.

Parameters:
context - The row contect object
Returns:
This column's cell value for the given row.
Throws:
Exception

isEditable

public boolean isEditable()
Are the cell values in this column editable?

Returns:
true if the cell values are editable, false if they are not.

getColumnClass

public Class getColumnClass()
What class do this column's cell values belong to?

Returns:
the class that all cell values will belong to (they will be instances of either the returned class or some class derived from it).

getChoices

public ListModel getChoices()
What set of predefined values may cells be set to?

Returns:
The list of enumerated values that cell values may be set to, or null if there are no predefined choices.

isConstrainedToChoices

public boolean isConstrainedToChoices()
May cells be set to values values other than those returned by getChoices?

Returns:
true if cell values are constrained to those enumerated by getChoices, false if cells may be set to any valid instance of the class specified by getColumnClass().

equals

public boolean equals(Object obj)

hashCode

public int hashCode()

setChoices

public void setChoices(ListModel choices)

setConstrainedToChoices

public void setConstrainedToChoices(boolean isConstrainedToChoices)

setEditable

public void setEditable(boolean isEditable)

setLabel

public void setLabel(String label)

setLabelSS

public void setLabelSS(SourceSink labelSS)


Copyright © 2003 The Xwing Project. All Rights Reserved.