Mobile Tools for Java
Release 1.0

org.eclipse.mtj.ui.viewers
Class TableViewerConfiguration

java.lang.Object
  extended by org.eclipse.mtj.ui.viewers.TableViewerConfiguration

public class TableViewerConfiguration
extends Object

Instances of this class provide necessary configuration information for making a fully-functional table viewer with sortable columns.


Constructor Summary
TableViewerConfiguration(IDialogSettings dialogSettings, int defaultTableWidth, TableColumnInfo[] columnInfo, int defaultSortColumn)
          Construct new viewer information with storage in the specified location.
 
Method Summary
 void configure(TableViewer viewer)
          Configure the table viewer and all related listeners based on this table viewer information.
 TableColumnInfo[] getColumnInfo()
           
 IDialogSettings getDialogSettings()
           
 int getSortColumn()
          Return the index of the current column to be sorted.
 boolean getSortDirectionAscending()
          Return a boolean indicating whether or not the current sort direction is ascending.
 void setColumnInfo(TableColumnInfo[] columnInfo)
           
 void setDialogSettings(IDialogSettings dialogSettings)
           
 void setSortColumn(int columnIndex)
          Set the index of the current column to be sorted.
 void setSortDirectionAscending(boolean ascending)
          Return a boolean indicating whether or not the current sort direction is ascending.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableViewerConfiguration

public TableViewerConfiguration(IDialogSettings dialogSettings,
                                int defaultTableWidth,
                                TableColumnInfo[] columnInfo,
                                int defaultSortColumn)
Construct new viewer information with storage in the specified location.

Parameters:
dialogSettings -
columnInfo -
Method Detail

configure

public void configure(TableViewer viewer)
Configure the table viewer and all related listeners based on this table viewer information. This method will install a sorter into the viewer. Removal of this sorter will cause the sorting functionality to fail.

Parameters:
viewer -

getColumnInfo

public TableColumnInfo[] getColumnInfo()
Returns:
Returns the columnInfo.

getDialogSettings

public IDialogSettings getDialogSettings()
Returns:
Returns the dialogSettings.

getSortColumn

public int getSortColumn()
Return the index of the current column to be sorted.

Returns:

getSortDirectionAscending

public boolean getSortDirectionAscending()
Return a boolean indicating whether or not the current sort direction is ascending.

Returns:

setColumnInfo

public void setColumnInfo(TableColumnInfo[] columnInfo)
Parameters:
columnInfo - The columnInfo to set.

setDialogSettings

public void setDialogSettings(IDialogSettings dialogSettings)
Parameters:
dialogSettings - The dialogSettings to set.

setSortColumn

public void setSortColumn(int columnIndex)
Set the index of the current column to be sorted.

Parameters:
columnIndex -

setSortDirectionAscending

public void setSortDirectionAscending(boolean ascending)
Return a boolean indicating whether or not the current sort direction is ascending.

Parameters:
ascending -

Mobile Tools for Java
Release 1.0