public class SwtTable extends GralTable.GraphicImplAccess implements GralWidgImplAccess_ifc
org.vishia.util.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.
GralWidgImplAccess_ifc
in its superclass
association GralWidget._wdgImpl
.
GralTable.gi
association with the proper type.
GralTable.GraphicImplAccess
defines some abstract methods which are implemented here.
GralWidgImplAccess_ifc
is found in SwtWidgetHelper
.
That are unique implementations, reuse it!
swtWidgHelper
.
SwtTable.Table
which is derived from
org.eclipse.swt.widgets.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 org.eclipse.swt.widgets.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.MousePressedListenerTable |
(package private) class |
SwtTable.MouseWheelListenerTable |
(package private) static 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.
|
private class |
SwtTable.XXXFocusListenerTable
Debug: this focus listener is not invoked any time.
|
Modifier and Type | Field and Description |
---|---|
private Text |
cellInFocus |
private Text[][] |
cellsSwt
Some SWT Text Control fields.
|
(package private) Color |
colorBackVscrollbar |
(package private) Color |
colorSliderVscrollbar |
(package private) FocusListener |
focusListenerCells |
private SwtTable.MousePressedListenerTable |
mousePressedListener |
private SwtTable.MouseWheelListenerTable |
mouseWheelListener |
private SwtTable.TableKeyListerner |
myKeyListener |
protected SwtKeyListener |
swtKeyListener |
protected 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 GralWidgImplAccess_ifc which are delegate from this. |
(package private) 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 Canvas |
vScrollBar |
(package private) ControlListener |
XXXresizeListener
The Resize listener for the whole table (a swt.Composite).
|
bFocused, bFocusLost, bRedrawPending, bVscrollbarChanged, cells, chgEditableColumn, ixColorScrollbar, ixColorScrollbarLast, ixColumnFocus, ixLineFocus, linePixel, mousect, mousetime, nrofColumnTreeShift, outer, redrawct, redrawtime, xpixelCell, xPixelUnit, XXXhasFocus, xyVscrollbar, y1Scrollbar, y2Scrollbar
bRedrawOnlyDynamics, chgBitsDerived, chgColorBack, chgColorLine, chgColorText, chgCurrTab, chgEditable, chgFloat, chgFocus, chgFont, chgIntg, chgInvisible, chgObjects, chgPos, chgText, chgVisible, chgVisibleInfo, mngImpl, pixBounds, wdgimpl, widgg
Constructor and Description |
---|
SwtTable(GralTable<?> gralTable,
SwtMng mng,
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 GralWidget.ImplAccess |
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) |
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(Composite swtTable,
int zColumns,
SwtMng mng,
GralMenu contextMenu,
GralMenu[] contextMenuColumn)
It creates
Text for each cell of the table,
and assigns the swtKeyListener , focusListenerCells , mousePressedListener ,
mouseWheelListener , traverseListenerTable to all cells. |
protected void |
keyPressed(KeyEvent keyEv) |
protected void |
mouseDouble(MouseEvent ev)
Called internal from mouse event only.
|
protected void |
mouseDown(MouseEvent ev)
Called internal from mouse event only.
|
protected void |
mouseUp(MouseEvent ev)
Called internal from mouse event only.
|
private void |
paintVscrollbar(GC gc,
Canvas canvas) |
void |
redrawGthread()
TODO implement in
GralTable.GraphicImplAccess |
private void |
redrawTableWithFocusedCell(Widget cell)
Sets the current cell as focused with the focus color.
|
boolean |
remove() |
void |
removeWidgetImplementation()
Removes the graphical widgets.
|
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)
Set the bounds of the implementation widget.
|
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(Text widgSwt)
Invoked on
swtKeyListener if enter. |
void |
setVisibleGThread(boolean bVisible)
Sets the implementation widget(s) visible state.
|
(package private) void |
stop() |
void |
updateValuesForAction()
This operation should be called before any action is invoked in the user space.
|
bChangedLinesForCell, bChangedLinesForCell, bColumnEditable, checkAndUpdateText, colorBackTable, colorBackVscrollbar, colorLineVscrollbar, colorSelectChars, colorSelectCharsBack, columnWidthsGral, columnWidthsPromille, determineSizeAndPositionScrollbar, focusGainedTable, focusLostTable, getContextMenuColumns, itsMng, ixColumn, mouseDoubleGral, mouseDownGral, mouseUpGral, processKeys, resizeTable, searchChars, setCellText, setFocusCellMousePressed, updateGraphicCellContent, zColumn
acknChanged, actionShow, dyda, getActionChange, getChanged, gralMng, gralWidgetFromImplData, redrawOnlyDynamics, setDropEnable, setPosBounds, setTextChanged, setVisibleState, XXXfocusGained
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setPosBounds
public 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 GralWidgImplAccess_ifc
which are delegate from this.private final Text[][] cellsSwt
SwtWidgetHelper.widgetSwt
.private Canvas vScrollBar
private Text cellInFocus
Color colorBackVscrollbar
Color colorSliderVscrollbar
protected Text swtSearchText
private final SwtTable.MousePressedListenerTable mousePressedListener
private final SwtTable.MouseWheelListenerTable mouseWheelListener
private final SwtTable.TableKeyListerner myKeyListener
FocusListener focusListenerCells
ControlListener XXXresizeListener
GralTable.GraphicImplAccess.resizeTable(GralRectangle)
which calculates and sets the bounds of all swt.Text fields.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 GralWidget.ImplAccess createTable(GralTable<?> gralTable, SwtMng mng)
private void setColorsSwt()
public java.lang.Object getWidgetImplementation()
GralWidgImplAccess_ifc
Component
.
GralWidget._wdgImpl
class
which should contain the references to that implementation widgets.getWidgetImplementation
in interface GralWidgImplAccess_ifc
getWidgetImplementation
in class GralWidget.ImplAccess
public void setBoundsPixel(int x, int y, int dx, int dy)
GralWidgImplAccess_ifc
setBoundsPixel
in interface GralWidgImplAccess_ifc
public GralRectangle getPixelPositionSize()
getPixelPositionSize
in interface GralWidgImplAccess_ifc
public void redrawGthread()
GralTable.GraphicImplAccess
redrawGthread
in interface GralWidgImplAccess_ifc
GralWidgImplAccess_ifc.redrawGthread()
public boolean setFocusGThread()
setFocusGThread
in interface GralWidgImplAccess_ifc
TODO 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)
GralWidgImplAccess_ifc
GralWidgetBase.bVisibleState
too. Therewith it is able to quest GralWidget.isVisible()
in any thread.setVisibleGThread
in interface GralWidgImplAccess_ifc
bVisible
- true then the widget should be visible, false it is set to invisible.protected void setDragEnable(int dragType)
GralWidget.ImplAccess
setDragEnable
in class GralWidget.ImplAccess
dragType
- one of org.vishia.util.KeyCode#dragFiles
or ..dragTextpublic void removeWidgetImplementation()
removeWidgetImplementation
in interface GralWidgImplAccess_ifc
org.vishia.gral.base.GralWidget#removeWidgetImplementation()
public boolean remove()
remove
in class GralTable.GraphicImplAccess
private void redrawTableWithFocusedCell(Widget cell)
GralMng#setInfo(GralWidget, int, int, Object, Object)
.cell
- The cellprotected int getVisibleLinesTableImpl()
getVisibleLinesTableImpl
in class GralTable.GraphicImplAccess
protected void drawCellContent(int iCellLine, GralTable.CellData[] cellLine, GralTable.TableLineData line, GralTable.LinePresentation linePresentationP)
drawCellContent
in class GralTable.GraphicImplAccess
iCellLine
- index in the line (visible Text fields)cellData
- data for the Text[] of this line: color, etc. see GralTable.CellData
line
- the line in the container of the table. Note: it is a node structurelinePresentationP
- colors of the lineorg.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.GraphicImplAccess
private void paintVscrollbar(GC gc, Canvas canvas)
protected GralMenu createColumnMenu(int column)
GralTable.GraphicImplAccess
createColumnMenu
in class GralTable.GraphicImplAccess
column
- The columnprotected void mouseDown(MouseEvent ev)
ev
- protected void mouseUp(MouseEvent ev)
ev
- protected void mouseDouble(MouseEvent ev)
ev
- protected void setBoundsCells(int treeDepthBase, int zLineVisible)
GralTable.GraphicImplAccess
GralTable.GraphicImplAccess.resizeTable(GralRectangle)
as action which should be implemented in the implementation layer.
The GralTable.GraphicImplAccess.xpixelCell
was set before.setBoundsCells
in class GralTable.GraphicImplAccess
void setTextToLine(Text widgSwt)
swtKeyListener
if enter.protected java.lang.String getCellText(GralTable.CellData cell)
GralTable.GraphicImplAccess
getCellText
in class GralTable.GraphicImplAccess
protected java.lang.String getCellTextFocus()
GralTable.GraphicImplAccess
getCellTextFocus
in class GralTable.GraphicImplAccess
protected void initSwtTable(Composite swtTable, int zColumns, SwtMng mng, GralMenu contextMenu, GralMenu[] contextMenuColumn)
Text
for each cell of the table,
and assigns the swtKeyListener
, focusListenerCells
, mousePressedListener
,
mouseWheelListener
, traverseListenerTable
to all cells.
GralTable.CellData
as Control#setData(Object)
.swtTable
- zColumns
- mng
- protected void keyPressed(KeyEvent keyEv)
void stop()
public void updateValuesForAction()
GralWidgImplAccess_ifc
updateValuesForAction
in interface GralWidgImplAccess_ifc