public class AbstractTable
extends org.eclipse.swt.widgets.Composite
implements org.eclipse.jface.viewers.ISelectionProvider
In order to create a new table class, the following methods should be overridden:
addLine() to customize the action performed when clicking on the Add button.removeLine() to customize the action performed when clicking on the Del button.handleDoubleClick(DoubleClickEvent) to customize the action performed on a doucle click on the table.
createCellEditors(Table) to customize how to edit the cells of the differents columns of the table.| Modifier and Type | Field and Description |
|---|---|
protected org.eclipse.swt.widgets.Table |
mTable |
protected org.eclipse.jface.viewers.TableViewer |
mTableViewer |
| Constructor and Description |
|---|
AbstractTable(org.eclipse.swt.widgets.Composite pParent,
java.lang.String pTitle,
java.lang.String[] pColTitles,
int[] pColWidths,
java.lang.String[] pColProperties)
Constructor for a generic table.
|
| Modifier and Type | Method and Description |
|---|---|
protected ITableElement |
addLine()
Method called after an action on the Add button.
|
protected void |
addLine(ITableElement pElement)
Adding a line to the table model.
|
void |
addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener pListener) |
protected org.eclipse.jface.viewers.CellEditor[] |
createCellEditors(org.eclipse.swt.widgets.Table pTable)
Method called to configure the columns cell editors.
|
protected void |
createContent()
Creates and layout all the graphic components of the table.
|
void |
dispose()
Cleans up the table after having used it.
|
java.util.Vector<ITableElement> |
getLines()
Convenient method to get the table lines.
|
org.eclipse.jface.viewers.ISelection |
getSelection() |
protected void |
handleDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent pEvent)
Method called when a double click event has been raised by the table.
|
protected ITableElement |
removeLine()
Method called after an action on the Del button.
|
void |
removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener pListener) |
void |
setSelection(org.eclipse.jface.viewers.ISelection pSelection) |
void |
setToolTipText(java.lang.String pString) |
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabListcomputeTrim, getBorderWidth, getHorizontalBar, getScrollbarsMode, getVerticalBaraddControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateprotected org.eclipse.swt.widgets.Table mTable
protected org.eclipse.jface.viewers.TableViewer mTableViewer
public AbstractTable(org.eclipse.swt.widgets.Composite pParent,
java.lang.String pTitle,
java.lang.String[] pColTitles,
int[] pColWidths,
java.lang.String[] pColProperties)
pParent - the parent composite where to add the tablepTitle - a title for the tablepColTitles - an array with the colums titlespColWidths - an array with the columns widthpColProperties - an array with the columns propertiespublic void dispose()
dispose in class org.eclipse.swt.widgets.Widgetpublic java.util.Vector<ITableElement> getLines()
ITableElement objects representing the lines.public void setToolTipText(java.lang.String pString)
setToolTipText in class org.eclipse.swt.widgets.Controlprotected void addLine(ITableElement pElement)
pElement - the line to add.protected void createContent()
protected org.eclipse.jface.viewers.CellEditor[] createCellEditors(org.eclipse.swt.widgets.Table pTable)
null to indicate that no editing is allowed.pTable - the table for which to create the cell editors, i.e. the internal table object of this class.protected ITableElement addLine()
protected ITableElement removeLine()
null if none was removed.protected void handleDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent pEvent)
pEvent - the double click event raisedpublic void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener pListener)
addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProviderpublic org.eclipse.jface.viewers.ISelection getSelection()
getSelection in interface org.eclipse.jface.viewers.ISelectionProviderpublic void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener pListener)
removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProviderpublic void setSelection(org.eclipse.jface.viewers.ISelection pSelection)
setSelection in interface org.eclipse.jface.viewers.ISelectionProvider