Package java.beans

Examples of java.beans.XMLDecoder$Elem


        e.close();
        return os.toByteArray();
    }

    protected MultiSplitLayout.Split decode(byte[] bytes) {
        XMLDecoder d = new XMLDecoder(new ByteArrayInputStream(bytes));
        return (MultiSplitLayout.Split) (d.readObject());
    }
View Full Code Here


            // Load layout
            Element modelElement = getElement(element, "layout");
            if (modelElement != null && !toolWindowManager.getContentManager().isEnabled()) {
                String text = modelElement.getTextContent();
                XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(text.getBytes()));
                final MultiSplitLayout.Node model = (MultiSplitLayout.Node) decoder.readObject();

                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        MultiSplitDockableContainer dockableContainer = (MultiSplitDockableContainer) ((ContentPanel) context.get(MyDoggyToolWindowManager.class).getMainContent()).getComponent();
                        dockableContainer.setModel(model);
View Full Code Here

            toolWindowBar.setAggregateMode(getBoolean(element, "aggregateMode", false));

            Element layoutElement = getElement(element, "layout");
            if (layoutElement != null) {
                String layoutAsText = layoutElement.getTextContent();
                XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(layoutAsText.getBytes()));
                final MultiSplitLayout.Node layout = (MultiSplitLayout.Node) decoder.readObject();

                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        ((MyDoggyToolWindowBar) context.get(ToolWindowManager.class).getToolWindowBar(anchor)).setLayout(layout);
                    }
View Full Code Here

        public boolean parse(Element element, final Context context) {

            Element modelElement = getElement(element, "model");
            if (modelElement != null) {
                String text = modelElement.getTextContent();
                XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(text.getBytes()));
                final MultiSplitLayout.Node model = (MultiSplitLayout.Node) decoder.readObject();

                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        MultiSplitDockableContainer dockableContainer = (MultiSplitDockableContainer) ((ContentPanel) context.get(MyDoggyToolWindowManager.class).getMainContent()).getComponent();
                        dockableContainer.setModel(model);
View Full Code Here

                // Load layout
                Element layout = getElement(element, "layout");
                MyDoggyMultiSplitContentManagerUI myDoggyMultiSplitContentManagerUI = (MyDoggyMultiSplitContentManagerUI) managerUI;

                String text = layout.getTextContent();
                XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(text.getBytes()));
                myDoggyMultiSplitContentManagerUI.setLayout(decoder.readObject());
            }

            return false;
        }
View Full Code Here

            ToolWindowAnchor anchor = ToolWindowAnchor.valueOf(element.getAttribute("anchor"));

            Element modelElement = getElement(element, "model");
            if (modelElement != null) {
                String text = modelElement.getTextContent();
                XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(text.getBytes()));
                MultiSplitLayout.Node model = (MultiSplitLayout.Node) decoder.readObject();

                toolWindowManager.getBar(anchor).getToolsContainer().setModel(model);
            }

            return false;
View Full Code Here

        ClassLoader bundleClassLoader = this.getClass().getClassLoader();
        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(bundleClassLoader);

        try {
            XMLDecoder d = new XMLDecoder(new ByteArrayInputStream(bytes));
            Node node = (Node) (d.readObject());

            return node;
        } finally {
            // Restore
            Thread.currentThread().setContextClassLoader(originalClassLoader);
View Full Code Here

                    Element modelElement = getElement(element, "layout");
                    if (modelElement == null)
                        continue;

                    String text = modelElement.getTextContent();
                    XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(text.getBytes()));
                    final MultiSplitLayout.Node model = (MultiSplitLayout.Node) decoder.readObject();

                    sharedWindows.addSharedWindow(model, ids);
                }
            }
View Full Code Here

                    Element modelElement = getElement(element, "layout");
                    if (modelElement == null)
                        continue;

                    String text = modelElement.getTextContent();
                    XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(text.getBytes()));
                    final MultiSplitLayout.Node model = (MultiSplitLayout.Node) decoder.readObject();

                    sharedWindows.addSharedWindow(model, ids);
                }
            }


            // Load contents..
            NodeList contents = element.getElementsByTagName("content");

            Content selectedContent = null;
            Content maximizedContent = null;

            // load contents properties
            for (int i = 0, size = contents.getLength(); i < size; i++) {
                Element contentElement = (Element) contents.item(i);

                String contentId = contentElement.getAttribute("id");

                Content content = context.get(ToolWindowManager.class).getContentManager().getContent(contentId);
                if (content == null)
                    content = context.get(PersistenceDelegateCallback.class).contentNotFound(context.get(ToolWindowManager.class),
                            contentId,
                            node.setElement(contentElement));

                if (content != null) {
                    if (getBoolean(context, contentElement, "selected", false))
                        selectedContent = content;
                    if (getBoolean(context, contentElement, "maximized", false))
                        maximizedContent = content;

                    content.setEnabled(getBoolean(context, contentElement, "enabled", true));
                    boolean detached = getBoolean(context, contentElement, "detached", false);
                    content.setMaximized(false);
                    content.setMinimized(getBoolean(context, contentElement, "minimized", false));
                    content.setFlashing(getBoolean(context, contentElement, "flashing", false));

                    // Load "minimizedState" sub element if any
                    Element minimizedStateElem = getElement(contentElement, "minimizedState");
                    if (minimizedStateElem != null && content.isMinimized()) {
                        ContentDescriptor contentDescriptor = (ContentDescriptor) toolWindowManager.getDockableDescriptor(content.getId());
                        contentDescriptor.setAnchor(getToolWindowAnchor(context, minimizedStateElem, "anchor", ToolWindowAnchor.LEFT),
                                getInteger(context, minimizedStateElem, "anchorIndex", -1)
                        );
                    }


                    // Load contentUI
                    ContentUI contentUI = content.getContentUI();
                    contentUI.setCloseable(getBoolean(context, contentElement, "closeable", true));
                    contentUI.setDetachable(getBoolean(context, contentElement, "detachable", true));
                    contentUI.setMinimizable(getBoolean(context, contentElement, "minimizable", true));
                    contentUI.setMaximizable(getBoolean(context, contentElement, "maximizable", true));
                    contentUI.setTransparentMode(getBoolean(context, contentElement, "transparentMode", true));
                    contentUI.setTransparentDelay(getInteger(context, contentElement, "transparentDelay", 0));
                    contentUI.setTransparentRatio(getFloat(context, contentElement, "transparentRatio", 0.7f));
                    contentUI.setAddToTaskBarWhenDetached(getBoolean(context, contentElement, "addToTaskBarWhenDetached", false));
                    contentUI.setAlwaysOnTop(getBoolean(context, contentElement, "alwaysOnTop", false));

                    // Load detachedBounds if any
                    NodeList list = contentElement.getElementsByTagName("detachedBounds");
                    if (list.getLength() > 0) {
                        Element detachedBoundsElm = (Element) list.item(0);
                        contentUI.setDetachedBounds(new Rectangle(getInteger(context, detachedBoundsElm, "x", 100),
                                getInteger(context, detachedBoundsElm, "y", 100),
                                getInteger(context, detachedBoundsElm, "width", 320),
                                getInteger(context, detachedBoundsElm, "height", 200)));
                    }

                    if (detached) {
                        if (sharedWindows.isInSharedWindow(content)) {
                            Dockable refDockable = sharedWindows.getRefDockable(content);

                            if (refDockable != null)
                                content.detachByReference((Content) refDockable, AggregationPosition.DEFAULT);
                            else
                                content.setDetached(true);
                        } else
                            content.setDetached(true);
                    } else
                        content.setDetached(false);
                }
            }

            // Load layout
            Element modelElement = getElement(element, "layout");
            if (modelElement != null && !toolWindowManager.getContentManager().isEnabled()) {
                String text = modelElement.getTextContent();
                XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(text.getBytes()));
                final MultiSplitLayout.Node model = (MultiSplitLayout.Node) decoder.readObject();

                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        MultiSplitDockableContainer dockableContainer = (MultiSplitDockableContainer) ((DockableDropPanel) context.get(MyDoggyToolWindowManager.class).getMainContent()).getComponent();
                        dockableContainer.setMultiSplitLayout(model);
View Full Code Here

            toolWindowBar.setLength(getInteger(context, element, "length", 23));

            Element layoutElement = getElement(element, "layout");
            if (layoutElement != null) {
                String layoutAsText = layoutElement.getTextContent();
                XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(layoutAsText.getBytes()));

                final MultiSplitLayout.Node layout = (MultiSplitLayout.Node) decoder.readObject();

                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        ((MyDoggyToolWindowBar) context.get(ToolWindowManager.class).getToolWindowBar(anchor)).setLayout(layout);
                    }
View Full Code Here

TOP

Related Classes of java.beans.XMLDecoder$Elem

Copyright © 2018 www.massapicom. 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.