public class SwtTable extends GralTable.GraphicImplAccess implements GralWidgImpl_ifc, org.eclipse.swt.events.FocusListener
Docu_UML_simpleNotation:
|--widgg----------------->GralWidget<|-------+
| | |
+--|>GralWidget.ImplAccess<--widgImpl---| |
| |
| |
+-|>GralTable.GraphicImplAccess |
| | |
SwtTable | GralTable
| | |
| |<-------------------------------------gi--|
| | |
| |<&>-------------------------------------&>|
| access to all protected methods and fields of GralTable
|
|
|
|---swtWidg----->SwtWidgetHelper
| |
| |
| |--widgetSwt--->Control<|---Composite<|---SwtTable.Table
| | |
|---cellsSwt--------------*>Text<*---------------------| some Listener
|
|
GralTable contains some implementation-non-specific things, most of table structure.
GralTable.GraphicImplAccess
is used as super class of SwtTable with protected access.
GralWidgImpl_ifc in its superclass
association GralWidget._wdgImpl.
GralTable.gi association with the proper type.
GralTable.GraphicImplAccess defines some abstract methods which are implemented here.
GralWidgImpl_ifc is found in SwtWidgetHelper.
That are unique implementations, reuse it!
swtWidgHelper.
SwtTable.Table which is derived from
Composite. That Composite contains some text fields
which are the visible rows and columns of the table.
cellsSwt. Therefore this class can access the visible rows and columns
directly, using as Text.
SwtTable.Table is necessary only as implementor of GralWidgetGthreadSet_ifc.
But that is an Deprecated interface. It is possible to replace it later with an simple
instance of Composite.
GralTable#tableLines,
see description of GralTable.
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
SwtTable.ActionUserMenuItem
This class wraps the
GralUserAction for a menu action for the table. |
private class |
SwtTable.FocusListenerTable
Debug: this focus listener is not invoked any time.
|
private class |
SwtTable.MousePressedListenerTable |
(package private) class |
SwtTable.MouseWheelListenerTable |
private class |
SwtTable.Table
The SWT-Composite for the cell texts and the scroll bar.
|
(package private) class |
SwtTable.TableKeyListerner
A Table is completed with a special key listener.
|
private class |
SwtTable.Vscrollbar
The widget for the vertical scroll bar is a canvas with a special paint routine.
|
private class |
SwtTable.XXXFocusListenerCell
An instance of this is associated to any cell of the table.
|
| Modifier and Type | Field and Description |
|---|---|
private org.eclipse.swt.widgets.Text |
cellInFocus |
private org.eclipse.swt.widgets.Text[][] |
cellsSwt
Some SWT Text Control fields.
|
(package private) org.eclipse.swt.graphics.Color |
colorBackVscrollbar |
(package private) org.eclipse.swt.graphics.Color |
colorSliderVscrollbar |
private org.eclipse.swt.events.FocusListener |
focusListenerTable |
private SwtTable.MousePressedListenerTable |
mousePressedListener |
private SwtTable.MouseWheelListenerTable |
mouseWheelListener |
private SwtTable.TableKeyListerner |
myKeyListener |
(package private) org.eclipse.swt.events.ControlListener |
resizeListener |
protected SwtKeyListener |
swtKeyListener |
protected org.eclipse.swt.widgets.Text |
swtSearchText
SWT Text Control which contains a search text.
|
private SwtWidgetHelper |
swtWidgHelper
It contains the association to the swt widget (Control) and the
SwtMng
and implements some methods of GralWidgImpl_ifc which are delegate from this. |
(package private) org.eclipse.swt.events.TraverseListener |
traverseListenerTable |
static java.lang.String |
version
Version and history
2018-01-07 Hartmut new:
getCellTextFocus()
2015-08-29 Hartmut chg: It has a traverseListenerTable now to accept 'tab' and 'sh-tab' as normal key
instead usage to traverse between the text fields of a table. |
private org.eclipse.swt.widgets.Canvas |
vScrollBar |
bFocused, bFocusLost, bRedrawPending, bVscrollbarChanged, cells, chgEditableColumn, columnPixel, ixColorScrollbar, ixColorScrollbarLast, linePixel, mousect, mousetime, nrofColumnTreeShift, outer, redrawct, redrawtime, xpixelCell, xPixelUnit, XXXhasFocus, xyVscrollbar, y1Scrollbar, y2ScrollbarchgBitsDerived, chgColorBack, chgColorLine, chgColorText, chgEditable, chgFloat, chgFocus, chgFont, chgIntg, chgInvisible, chgObjects, chgPos, chgText, chgVisible, chgVisibleInfo, pixBounds, wdgimpl, widgg| Constructor and Description |
|---|
SwtTable(GralTable<?> gralTable,
SwtMng mng,
org.eclipse.swt.widgets.Composite parent) |
| Modifier and Type | Method and Description |
|---|---|
static GralTable |
addTable(GralTable gralTable,
SwtMng mng,
java.lang.String sName,
int height,
int[] columnWidths)
Deprecated.
Create an instance of
GralTable and call |
protected GralMenu |
createColumnMenu(int column)
Should be implemented by the implementation class.
|
(package private) static void |
createTable(GralTable<?> gralTable,
SwtMng mng) |
protected void |
drawCellContent(int iCellLine,
GralTable.CellData[] cellLine,
GralTable.TableLineData line,
GralTable.LinePresentation linePresentationP)
This routine implements all things to set the content of any table cell to show it.
|
protected GralTable.CellData |
drawCellInvisible(int iCellLine,
int iCellCol) |
void |
focusGained(org.eclipse.swt.events.FocusEvent ev)
Focus listener implementation for all cells.
|
void |
focusLost(org.eclipse.swt.events.FocusEvent ev)
Focus listener implementation for all cells.
|
protected java.lang.String |
getCellText(GralTable.CellData cell)
Gets the current text of the given cell from the graphic implementation.
|
protected java.lang.String |
getCellTextFocus()
Gets the cell text from the focused cell in the implementation.
|
GralRectangle |
getPixelPositionSize() |
protected int |
getVisibleLinesTableImpl() |
java.lang.Object |
getWidgetImplementation()
Returns the implementation class of the widget.
|
protected void |
initSwtTable(org.eclipse.swt.widgets.Composite swtTable,
int zColumns,
SwtMng mng) |
protected void |
keyPressed(org.eclipse.swt.events.KeyEvent keyEv) |
protected void |
mouseDouble(org.eclipse.swt.events.MouseEvent ev)
Called internal from mouse event only.
|
protected void |
mouseDown(org.eclipse.swt.events.MouseEvent ev)
Called internal from mouse event only.
|
protected void |
mouseUp(org.eclipse.swt.events.MouseEvent ev)
Called internal from mouse event only.
|
private void |
paintVscrollbar(org.eclipse.swt.graphics.GC gc,
org.eclipse.swt.widgets.Canvas canvas) |
private void |
redrawTableWithFocusedCell(org.eclipse.swt.widgets.Widget cell)
Sets the current cell as focused with the focus color.
|
boolean |
remove()
Removes all referenced data, close all opened resources, removes all graphical widgets etc.
|
void |
removeWidgetImplementation()
Removes the graphical widgets.
|
void |
repaintGthread()
TODO implement in
GralTable.GraphicImplAccess |
GralColor |
setBackgroundColor(GralColor color) |
protected void |
setBoundsCells(int treeDepthBase,
int zLineVisible)
Invoked in
GralTable.GraphicImplAccess.resizeTable(GralRectangle) as action which should be implemented in the implementation layer. |
void |
setBoundsPixel(int x,
int y,
int dx,
int dy) |
private void |
setColorsSwt() |
protected void |
setDragEnable(int dragType)
Implementation routine to set receiving a drag event and initializes the drag feature of the widget.
|
boolean |
setFocusGThread()
Sets the focus to the current cell of the tab
|
GralColor |
setForegroundColor(GralColor color) |
(package private) void |
setTextToLine(org.eclipse.swt.widgets.Text widgSwt)
Invoked on
swtKeyListener if enter. |
void |
setVisibleGThread(boolean bVisible)
Sets the implementation widget(s) visible state.
|
(package private) void |
stop() |
boolean |
XXXsetVisible(boolean visible) |
bChangedLinesForCell, bChangedLinesForCell, bColumnEditable, checkAndUpdateText, colorBackTable, colorBackVscrollbar, colorLineVscrollbar, colorSelectChars, colorSelectCharsBack, columnWidthsGral, determineSizeAndPositionScrollbar, focusGainedTable, focusLostTable, itsMng, ixColumn, mouseDoubleGral, mouseDownGral, mouseUpGral, processKeys, redrawTableWithFocusedCell, resizeTable, searchChars, setCellText, setFocusCellMousePressed, updateGraphicCellContent, zColumnacknChanged, actionShow, dyda, getActionChange, getChanged, gralWidgetFromImplData, setDropEnable, setFocused, setTextChanged, setVisibleState, XXXfocusGainedpublic static final java.lang.String version
getCellTextFocus()
traverseListenerTable now to accept 'tab' and 'sh-tab' as normal key
instead usage to traverse between the text fields of a table. TODO: What traversing functions are missing yet?
They should not any traverse function between the cells.
GraphicImplAccess is provided as super class for the graphic implementation class,
for example SwtTable.
GralTable.GraphicImplAccess.ixColumn()
starts whith the search string.
private final SwtWidgetHelper swtWidgHelper
SwtMng
and implements some methods of GralWidgImpl_ifc which are delegate from this.private final org.eclipse.swt.widgets.Text[][] cellsSwt
SwtWidgetHelper.widgetSwt.private org.eclipse.swt.widgets.Canvas vScrollBar
private org.eclipse.swt.widgets.Text cellInFocus
org.eclipse.swt.graphics.Color colorBackVscrollbar
org.eclipse.swt.graphics.Color colorSliderVscrollbar
protected org.eclipse.swt.widgets.Text swtSearchText
private final org.eclipse.swt.events.FocusListener focusListenerTable
private final SwtTable.MousePressedListenerTable mousePressedListener
private final SwtTable.MouseWheelListenerTable mouseWheelListener
private final SwtTable.TableKeyListerner myKeyListener
org.eclipse.swt.events.ControlListener resizeListener
org.eclipse.swt.events.TraverseListener traverseListenerTable
protected SwtKeyListener swtKeyListener
@Deprecated public static GralTable addTable(GralTable gralTable, SwtMng mng, java.lang.String sName, int height, int[] columnWidths)
GralTable and callgralTable - mng - sName - height - columnWidths - static void createTable(GralTable<?> gralTable, SwtMng mng)
private void setColorsSwt()
public java.lang.Object getWidgetImplementation()
GralWidgImpl_ifcComponent.
GralWidget._wdgImpl class
which should contain the references to that implementation widgets.getWidgetImplementation in interface GralWidgImpl_ifcpublic GralColor setBackgroundColor(GralColor color)
public GralColor setForegroundColor(GralColor color)
public void setBoundsPixel(int x, int y, int dx, int dy)
setBoundsPixel in interface GralWidgImpl_ifcpublic GralRectangle getPixelPositionSize()
getPixelPositionSize in interface GralWidgImpl_ifcpublic boolean XXXsetVisible(boolean visible)
public void repaintGthread()
GralTable.GraphicImplAccessrepaintGthread in interface GralWidgImpl_ifcGralWidgImpl_ifc.repaintGthread()public boolean setFocusGThread()
setFocusGThread in interface GralWidgImpl_ifcTODO this method must call in the graphic thread yet, queue it with {@link GralMng#setInfo(GralWidget, int, int, Object, Object)}.public void setVisibleGThread(boolean bVisible)
GralWidgImpl_ifcGralWidget.bVisibleState too. Therewith it is able to quest GralWidget.isVisible() in any thread.setVisibleGThread in interface GralWidgImpl_ifcbVisible - true then the widget should be visible, false it is set to invisible.protected void setDragEnable(int dragType)
GralWidget.ImplAccesssetDragEnable in class GralWidget.ImplAccessdragType - one of KeyCode.dragFiles or ..dragTextpublic void removeWidgetImplementation()
removeWidgetImplementation in interface GralWidgImpl_ifcorg.vishia.gral.base.GralWidget#removeWidgetImplementation()public boolean remove()
org.vishia.util.Removeableremove in interface Removeableremove in class GralTable.GraphicImplAccessprivate void redrawTableWithFocusedCell(org.eclipse.swt.widgets.Widget cell)
GralMng#setInfo(GralWidget, int, int, Object, Object).cell - The cellprotected int getVisibleLinesTableImpl()
getVisibleLinesTableImpl in class GralTable.GraphicImplAccessprotected void drawCellContent(int iCellLine, GralTable.CellData[] cellLine, GralTable.TableLineData line, GralTable.LinePresentation linePresentationP)
drawCellContent in class GralTable.GraphicImplAccessorg.vishia.gral.base.GralTable#drawCellContent(int, int, org.vishia.gral.base.GralTable.TableLineData)protected GralTable.CellData drawCellInvisible(int iCellLine, int iCellCol)
drawCellInvisible in class GralTable.GraphicImplAccessprivate void paintVscrollbar(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.widgets.Canvas canvas)
protected GralMenu createColumnMenu(int column)
GralTable.GraphicImplAccesscreateColumnMenu in class GralTable.GraphicImplAccesscolumn - The columnprotected void mouseDown(org.eclipse.swt.events.MouseEvent ev)
ev - protected void mouseUp(org.eclipse.swt.events.MouseEvent ev)
ev - protected void mouseDouble(org.eclipse.swt.events.MouseEvent ev)
ev - protected void setBoundsCells(int treeDepthBase, int zLineVisible)
GralTable.GraphicImplAccessGralTable.GraphicImplAccess.resizeTable(GralRectangle) as action which should be implemented in the implementation layer.
The GralTable.GraphicImplAccess.xpixelCell was set before.setBoundsCells in class GralTable.GraphicImplAccessvoid setTextToLine(org.eclipse.swt.widgets.Text widgSwt)
swtKeyListener if enter.protected java.lang.String getCellText(GralTable.CellData cell)
GralTable.GraphicImplAccessgetCellText in class GralTable.GraphicImplAccessprotected java.lang.String getCellTextFocus()
GralTable.GraphicImplAccessgetCellTextFocus in class GralTable.GraphicImplAccesspublic void focusLost(org.eclipse.swt.events.FocusEvent ev)
GralTable.GraphicImplAccess#focusLostTable() but only if
GralTable.GraphicImplAccess#bRedrawPending is not set. That prevents invocation while
GralTable.GraphicImplAccess#updateGraphicCellContent() sets the focus while updating the graphic cells.focusLost in interface org.eclipse.swt.events.FocusListenerpublic void focusGained(org.eclipse.swt.events.FocusEvent ev)
focusGained in interface org.eclipse.swt.events.FocusListenerFocusListener.focusGained(org.eclipse.swt.events.FocusEvent)protected void initSwtTable(org.eclipse.swt.widgets.Composite swtTable, int zColumns, SwtMng mng)
protected void keyPressed(org.eclipse.swt.events.KeyEvent keyEv)
void stop()