@Test public void testFormConfig() throws Exception { ConfigThingy conf = new ConfigThingy("Tab", "TITLE \"title\" PLAUSI_MARKER_COLOR \"#0000FF\" HOTKEY \"key\" CLOSEACTION \"action\""); ConfigThingy tabConf = new ConfigThingy("Fenster", "Tab(Eingabefelder((TYPE \"LABEL\")) Buttons((TYPE \"LABEL\")))"); conf.addChild(tabConf); ConfigThingy visConf = new ConfigThingy("Sichtbarkeit", "(Test \"true\")"); conf.addChild(visConf); FormConfig form = new FormConfig(conf, "frame"); assertEquals("frame - title", form.getTitle()); assertEquals(Color.BLUE, form.getPlausiMarkerColor()); assertEquals(1, form.getVisibilities().size()); assertEquals(1, form.getTabs().size()); assertEquals(2, form.getControls().count()); }
public FormConfig(ConfigThingy conf, String frameTitle) throws FormModelException { String formTitle = conf.getString("TITLE", L.m("Unbenanntes Formular")); if (frameTitle != null) { title = frameTitle + " - " + formTitle; } else { title = formTitle; } final ConfigThingy fensterDesc = conf.query("Fenster"); try { for (ConfigThingy tabConf : fensterDesc.getLastChild()) { tabs.add(new TabConfig(tabConf)); } } catch (NodeNotFoundException e) { throw new FormModelException(L.m("Schlüssel 'Fenster' fehlt in %1", conf.getName()), e); } try { plausiMarkerColor = Color .decode(conf.get("PLAUSI_MARKER_COLOR", 1).getLastChild().toString()); } catch (Exception x) { plausiMarkerColor = Color.RED; } try { ConfigThingy visibilityDesc = conf.query("Sichtbarkeit"); if (visibilityDesc.count() > 0) { visibilityDesc = visibilityDesc.getLastChild(); } for (ConfigThingy visRule : visibilityDesc) { visiblities.add(new VisibilityGroupConfig(visRule)); } } catch (NodeNotFoundException x) { LOGGER.error("", x); } }
FormConfig { public FormConfig(ConfigThingy conf, String frameTitle) throws FormModelException { String formTitle = conf.getString("TITLE", L.m("Unbenanntes Formular")); if (frameTitle != null) { title = frameTitle + " - " + formTitle; } else { title = formTitle; } final ConfigThingy fensterDesc = conf.query("Fenster"); try { for (ConfigThingy tabConf : fensterDesc.getLastChild()) { tabs.add(new TabConfig(tabConf)); } } catch (NodeNotFoundException e) { throw new FormModelException(L.m("Schlüssel 'Fenster' fehlt in %1", conf.getName()), e); } try { plausiMarkerColor = Color .decode(conf.get("PLAUSI_MARKER_COLOR", 1).getLastChild().toString()); } catch (Exception x) { plausiMarkerColor = Color.RED; } try { ConfigThingy visibilityDesc = conf.query("Sichtbarkeit"); if (visibilityDesc.count() > 0) { visibilityDesc = visibilityDesc.getLastChild(); } for (ConfigThingy visRule : visibilityDesc) { visiblities.add(new VisibilityGroupConfig(visRule)); } } catch (NodeNotFoundException x) { LOGGER.error("", x); } } }
FormConfig { public FormConfig(ConfigThingy conf, String frameTitle) throws FormModelException { String formTitle = conf.getString("TITLE", L.m("Unbenanntes Formular")); if (frameTitle != null) { title = frameTitle + " - " + formTitle; } else { title = formTitle; } final ConfigThingy fensterDesc = conf.query("Fenster"); try { for (ConfigThingy tabConf : fensterDesc.getLastChild()) { tabs.add(new TabConfig(tabConf)); } } catch (NodeNotFoundException e) { throw new FormModelException(L.m("Schlüssel 'Fenster' fehlt in %1", conf.getName()), e); } try { plausiMarkerColor = Color .decode(conf.get("PLAUSI_MARKER_COLOR", 1).getLastChild().toString()); } catch (Exception x) { plausiMarkerColor = Color.RED; } try { ConfigThingy visibilityDesc = conf.query("Sichtbarkeit"); if (visibilityDesc.count() > 0) { visibilityDesc = visibilityDesc.getLastChild(); } for (ConfigThingy visRule : visibilityDesc) { visiblities.add(new VisibilityGroupConfig(visRule)); } } catch (NodeNotFoundException x) { LOGGER.error("", x); } } FormConfig(ConfigThingy conf, String frameTitle); }
FormConfig { public FormConfig(ConfigThingy conf, String frameTitle) throws FormModelException { String formTitle = conf.getString("TITLE", L.m("Unbenanntes Formular")); if (frameTitle != null) { title = frameTitle + " - " + formTitle; } else { title = formTitle; } final ConfigThingy fensterDesc = conf.query("Fenster"); try { for (ConfigThingy tabConf : fensterDesc.getLastChild()) { tabs.add(new TabConfig(tabConf)); } } catch (NodeNotFoundException e) { throw new FormModelException(L.m("Schlüssel 'Fenster' fehlt in %1", conf.getName()), e); } try { plausiMarkerColor = Color .decode(conf.get("PLAUSI_MARKER_COLOR", 1).getLastChild().toString()); } catch (Exception x) { plausiMarkerColor = Color.RED; } try { ConfigThingy visibilityDesc = conf.query("Sichtbarkeit"); if (visibilityDesc.count() > 0) { visibilityDesc = visibilityDesc.getLastChild(); } for (ConfigThingy visRule : visibilityDesc) { visiblities.add(new VisibilityGroupConfig(visRule)); } } catch (NodeNotFoundException x) { LOGGER.error("", x); } } FormConfig(ConfigThingy conf, String frameTitle); String getTitle(); List<TabConfig> getTabs(); List<VisibilityGroupConfig> getVisibilities(); Color getPlausiMarkerColor(); Stream<UIElementConfig> getControls(); }
FormConfig { public FormConfig(ConfigThingy conf, String frameTitle) throws FormModelException { String formTitle = conf.getString("TITLE", L.m("Unbenanntes Formular")); if (frameTitle != null) { title = frameTitle + " - " + formTitle; } else { title = formTitle; } final ConfigThingy fensterDesc = conf.query("Fenster"); try { for (ConfigThingy tabConf : fensterDesc.getLastChild()) { tabs.add(new TabConfig(tabConf)); } } catch (NodeNotFoundException e) { throw new FormModelException(L.m("Schlüssel 'Fenster' fehlt in %1", conf.getName()), e); } try { plausiMarkerColor = Color .decode(conf.get("PLAUSI_MARKER_COLOR", 1).getLastChild().toString()); } catch (Exception x) { plausiMarkerColor = Color.RED; } try { ConfigThingy visibilityDesc = conf.query("Sichtbarkeit"); if (visibilityDesc.count() > 0) { visibilityDesc = visibilityDesc.getLastChild(); } for (ConfigThingy visRule : visibilityDesc) { visiblities.add(new VisibilityGroupConfig(visRule)); } } catch (NodeNotFoundException x) { LOGGER.error("", x); } } FormConfig(ConfigThingy conf, String frameTitle); String getTitle(); List<TabConfig> getTabs(); List<VisibilityGroupConfig> getVisibilities(); Color getPlausiMarkerColor(); Stream<UIElementConfig> getControls();  }