Package org.flexdock.docking.state

Examples of org.flexdock.docking.state.DockingPath


* @version $Id: DockingPathSerializer.java,v 1.8 2005-07-06 18:10:48 winnetou25 Exp $
*/
public class DockingPathSerializer implements ISerializer {

    public Element serialize(Document document, Object object) {
        DockingPath dockingPath = (DockingPath) object;

        Element dockingPathElement = document.createElement(PersistenceConstants.DOCKING_PATH_ELEMENT_NAME);
        dockingPathElement.setAttribute(PersistenceConstants.DOCKING_PATH_ATTRIBUTE_ROOT_PORT_ID, dockingPath.getRootPortId());

        if (dockingPath.getSiblingId() != null && !dockingPath.getSiblingId().equals("")) {
            dockingPathElement.setAttribute(PersistenceConstants.DOCKING_PATH_ATTRIBUTE_SIBLING_ID, dockingPath.getSiblingId());
        }

        if (dockingPath.isTabbed()) {
            dockingPathElement.setAttribute(PersistenceConstants.DOCKING_PATH_ATTRIBUTE_IS_TABBED, String.valueOf(dockingPath.isTabbed()));
        }

        List splitNodes = dockingPath.getNodes();
        ISerializer splitNodeSerializer = SerializerRegistry.getSerializer(SplitNode.class);
        for (Iterator it = splitNodes.iterator(); it.hasNext();) {
            SplitNode splitNode = (SplitNode) it.next();
            Element splitNodeElement = splitNodeSerializer.serialize(document, splitNode);
            dockingPathElement.appendChild(splitNodeElement);
View Full Code Here


        return dockingPathElement;
    }

    public Object deserialize(Element element) {
        //DockingState dockingState = (DockingState) deserializationStack.popObject();
        DockingPath dockingPath = new DockingPath();

        String dockingPathRootPortId = element.getAttribute(PersistenceConstants.DOCKING_PATH_ATTRIBUTE_ROOT_PORT_ID);
        String siblingId = element.getAttribute(PersistenceConstants.DOCKING_PATH_ATTRIBUTE_SIBLING_ID);
        String isTabbed = element.getAttribute(PersistenceConstants.DOCKING_PATH_ATTRIBUTE_IS_TABBED);

        dockingPath.setRootPortId(dockingPathRootPortId);
        if (siblingId != null && !"".equals(siblingId)) {
            dockingPath.setSiblingId(siblingId);
        }
        if (isTabbed != null && !"".equals(isTabbed)) {
            dockingPath.setTabbed(Boolean.valueOf(isTabbed).booleanValue());
        } else {
            dockingPath.setTabbed(false);
        }

        ISerializer layoutNodeSerializer = SerializerRegistry.getSerializer(LayoutNode.class);
        NodeList splitNodeList = element.getElementsByTagName(PersistenceConstants.SPLIT_NODE_ELEMENT_NAME);
        if (splitNodeList.getLength() > 0 && splitNodeList.item(0) instanceof Element) {
            Element splitNodeElement = (Element) splitNodeList.item(0);
            SplitNode splitNode = (SplitNode) layoutNodeSerializer.deserialize(splitNodeElement);
            dockingPath.getNodes().add(splitNode);
        }

        return dockingPath;
    }
View Full Code Here

        ISerializer dockingPathDeserializer = SerializerRegistry.getSerializer(DockingPath.class);
        NodeList dockingPathNodeList = element.getElementsByTagName(PersistenceConstants.DOCKING_PATH_ELEMENT_NAME);
        if (dockingPathNodeList.getLength() > 0 && dockingPathNodeList.item(0) instanceof Element) {
            Element dockingPathElement = (Element) dockingPathNodeList.item(0);
            DockingPath dockingPath = (DockingPath) dockingPathDeserializer.deserialize(dockingPathElement);
            dockingState.setPath(dockingPath);
        }

        return dockingState;
    }
View Full Code Here

            return;
        }

        // now restore to the current layout
        final DockingState dockingState = DockingManager.getDockingState(dockable);
        final DockingPath dockingPath = dockingState.getPath();
        boolean restoreResult = false;

        if (dockingPath != null) {
            restoreResult = dockingPath.restore(dockable);
        } else {
            restoreResult = RestorationManager.getInstance().restore(dockable);
        }

        if (restoreResult) {
View Full Code Here

* @version $Id: DockPathHandler.java,v 1.2 2005-06-04 16:42:21 winnetou25 Exp $
*/
public class DockPathHandler implements RestorationHandler {

    public boolean restore(Dockable dockable, DockingState dockingState, Map context) {
        DockingPath dockingPath = dockingState.getPath();
        if (dockingPath == null) {
            return false;
        }

        return dockingPath.restore(dockable);
    }
View Full Code Here

        info.setCenter(p);
    }

    private void updateDockingPath(Dockable dockable) {
        DockingState info = getDockingState(dockable);
        DockingPath path = DockingPath.create(dockable);
        info.setPath(path);
    }
View Full Code Here

TOP

Related Classes of org.flexdock.docking.state.DockingPath

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.