public abstract class GralWidgetBase extends java.lang.Object implements GralWidgetBase_ifc
GralWidget
as common base class for all regular widgets,
but as base class without inheritance of 'GralWidget' for composite widgets
such as GralFileSelector
.
It contains only the basically data, especially name, the GralPos
and the reference to the GralMng
But it contains also via _cdata
all information for composite widgets.
bVisibleState
and bHasFocus
are the only dynamically data common for all widgets, contained here.
See isVisible()
and hasFocus()
.Modifier and Type | Class and Description |
---|---|
class |
GralWidgetBase.GralWidgComposite
This inner class is used for the instance
_cdata if the widget is a composite widget. |
static class |
GralWidgetBase.TimeOrderCreateImplWidget
Instance of a 'GralGraphicOrder' to create the implementation of only one widget.
|
Modifier and Type | Field and Description |
---|---|
GralWidgetBase.GralWidgComposite |
_cdata
If this widget is a composite widget (panel, complex widget), from this instance the members are referenced.
|
protected GralPos |
_wdgPos
The position of the widget.
|
private boolean |
bHasFocus
Set on focus gained, false on focus lost.
|
protected boolean |
bVisibleState
Set true if its shell, tab card etc is be activated.
|
GralMng |
gralMng
The widget manager from where the widget is organized.
|
java.lang.String |
name
Name of the widget in the panel.
|
GralRectangle |
pixSize |
static java.lang.String |
sVersion
Version, history and license.
|
Constructor and Description |
---|
GralWidgetBase(GralPos refPos,
java.lang.String sPosName,
boolean isComposite) |
GralWidgetBase(GralPos refPos,
java.lang.String sPosName,
GralMng gralMng)
Deprecated.
|
GralWidgetBase(GralPos refPos,
java.lang.String sPosName,
GralMng gralMng,
boolean isComposite)
Either the GralMng is given, or pos should be given, then the GralMng is gotten from
GralPos.parent . |
Modifier and Type | Method and Description |
---|---|
boolean |
checkImplWidgetCreation(GralWidget.ImplAccess wdgImpl)
Checks whether the creation of the implementation widget is admissible
|
boolean |
createImplWidget_Gthread()
This operation is called to create the implementation widget appearance.
|
boolean |
createImplWidget()
Should create the implementation widget.
|
GralWidget.ImplAccess |
getImplAccess()
This is used to access to the implementation widget instance.
|
java.lang.String |
getName()
Access to the name of the widget.
|
GralMng |
gralMng()
Returns the associated GralMng.
|
boolean |
hasFocus() |
boolean |
isVisible()
Returns whether the widget is visible or not.
|
GralPos |
pos()
Position of the widget, which refers also the
GralPos.parent . |
boolean |
remove()
Removes the widget from the lists in its panel and from the graphical representation.
|
void |
removeImplWidget_Gthread()
Removes the implementation widget, maybe to re-create with changed properties
or also if the GralWidget itself should be removed.
|
protected void |
resizePostPreparation()
This operation is called after the widget itself was resized but not just redrawn.
|
void |
setFocused(boolean bGained)
This operation should be called from the implementation graphic
if the focus was changed for an implementation widget by user handling.
|
abstract boolean |
setVisible(boolean visible)
Sets this widget visible on graphic or invisible.
|
java.lang.String |
toString()
Especially for test and debug, short info about widget.
|
java.lang.StringBuilder |
toString(java.lang.StringBuilder u,
java.lang.String... cond) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFocusedWidget, isInFocus, setFocus, setFocus, setFocusedWidget
public static final java.lang.String sVersion
GralWidgetBase.GralWidgComposite
as inner class for composite widgets, also for GralPanelContent
as also for comprehensive widgets as container for all Gral sub widgets.
GralWidgetBase.GralWidgComposite.resizeWidgets(GralRectangle, int)
.
pixSize
is set while resizing
hasFocus()
( bHasFocus
and bVisibleState
is stored and handled here.
createImplWidget()
able to call in any thread,
to create the implementation widget afterwards.
public final GralMng gralMng
protected final GralPos _wdgPos
GralPanel_ifc
which contains the widget.public final java.lang.String name
public final GralWidgetBase.GralWidgComposite _cdata
private boolean bHasFocus
public final GralRectangle pixSize
protected boolean bVisibleState
@Deprecated public GralWidgetBase(GralPos refPos, java.lang.String sPosName, GralMng gralMng)
public GralWidgetBase(GralPos refPos, java.lang.String sPosName, boolean isComposite)
public GralWidgetBase(GralPos refPos, java.lang.String sPosName, GralMng gralMng, boolean isComposite)
GralPos.parent
.
If both are null, the GralMng#get()
is used as fallback for compatibility.refPos
- sPosName
- syntax "[@[@] gralMng
- true
- then creates the _cdata
instance.public java.lang.String getName()
name
immediately.
Defined in GralWidgetBase_ifc.getName()
getName
in interface GralWidgetBase_ifc
public final GralPos pos()
GralPos.parent
.
The parent in a GralPos has usual the reference to the GralMng
.pos
in interface GralWidgetBase_ifc
public final GralMng gralMng()
gralMng
in interface GralWidgetBase_ifc
public abstract boolean setVisible(boolean visible)
GralWidgetBase_ifc
GralWindow
, its the visibility of the whole window.
Note that a window which is invisible is not shown in the task bar of the operation system.
Note that an application can have more as one window.
Note that a dialog window can be set to invisible if it is not need yet instead destroy and build newly.setVisible
in interface GralWidgetBase_ifc
public void setFocused(boolean bGained)
setFocused
in interface GralWidgetBase_ifc
bGained
- public boolean hasFocus()
public boolean isVisible()
GralWidgetBase_ifc
isVisible
in interface GralWidgetBase_ifc
protected void resizePostPreparation()
GralWidgetBase.GralWidgComposite.resizeWidgets(GralRectangle, int)
If some specific resize operations should be done for redraw (for example calculate which implementation widgets are visible)
Then this operation should be overridden.
It is done for example in GralTable.resizePostPreparation()
.public boolean createImplWidget_Gthread() throws java.lang.IllegalStateException
GralWidget
by the default behavior.
Or it should be overridden in instances which are not derived from GralWidget itself,
on instances of comprehensive widgets.
This implementation is only called in GralWidget.createImplWidget_Gthread()
for composite widgets.java.lang.IllegalStateException
- if called though the GralMng is not implemented.public final boolean checkImplWidgetCreation(GralWidget.ImplAccess wdgImpl)
implAccess
- use this._widgImpl for a normal widget, or use one of the (the primary) widgets
of a comprehensive widget to check whether the implementation is also done.java.lang.IllegalStateException
- if this function is called and the implementation manager is not given.
It is before call GralMng#createGraphic(String, char, org.vishia.msgDispatch.LogMessage)
.public final boolean createImplWidget()
createImplWidget_Gthread()
is called
if it is in the graphic thread, or a GralGraphicTimeOrder is created to do so in the graphic thread.
It means this operation can be called in any thread.
Calls the overridden GralWidget.createImplWidget_Gthread()
public void removeImplWidget_Gthread()
GralMng.runGraphicThread()
and hence package private.public boolean remove()
GralWidgImplAccess_ifc.removeWidgetImplementation()
is called which is overridden in the graphic implementation sources in a specific kind
(SWT: for example SwtTextFieldWrapper.removeWidgetImplementation()
)
It calls the protected GralWidgetBase.GralWidgComposite.removeWidget(GralWidgetBase)
and also GralMng.deregisterWidgetName(GralWidgetBase)
.public GralWidget.ImplAccess getImplAccess()
GralWidgetBase_ifc
getImplAccess
in interface GralWidgetBase_ifc
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.StringBuilder toString(java.lang.StringBuilder u, java.lang.String... cond)