1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | try { // Gain access to a XUI builder through factory // In this framework the term XUI is going to represent the custom DOM XUIBuilder builder = XUIBuilderFactory.getInstance().getXUIBuilder(); // (1) // Validate and parse (unmarshal) the XML document builder.parse("browser.xml"); // (2) // Build a custom DOM XUI xui = builder.getXUIDocument(); // (3) // Create 1:1 GUI component mapping to custom DOM xui.visualize(); // (4) (5) // Create bindings to data model (i.e. JAR file from Resource element) xui.bind(); // (6) // Get root node from the XUI document XUINode root = xui.getRoot(); // Save a copy of the DOM to file (marshal) xui.marshalXUI("browser-marshalled.xml"); } catch (XUIParseException xpe) { xpe.printStackTrace(); } catch (XUIBindingException xbe) { xbe.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |