com.tssap.util.ui.glpc.section
Class TableSection

com.tssap.util.ui.glpc.section.TableSection
All Implemented Interfaces:
IEditable, IGridLayoutPaneContainer, ISection, ISectionWithButtons, ITableSection, ITitledGridLayoutPaneContainer

public class TableSection
implements ITableSection

This is the base class for all table sections with button support.


Constructor Summary
TableSection(javax.swing.table.TableModel tableModel, IWidgetFactory widgetFactory, java.lang.String title, java.lang.String description, java.lang.String[] buttons)
          Creates a new TableSection with non-equal column widths.
TableSection(javax.swing.table.TableModel tableModel, IWidgetFactory widgetFactory, java.lang.String title, java.lang.String description, java.lang.String[] buttons, boolean[] buttonsEnabled)
          Creates a new TableSection with non-equal column widths.
TableSection(javax.swing.table.TableModel tableModel, IWidgetFactory widgetFactory, java.lang.String title, java.lang.String description, java.lang.String[] buttons, boolean[] buttonsEnabled, boolean singleSelection)
          Creates a new TableSection with non-equal column widths.
 
Method Summary
 void addFocusListener(org.eclipse.swt.events.FocusListener listener)
          Adds a new FocusListener to the section table.
 void addMenuProvider(IMenuProvider provider)
          Adds a new IMenuProvider to the section table.
 void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
          Adds a new SelectionListener to the section table.
 int getSelectionIndex()
           
 javax.swing.table.TableModel getTableModel()
          Getter method for the table model used for this table section.
 ISapTableViewer getTableViewer()
          Getter method for the table viewer used for this table section.
 void initButtonedSection(IGridLayoutPane glp)
          Initializes the section by adding a table viewer on the left.
 void removeFocusListener(org.eclipse.swt.events.FocusListener listener)
          Removes a FocusListener to the section table.
 void removeMenuProvider(IMenuProvider provider)
          Removes a IMenuProvider to the section table.
 void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
          Removes a SelectionListener to the section table.
 void setColumnWidths(int[] columnWidths)
           
 void setSelectionIndex(int index)
           
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
          Called when the default widget has been selected.
 void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
          Called when a selection event occured.
 
Methods inherited from interface com.tssap.util.ui.glpc.section.ISectionWithButtons
addButtonClickedListener, removeButtonClickedListener
 
Methods inherited from interface com.tssap.util.ui.glpc.section.ISection
initSection
 
Methods inherited from interface com.tssap.util.ui.glpc.ITitledGridLayoutPaneContainer
getDescription, getTitle, setDescription, setTitle
 
Methods inherited from interface com.tssap.util.ui.glpc.IGridLayoutPaneContainer
getUserGridNumOfColumns, initContainer, isUserGridEqualColSize
 
Methods inherited from interface com.tssap.util.ui.IEditable
isEditable, setEditable
 

Constructor Detail

TableSection

public TableSection(javax.swing.table.TableModel tableModel,
                    IWidgetFactory widgetFactory,
                    java.lang.String title,
                    java.lang.String description,
                    java.lang.String[] buttons)
Creates a new TableSection with non-equal column widths.
Parameters:
tableModel - The Swing TableModel to use for the table section.
widgetFactory - The WidgetFactory to use.
title - The title of the section.
description - The description of the section.
buttons - Array of Strings with the texts of the buttons to be displayed.

TableSection

public TableSection(javax.swing.table.TableModel tableModel,
                    IWidgetFactory widgetFactory,
                    java.lang.String title,
                    java.lang.String description,
                    java.lang.String[] buttons,
                    boolean[] buttonsEnabled)
Creates a new TableSection with non-equal column widths.
Parameters:
tableModel - The Swing TableModel to use for the table section.
widgetFactory - The WidgetFactory to use.
title - The title of the section.
description - The description of the section.
buttons - Array of Strings with the texts of the buttons to be displayed.

TableSection

public TableSection(javax.swing.table.TableModel tableModel,
                    IWidgetFactory widgetFactory,
                    java.lang.String title,
                    java.lang.String description,
                    java.lang.String[] buttons,
                    boolean[] buttonsEnabled,
                    boolean singleSelection)
Creates a new TableSection with non-equal column widths.
Parameters:
tableModel - The Swing TableModel to use for the table section.
widgetFactory - The WidgetFactory to use.
title - The title of the section.
description - The description of the section.
buttons - Array of Strings with the texts of the buttons to be displayed.
Method Detail

setColumnWidths

public void setColumnWidths(int[] columnWidths)

getTableModel

public javax.swing.table.TableModel getTableModel()
Getter method for the table model used for this table section.
Returns:
The table model set for this table section.

getTableViewer

public ISapTableViewer getTableViewer()
Getter method for the table viewer used for this table section.
Returns:
The table viewer set for this table section.

initButtonedSection

public final void initButtonedSection(IGridLayoutPane glp)
Initializes the section by adding a table viewer on the left. The table viewer is based upon the given table model, which means that the setTableModel(TableModel> method must have been called before this method is called by the framework.
Specified by:
initButtonedSection in interface ISectionWithButtons
Parameters:
glp - The client area of the super class to be filled within the section.

addSelectionListener

public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds a new SelectionListener to the section table.
Specified by:
addSelectionListener in interface ITableSection
Parameters:
listener - The listener to add.

removeSelectionListener

public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Removes a SelectionListener to the section table.
Specified by:
removeSelectionListener in interface ITableSection
Parameters:
listener - The listener to remove.

addFocusListener

public void addFocusListener(org.eclipse.swt.events.FocusListener listener)
Adds a new FocusListener to the section table.
Parameters:
listener - The listener to add.

removeFocusListener

public void removeFocusListener(org.eclipse.swt.events.FocusListener listener)
Removes a FocusListener to the section table.
Parameters:
listener - The listener to remove.

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
Called when the default widget has been selected. The implementation within this class simply calls widgetSelected(SelectionEvent).
Parameters:
e - The selection event.

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
Called when a selection event occured. The implementation in this class checks if a table selection has changed and sets the selection index. Otherwise the selection event is propagated to the super class.
Parameters:
e - The selection event.

addMenuProvider

public void addMenuProvider(IMenuProvider provider)
Adds a new IMenuProvider to the section table.
Specified by:
addMenuProvider in interface ITableSection
Parameters:
provider - The provider to add.

removeMenuProvider

public void removeMenuProvider(IMenuProvider provider)
Removes a IMenuProvider to the section table.
Specified by:
removeMenuProvider in interface ITableSection
Parameters:
provider - The provider to remove.

getSelectionIndex

public int getSelectionIndex()

setSelectionIndex

public void setSelectionIndex(int index)


Copyright © 2005 SAP AG. All Rights Reserved.