Examples of KongaTreeNode


Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

            return build(new ArrayList<TableRelationship>());
        }

        public KongaTreeModel build(List<TableRelationship> relationships) {
            createNodes(relationships);
            KongaTreeNode root = createRoot();
            return new DefaultKongaTreeModel(root);
        }
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

            return new DefaultKongaTreeModel(root);
        }
        private void createNodes(List<TableRelationship> relationships) {
            nodes = Maps.newLinkedHashMap();
            for (TableRelationship r : relationships) {
                KongaTreeNode parentNode = getNode(r.getParentObject());
                KongaTreeNode childNode = getNode(r.getChildObject());
                parentNode.addChild(childNode);
            }
            addBackTopLevelNodes();
        }
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

                }
            }
        }
       
        private KongaTreeNode getNode(DatabaseObject o) {
            KongaTreeNode node = nodes.get(o);
            if (node == null) {
                node = new DefaultKongaTreeNode(o, true);
                nodes.put(o, node);
            }
            return node;
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

            }
            return node;
        }

        private KongaTreeNode createRoot() {
            KongaTreeNode root = createEmptyRootNode();
            for (KongaTreeNode node : nodes.values()) {
                if (node.getParent() == null) {
                    root.addChild(node);
                }
            }
            return root;
        }
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

    }

    @Override
    public PrimaryKeys[] getPrimaryKeys() {
        List<PrimaryKeys> pks = Lists.newArrayList();
        KongaTreeNode root = treeModel.getRoot();
        for (int n = 0, nmax = root.getChildCount(); n < nmax; ++n) {
            pks.add(new PrimaryKeysImpl((TableNode) root.getChildAt(n)));
        }
        return pks.toArray(new PrimaryKeys[pks.size()]);
    }
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

       
        @Override
        public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded,
                        boolean leaf, int row, boolean hasFocus) {
            super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
            KongaTreeNode node = (KongaTreeNode) value;
            Object userObject = node.getUserObject();
            if (userObject instanceof DatabaseObject) {
                setText(getText((DatabaseObject) userObject));
            }
            checkValidState(tree, node, sel);
            return this;
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

        private TableNode getSelectedTableNode() {
            List<KongaTreeNode> selection = tree.getSelectedNodes();
            if (selection.isEmpty()) {
                return null;
            }
            KongaTreeNode node = selection.get(0);
            while (!(node instanceof TableNode)) {
                node = node.getParent();
            }
            return (TableNode) node;
        }
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

        public void actionPerformed(ActionEvent e) {
            removeAllKeys();
        }

        private void removeAllKeys() {
            KongaTreeNode root = treeModel.getRoot();
            for (int n = 0, nmax = root.getChildCount(); n < nmax; ++n) {
                TableNode node = (TableNode) root.getChildAt(n);
                node.setSelectedKeys(null);
            }
            rebuildModel();
        }
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

        private KeyNode getSelectedKeyNode() {
            List<KongaTreeNode> selection = tree.getSelectedNodes();
            if (selection.size() != 1) {
                return null;
            }
            KongaTreeNode selected = selection.get(0);
            return (selected instanceof KeyNode) ? (KeyNode) selected : null;
        }
View Full Code Here

Examples of org.jitterbit.ui.widget.tree.KongaTreeNode

        }

        private void removeKey(KeyNode node) {
            TableNode parent = (TableNode) node.getParent();
            boolean isFirst = (node == parent.getFirstChild());
            KongaTreeNode toBeSelected = isFirst ? (KeyNode) node.getNextSibling() : (KeyNode) node.getPreviousSibling();
            if (toBeSelected == null) {
                toBeSelected = parent;
            }
            parent.removeKey(node);
            if (parent.getChildCount() == 0) {
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.