public class GralCfgZbnf
extends java.lang.Object
GralCfgData
, which contains all data of read configuration
after invoking the read method. That configuration data are associated in
GralCfgBuilder#GuiCfgBuilder(GralCfgData, GralMngBuild_ifc, File)
and used in
GralCfgBuilder#buildGui(org.vishia.msgDispatch.LogMessage, int)
to build the GUI appearance.
The building of the GUI with the GralCfgData
can be done without this script reader too,
but this class reads that data from a script.Modifier and Type | Field and Description |
---|---|
private GralCfgData |
cfgData
Used in new approach:
#configWithZbnf(CharSequence) since 2022-08 |
private MainCmdLogging_ifc |
console |
(package private) java.io.File |
currentDir
The current directory is that directory, where the config file is located.
|
private java.io.File |
fileSyntax |
private ZbnfParser |
parser |
static int |
version
Version and history
2023-08-08 The
GralCfgBuilder is reactivated. |
java.lang.String |
XXXsyntaxStd
Deprecated.
|
private ZbnfJavaOutput |
zbnfJavaOutput |
Constructor and Description |
---|
GralCfgZbnf(GralMng gralMng) |
GralCfgZbnf(Report log,
java.io.File fileSyntax,
GralMng gralMng) |
Modifier and Type | Method and Description |
---|---|
void |
configureWithZbnf(java.lang.CharSequence configurationZbnf,
GralCfgData destination)
Configures the GUI using a description in a file.
|
void |
configureWithZbnf(java.io.File fileConfigurationZbnf,
GralCfgData destination)
Configures the GUI using a description in a file.
|
static GralWindow |
configWithZbnf(java.lang.CharSequence sGui,
java.lang.String sWinTitle,
GralMng gralMng)
Creates a Graphic application with a given config String.
|
static void |
configWithZbnf(java.io.File fGui,
GralPanelContent dstPanel)
Builds the content of the given panel.
|
static GralWindow |
configWithZbnf(java.io.File fGui,
java.lang.String sWinTitle,
GralMng gralMng)
Creates a Graphic application with a given config File.
|
(package private) java.lang.String |
getSyntaxFromJar() |
public static final int version
GralCfgBuilder
is reactivated. It has gotten the content from here,
because it was copied before, improved, tested and used since 2022-08. Now there are back copied.
It is comparable with the older version in GralCfgBuilder.
configWithZbnf(File, GralPanelContent)
used for InspcGui
configureWithZbnf(File, GralCfgData)
and #configWithZbnf(File)
Should be used on file input, also regarding encoding.
#configWithZbnf(CharSequence)
, #buildGui()
.
This operations were (are yet) part of GralCfgBuilder too, but for the new concept, it should be contained here
(refactored here as copy). It means this class is complete responsible to build the GUI with config data.
org/vishia/gral/cfg/Syntax.zbnf
as file inside jar (ressource).
It is read with getSyntaxFromJar()
private final ZbnfParser parser
private final ZbnfJavaOutput zbnfJavaOutput
private final MainCmdLogging_ifc console
private final java.io.File fileSyntax
private GralCfgData cfgData
#configWithZbnf(CharSequence)
since 2022-08@Deprecated public final java.lang.String XXXsyntaxStd
GralCfgZbnf#GralCfgZbnf(Report, File)
is used.
This syntax is used with the constructorjava.io.File currentDir
public GralCfgZbnf(GralMng gralMng)
public GralCfgZbnf(Report log, java.io.File fileSyntax, GralMng gralMng)
java.lang.String getSyntaxFromJar()
public void configureWithZbnf(java.io.File fileConfigurationZbnf, GralCfgData destination) throws java.nio.charset.IllegalCharsetNameException, java.nio.charset.UnsupportedCharsetException, java.io.FileNotFoundException, java.io.IOException, java.text.ParseException
#configureWithZbnf(String, String)
.
Because the configuration is containing in a user-accessible file, it may be faulty.
Than a error message was written on the own Report output. Therefore this routine
should be called after the main application is started. See example in org.vishia.appl.menu.Menu
.sTitle
- Title line for the applicationfileConfigurationZbnf
- File containing the configuration. The file should be exist and able to read.java.io.IOException
java.io.FileNotFoundException
java.nio.charset.UnsupportedCharsetException
java.nio.charset.IllegalCharsetNameException
java.text.ParseException
public void configureWithZbnf(java.lang.CharSequence configurationZbnf, GralCfgData destination) throws java.text.ParseException
#configureWithZbnf(String, String)
.
Because the configuration is containing in a user-accessible file, it may be faulty.
Than a error message was written on the own Report output. Therefore this routine
should be called after the main application is started. See example in org.vishia.appl.menu.Menu
.sTitle
- Title line for the applicationfileConfigurationZbnf
- File containing the configuration. The file should be exist and able to read.java.text.ParseException
public static GralWindow configWithZbnf(java.lang.CharSequence sGui, java.lang.String sWinTitle, GralMng gralMng) throws java.text.ParseException
configureWithZbnf(CharSequence, GralCfgData)
#buildGui()
sGui
- The config file.java.text.ParseException
- on syntax error in sGuipublic static GralWindow configWithZbnf(java.io.File fGui, java.lang.String sWinTitle, GralMng gralMng) throws java.lang.Exception
configureWithZbnf(CharSequence, GralCfgData)
#buildGui()
fGui
- The config file.java.text.ParseException
- on syntax error in sGuijava.lang.Exception
public static void configWithZbnf(java.io.File fGui, GralPanelContent dstPanel) throws java.lang.Exception
fGui
- The config filedstPanel
- The panel where the content should applied tojava.lang.Exception