public class GralCfgBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private GralCfgData |
cfgData |
private java.io.File |
currentDir
The current directory is that directory, where the config file is located.
|
private GralPos |
currPos
The current position for building all widgets.
|
private GralMng |
gralMng |
private java.util.Map<java.lang.String,java.lang.String> |
indexAlias |
static java.lang.String |
version
Version and history
2023-08-08 Hartmut chg: The content is back moved from
GralCfgZbnf , tested, improved there since 2022-08. |
java.util.List<GralWidget> |
widgets |
GralWindow |
window |
Constructor and Description |
---|
GralCfgBuilder(GralCfgData cfgData,
GralMng gui,
java.io.File currentDir) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
buildGui(GralCfgData guiCfgData,
GralPanelContent dstPanel)
Builds the appearance of the whole graphic with the given
GralCfgData cfgData. |
java.lang.String |
buildGui(java.lang.String sWinTitle)
Builds the appearance of the whole graphic with the given
GralCfgData cfgData. |
java.lang.String |
buildPanel(GralCfgPanel cfgPanel,
GralPanelContent parentPanel)
Builds the appearance of one panel with the given
GralCfgPanel cfgData. |
java.lang.String |
buildWidget(GralCfgElement cfge,
GralPanelContent currPanel)
Builds the instance of one of the
GralWidget from the read ZBNF data. |
(package private) java.lang.String |
replaceAlias(java.lang.String src) |
(package private) void |
stop() |
void |
updatePanel(java.lang.String panelName) |
public static final java.lang.String version
GralCfgZbnf
, tested, improved there since 2022-08.
It is comparable. It is yet here the new concept to build the Gui, so this class can be used yet.
#buildGui(LogMessage, int)
Now regards only one panel in the window, not only tabbed panels.
GralUserAction
for GralWidget.setActionShow(GralUserAction, String[])
. The parameter are stored
in GralWidget.cfg
as GralWidget.ConfigData#showParam
.
private final GralCfgData cfgData
private final GralMng gralMng
private GralPos currPos
public GralWindow window
public java.util.List<GralWidget> widgets
private final java.io.File currentDir
private final java.util.Map<java.lang.String,java.lang.String> indexAlias
public GralCfgBuilder(GralCfgData cfgData, GralMng gui, java.io.File currentDir)
public java.lang.String buildGui(java.lang.String sWinTitle)
GralCfgData
cfgData.
The cfgData can be filled manually per programming, or especially by #configureWithZbnf(CharSequence, GralCfgData)
.
Calls #buildPanel(org.vishia.gral.cfg.GralCfgPanel)
for the any panel
in the GralCfgData.idxPanels
. Fills the panels one after another.log
- maybe null, errors and warnings are writtenmsgIdent
- The message identification for output.public java.lang.String buildGui(GralCfgData guiCfgData, GralPanelContent dstPanel)
GralCfgData
cfgData.
The cfgData can be filled manually per programming, or especially by #configureWithZbnf(CharSequence, GralCfgData)
.
Calls #buildPanel(org.vishia.gral.cfg.GralCfgPanel)
for the any panel
in the GralCfgData.idxPanels
. Fills the panels one after another.log
- maybe null, errors and warnings are writtenmsgIdent
- The message identification for output.public java.lang.String buildPanel(GralCfgPanel cfgPanel, GralPanelContent parentPanel)
GralCfgPanel
cfgData.cfgDataPanel
- public java.lang.String buildWidget(GralCfgElement cfge, GralPanelContent currPanel) throws java.text.ParseException
GralWidget
from the read ZBNF data.
This operation does nothing with the Graphic Implementation (SWT, AWT,...).
Hence it can run in the main thread (or any other thread).
GralMng.addSwitchButton(String, String, String, org.vishia.gral.ifc.GralColor, org.vishia.gral.ifc.GralColor)
and the other operations. This was the originally concept. Hence the building of the GUI should run only in the GUI thread
and was a little bit more difficult to debug.
Since ~2014 more and more only the GralWidget instances without GUI Implementation are firstly created on manual building of the GUI,
for example in GitGui
. This is better to manage, better to debug.
The graphical implementation is created with all given GralWidgets later based on even this given GralWidgets.
That is more simple.
- Now this concept is also used for the configured GralWidgets .cfge
- The configuration element data read from config file or set from the GUI-editor.java.text.ParseException
public void updatePanel(java.lang.String panelName)
java.lang.String replaceAlias(java.lang.String src)
void stop()