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
.
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
.
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 | Field and Description |
---|---|
protected SwtKeyListener |
swtKeyListener |
protected org.eclipse.swt.widgets.Text |
swtSearchText
SWT Text Control which contains a search text.
|
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. |
bFocused, bFocusLost, bRedrawPending, bVscrollbarChanged, cells, chgEditableColumn, ixColorScrollbar, ixColorScrollbarLast, linePixel, mousect, mousetime, nrofColumnTreeShift, outer, redrawct, redrawtime, xpixelCell, xPixelUnit, XXXhasFocus, xyVscrollbar, y1Scrollbar, y2Scrollbar
chgBitsDerived, 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 |
---|---|
protected GralMenu |
createColumnMenu(int column)
Should be implemented by the implementation class.
|
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.
|
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) |
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) |
void |
setVisibleGThread(boolean bVisible)
Sets the implementation widget(s) visible state.
|
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, zColumn
acknChanged, actionShow, dyda, getActionChange, getChanged, gralWidgetFromImplData, setDropEnable, setFocused, setTextChanged, setVisibleState, XXXfocusGained
protected SwtKeyListener swtKeyListener
protected org.eclipse.swt.widgets.Text swtSearchText
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.
protected GralMenu createColumnMenu(int column)
GralTable.GraphicImplAccess
createColumnMenu
in class GralTable.GraphicImplAccess
column
- The columnprotected void drawCellContent(int iCellLine, GralTable.CellData[] cellLine, GralTable.TableLineData line, GralTable.LinePresentation linePresentationP)
drawCellContent
in class GralTable.GraphicImplAccess
org.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
public void focusGained(org.eclipse.swt.events.FocusEvent ev)
focusGained
in interface org.eclipse.swt.events.FocusListener
FocusListener.focusGained(org.eclipse.swt.events.FocusEvent)
public 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.FocusListener
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
public GralRectangle getPixelPositionSize()
getPixelPositionSize
in interface GralWidgImpl_ifc
protected int getVisibleLinesTableImpl()
getVisibleLinesTableImpl
in class GralTable.GraphicImplAccess
public java.lang.Object getWidgetImplementation()
GralWidgImpl_ifc
Component
.
GralWidget._wdgImpl
class
which should contain the references to that implementation widgets.getWidgetImplementation
in interface GralWidgImpl_ifc
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)
ev
- protected void mouseDown(org.eclipse.swt.events.MouseEvent ev)
ev
- protected void mouseUp(org.eclipse.swt.events.MouseEvent ev)
ev
- public boolean remove()
org.vishia.util.Removeable
remove
in interface Removeable
remove
in class GralTable.GraphicImplAccess
public void removeWidgetImplementation()
removeWidgetImplementation
in interface GralWidgImpl_ifc
org.vishia.gral.base.GralWidget#removeWidgetImplementation()
public void repaintGthread()
GralTable.GraphicImplAccess
repaintGthread
in interface GralWidgImpl_ifc
GralWidgImpl_ifc.repaintGthread()
public GralColor setBackgroundColor(GralColor color)
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
public void setBoundsPixel(int x, int y, int dx, int dy)
setBoundsPixel
in interface GralWidgImpl_ifc
protected void setDragEnable(int dragType)
GralWidget.ImplAccess
setDragEnable
in class GralWidget.ImplAccess
dragType
- one of KeyCode.dragFiles
or ..dragTextpublic boolean setFocusGThread()
setFocusGThread
in interface GralWidgImpl_ifc
TODO this method must call in the graphic thread yet, queue it with {@link GralMng#setInfo(GralWidget, int, int, Object, Object)}.
public GralColor setForegroundColor(GralColor color)
public void setVisibleGThread(boolean bVisible)
GralWidgImpl_ifc
GralWidget.bVisibleState
too. Therewith it is able to quest GralWidget.isVisible()
in any thread.setVisibleGThread
in interface GralWidgImpl_ifc
bVisible
- true then the widget should be visible, false it is set to invisible.public boolean XXXsetVisible(boolean visible)