Package slash.navigation.catalog.model

Examples of slash.navigation.catalog.model.CategoryTreeNode


            }

            public void run() throws IOException {
                final List<CategoryTreeNode> categories = new ArrayList<CategoryTreeNode>();
                for (int i = 0; i < parents.size(); i++) {
                    CategoryTreeNode parent = parents.get(i);
                    Category category = parent.getCategory().create(names.get(i));
                    categories.add(new CategoryTreeNodeImpl(category));
                }

                invokeLater(new Runnable() {
                    public void run() {
                        for (int i = 0; i < parents.size(); i++) {
                            CategoryTreeNode parent = parents.get(i);
                            CategoryTreeNode category = categories.get(i);
                            categoryTreeModel.insertNodeInto(category, parent, 0);
                        }
                        if (invokeLaterRunnable != null)
                            invokeLaterRunnable.run();
                    }
View Full Code Here


                return "MoveCategories";
            }

            public void run() throws IOException {
                for (int i = 0; i < categories.size(); i++) {
                    CategoryTreeNode category = categories.get(i);
                    CategoryTreeNode parent = parents.get(i);

                    if (category.isLocal() && parent.isRemote())
                        throw new IOException("cannot move local category " + category.getName() + " to remote parent " + parent.getName());
                    if (category.isRemote() && parent.isLocal())
                        throw new IOException("cannot move remote category " + category.getName() + " to local parent " + parent.getName());

                    category.getCategory().update(parent.getCategory(), category.getCategory().getName());
                }

                invokeLater(new Runnable() {
                    public void run() {
                        for (int i = 0; i < categories.size(); i++) {
                            CategoryTreeNode category = categories.get(i);
                            CategoryTreeNode parent = parents.get(i);
                            categoryTreeModel.removeNodeFromParent(category);
                            categoryTreeModel.insertNodeInto(category, parent, 0);
                        }
                        if (invokeLaterRunnable != null)
                            invokeLaterRunnable.run();
View Full Code Here

                return "RemoveCategories";
            }

            public void run() throws IOException {
                for (int i = 0; i < parents.size(); i++) {
                    CategoryTreeNode category = categoryTreeModel.getChild(parents.get(i), names.get(i));

                    if (category.isLocalRoot() || category.isRemoteRoot())
                        throw new IOException("cannot remove category root");

                    category.getCategory().delete();
                }

                invokeLater(new Runnable() {
                    public void run() {
                        for (int i = 0; i < parents.size(); i++) {
                            CategoryTreeNode category = categoryTreeModel.getChild(parents.get(i), names.get(i));
                            categoryTreeModel.removeNodeFromParent(category);
                        }
                        if (invokeLaterRunnable != null)
                            invokeLaterRunnable.run();
                    }
View Full Code Here

            }

            public void run() throws IOException {
                for (int i = 0; i < routes.size(); i++) {
                    RouteModel route = routes.get(i);
                    CategoryTreeNode parent = parents.get(i);
                    CategoryTreeNode category = route.getCategory();

                    if (category.isLocal() && parent.isRemote())
                        throw new IOException("cannot move local route " + route.getName() + " to remote parent " + parent.getName());
                    if (category.isRemote() && parent.isLocal())
                        throw new IOException("cannot move remote route " + route.getName() + " to local parent " + parent.getName());

                    route.getRoute().update(parent.getCategory(), route.getDescription() != null ? route.getDescription() : route.getName());
                }
View Full Code Here

TOP

Related Classes of slash.navigation.catalog.model.CategoryTreeNode

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.