Package org.apache.pivot.beans

Examples of org.apache.pivot.beans.BXMLSerializer.readObject()


                BXMLSerializer bxmlSerializer = new BXMLSerializer();
                bxmlSerializer.getNamespace().put("menuHandler", menuHandler);

                Component tab;
                try {
                    tab = (BXMLExplorerDocument) bxmlSerializer.readObject(
                        BXMLExplorerWindow.class, "bxml_explorer_document.bxml");
                } catch (IOException exception) {
                    throw new RuntimeException(exception);
                } catch (SerializationException exception) {
                    throw new RuntimeException(exception);
View Full Code Here


                        BXMLSerializer bxmlSerializer = new BXMLSerializer();
                        bxmlSerializer.getNamespace().put("menuHandler", menuHandler);

                        Component tab;
                        try {
                            BXMLExplorerDocument explorerDoc = (BXMLExplorerDocument) bxmlSerializer.readObject(
                                BXMLExplorerWindow.class, "bxml_explorer_document.bxml");
                            explorerDoc.load(f);
                            tab = explorerDoc;
                        } catch (RuntimeException exception) {
                            exception.printStackTrace();
View Full Code Here

                        throw new RuntimeException(exception);
                    }

                    BXMLSerializer bxmlSerializer = new BXMLSerializer();
                    try {
                        component = (Component)bxmlSerializer.readObject(url);
                    } catch (IOException exception) {
                        throw new RuntimeException(exception);
                    } catch (SerializationException exception) {
                        throw new RuntimeException(exception);
                    }
View Full Code Here

    private Window window = null;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        window = (Window)bxmlSerializer.readObject(ResolveTest.class, "resolve_test.bxml", true);
        window.open(display);
    }

    @Override
    public boolean shutdown(boolean optional) {
View Full Code Here

    public static final String CLASS_PROPERTY = "class";

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        window = (ComponentExplorerWindow)bxmlSerializer.readObject(ComponentExplorer.class,
            "component_explorer_window.bxml", true);
        window.setClassProperty(properties.get(CLASS_PROPERTY));
        window.open(display);
    }
View Full Code Here

    public void load(File f) throws IOException, SerializationException, ParserConfigurationException, SAXException {
        BXMLSerializer serializer = new BXMLSerializer();
        serializer.setLocation(f.toURI().toURL());
        final FileInputStream in = new FileInputStream(f);
        try {
            Object obj = serializer.readObject(in);
            if (!(obj instanceof Component)) {
                throw new IllegalStateException("obj " + obj + " is of class " + obj.getClass()
                    + " which is not a subtype of Component");
            }
            // create an inverse map so we can IDs for widgets
View Full Code Here


    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        window = (BXMLExplorerWindow)bxmlSerializer.readObject(BXMLExplorer.class,
            "bxml_explorer_window.bxml", true);
        window.open(display);
    }

    @Override
View Full Code Here

    @BXML private Menu.Section hoursSection;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        window = (Window)bxmlSerializer.readObject(ContextMenuTest.class,
            "context_menu_test.bxml");
        bxmlSerializer.bind(this, ContextMenuTest.class);

        window.setMenuHandler(new MenuHandler.Adapter() {
            @Override
View Full Code Here

    private Window window = null;

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        window = (Window)bxmlSerializer.readObject(DataBindingTest.class, "data_binding_test.bxml");
        window.open(display);

        HashMap<String, Object> context = new HashMap<String, Object>();
        context.put("id1", "1");
        context.put("id2", "2");
View Full Code Here

                }
            }
        }

        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        window = (Window)bxmlSerializer.readObject(Localization.class.getResource("localization.bxml"), resources);
        window.open(display);
    }

    @Override
    public boolean shutdown(boolean optional) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.