MCPcopy Create free account
hub / github.com/BaseXdb/basex / BaseXGUI

Method BaseXGUI

basex-core/src/main/java/org/basex/BaseXGUI.java:49–89  ·  view source on GitHub ↗

Constructor. @param args command-line arguments @throws BaseXException database exception

(final String... args)

Source from the content-addressed store, hash-verified

47 * @throws BaseXException database exception
48 */
49 public BaseXGUI(final String... args) throws BaseXException {
50 super(args);
51 parseArgs();
52
53 // create splash screen
54 final JFrame splash = splash();
55
56 // read options
57 final GUIOptions gopts = new GUIOptions();
58 // initialize look and feel
59 init(gopts);
60
61 // initialize fonts and colors
62 GUIConstants.init(gopts);
63
64 SwingUtilities.invokeLater(() -> {
65 // open main window and close splash screen
66 final GUI gui = new GUI(context, gopts);
67 splash.dispose();
68
69 // open specified file
70 final ArrayList<IOFile> xqfiles = new ArrayList<>();
71 for(final String file : files.finish()) {
72 if(file.contains(IO.BASEXSUFFIX)) continue;
73
74 final IOFile io = new IOFile(file);
75 final boolean xml = file.endsWith(IO.XMLSUFFIX);
76 if(xml && BaseXDialog.confirm(gui, Util.info(CREATE_DB_FILE, io))) {
77 gopts.setFile(GUIOptions.INPUTPATH, io);
78 gopts.set(GUIOptions.DBNAME, io.dbName());
79 DialogProgress.execute(gui, new Check(file));
80 } else {
81 xqfiles.add(io);
82 }
83 }
84 gui.editor.init(xqfiles);
85 });
86
87 // guarantee correct shutdown of database context
88 Runtime.getRuntime().addShutdownHook(new Thread(context::close));
89 }
90
91 /**
92 * Creates a splash screen.

Callers

nothing calls this directly

Calls 15

parseArgsMethod · 0.95
splashMethod · 0.95
initMethod · 0.95
initMethod · 0.95
confirmMethod · 0.95
infoMethod · 0.95
setFileMethod · 0.95
executeMethod · 0.95
invokeLaterMethod · 0.80
dbNameMethod · 0.80
containsMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected