org.olat.modules.fo
Class ThreadColumnDescriptor

java.lang.Object
  extended by org.olat.core.gui.components.table.DefaultColumnDescriptor
      extended by org.olat.modules.fo.ThreadColumnDescriptor
All Implemented Interfaces:
ColumnDescriptor

public class ThreadColumnDescriptor
extends DefaultColumnDescriptor

Specialized ColumnDescriptor to display title of Forum messages in a indented (thread-like) way

Author:
Felix Jost

Field Summary
 
Fields inherited from class org.olat.core.gui.components.table.DefaultColumnDescriptor
DEFAULT_POPUP_ATTRIBUTES
 
Fields inherited from interface org.olat.core.gui.components.table.ColumnDescriptor
ALIGNMENT_CENTER, ALIGNMENT_LEFT, ALIGNMENT_RIGHT
 
Constructor Summary
ThreadColumnDescriptor(java.lang.String headerKey, int dataColumn, java.lang.String action)
           
 
Method Summary
 int compareTo(int rowa, int rowb)
          this special columndescriptor can only handle data from the column of the tablemodel if it is of type Message, since this descriptor is especially made for the forum
 void modelChanged()
          called by the table if the model has changed.
 void otherColumnDescriptorSorted()
          called when this columnDescriptor is not being sorted by the user, but another columnDescriptor.
 void renderValue(StringOutput sb, int row, Renderer renderer)
           
 void sortingAboutToStart()
          called before the actual sorting calls with compareTo(int rowa, int rowb) take place
 java.lang.String toString(int rowid)
          String represenation of the value at specified row
 
Methods inherited from class org.olat.core.gui.components.table.DefaultColumnDescriptor
getAction, getAlignment, getHeaderKey, getHrefGenerator, getLocale, getPopUpWindowAttributes, isPopUpWindowAction, isSortingAllowed, setAlignment, setHrefGenerator, setIsPopUpWindowAction, setTable, setTranslateHeaderKey, translateHeaderKey
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadColumnDescriptor

public ThreadColumnDescriptor(java.lang.String headerKey,
                              int dataColumn,
                              java.lang.String action)
Parameters:
headerKey -
dataColumn -
action -
Method Detail

renderValue

public void renderValue(StringOutput sb,
                        int row,
                        Renderer renderer)
Specified by:
renderValue in interface ColumnDescriptor
Overrides:
renderValue in class DefaultColumnDescriptor
renderer - the Renderer. if null this means that the renderValue should be in plain text (e.g. for excel download)
See Also:
ColumnDescriptor.renderValue(org.olat.core.gui.render.StringOutput, int, org.olat.core.gui.render.Renderer)

compareTo

public int compareTo(int rowa,
                     int rowb)
this special columndescriptor can only handle data from the column of the tablemodel if it is of type Message, since this descriptor is especially made for the forum

Specified by:
compareTo in interface ColumnDescriptor
Overrides:
compareTo in class DefaultColumnDescriptor
Returns:
See Also:
ColumnDescriptor.compareTo(int, int)

modelChanged

public void modelChanged()
Description copied from interface: ColumnDescriptor
called by the table if the model has changed. Useful in combination with sortingAboutToStart() to know when sortingAboutToStart() can use the cache or when it has to resort again

Specified by:
modelChanged in interface ColumnDescriptor
Overrides:
modelChanged in class DefaultColumnDescriptor
See Also:
ColumnDescriptor.modelChanged()

sortingAboutToStart

public void sortingAboutToStart()
Description copied from interface: ColumnDescriptor
called before the actual sorting calls with compareTo(int rowa, int rowb) take place

Specified by:
sortingAboutToStart in interface ColumnDescriptor
Overrides:
sortingAboutToStart in class DefaultColumnDescriptor
See Also:
ColumnDescriptor.sortingAboutToStart()

otherColumnDescriptorSorted

public void otherColumnDescriptorSorted()
Description copied from interface: ColumnDescriptor
called when this columnDescriptor is not being sorted by the user, but another columnDescriptor. usage: e.g. so getRenderValue(int row) can deliver different results w/o being active (formatting or such)

Specified by:
otherColumnDescriptorSorted in interface ColumnDescriptor
Overrides:
otherColumnDescriptorSorted in class DefaultColumnDescriptor
See Also:
ColumnDescriptor.otherColumnDescriptorSorted()

toString

public java.lang.String toString(int rowid)
Description copied from interface: ColumnDescriptor
String represenation of the value at specified row

Specified by:
toString in interface ColumnDescriptor
Overrides:
toString in class DefaultColumnDescriptor
Returns: