Package org.apache.geronimo.gshell.layout.model

Examples of org.apache.geronimo.gshell.layout.model.AliasNode


            CommandNode cn = new CommandNode(name, command.getId());
            gn.add(cn);

            for (int i = 0; i < aliases.length; i++) {
                if (!name.equals(aliases[i])) {
                    AliasNode an = new AliasNode(aliases[i], ALIAS_PREFIX + command.getId());
                    gn.add(an);
                }
            }

            register(command);
View Full Code Here


                } catch (NotRegisteredException e) {
                    // Ignore those exceptions (command will not be displayed)
                }
            }
            else if (child instanceof AliasNode) {
                AliasNode node = (AliasNode) child;
                String name = StringUtils.rightPad(node.getName(), maxNameLen);

                io.out.print("  ");
                io.out.print(renderer.render(Renderer.encode(name, Code.BOLD)));
                io.out.print("  ");

                io.out.print("Alias to: ");
                io.out.println(renderer.render(Renderer.encode(node.getCommand(), Code.BOLD)));
            }
        }

        io.out.println();

        // Then groups
        for (Node child : group.nodes()) {
            if (child instanceof GroupNode) {
                GroupNode node = (GroupNode) child;

                io.out.print("  ");
                io.out.println(renderer.render(Renderer.encode(node.getPath(), Code.BOLD)));

                io.out.println();
                displayGroupCommands(node);
                io.out.println();
            }
View Full Code Here

                } catch (NotRegisteredException e) {
                    // Ignore those exceptions (command will not be displayed)
                }
            }
            else if (child instanceof AliasNode) {
                AliasNode node = (AliasNode) child;
                String name = StringUtils.rightPad(node.getName(), maxNameLen);

                io.out.print("  ");
                io.out.print(renderer.render(Renderer.encode(name, Code.BOLD)));
                io.out.print("  ");

                io.out.print("Alias to: ");
                io.out.println(renderer.render(Renderer.encode(node.getCommand(), Code.BOLD)));
            }
        }

        io.out.println();

        // Then groups
        for (Node child : group.nodes()) {
            if (child instanceof GroupNode) {
                GroupNode node = (GroupNode) child;

                io.out.print("  ");
                io.out.println(renderer.render(Renderer.encode(node.getPath(), Code.BOLD)));

                io.out.println();
                displayGroupCommands(node);
                io.out.println();
            }
View Full Code Here

                } catch (NotRegisteredException e) {
                    // Ignore those exceptions (command will not be displayed)
                }
            }
            else if (child instanceof AliasNode) {
                AliasNode node = (AliasNode) child;
                String name = StringUtils.rightPad(node.getName(), maxNameLen);
                String cmd = layoutManager.findNode(group, node.getCommand()).getName();

                io.out.print("  ");
                io.out.print(renderer.render(Renderer.encode(name, Code.BOLD)));
                io.out.print("  ");

                io.out.print("Alias to: ");

                io.out.println(renderer.render(Renderer.encode(cmd, Code.BOLD)));
            } else if (child instanceof GroupNode) {
                hasShells = true;
            }
        }

        io.out.println();

        if (hasShells) {
            io.out.println("Available shells:");
            // Then groups
            for (Node child : nodes) {
                if (child instanceof GroupNode) {
                    GroupNode node = (GroupNode) child;
                    io.out.print("  ");
                    io.out.println(renderer.render(Renderer.encode(node.getName(), Code.BOLD)));
                }
            }
            io.out.println();
        }
    }
View Full Code Here

            CommandNode cn = new CommandNode(name, command.getId());
            gn.add(cn);

            for (int i = 0; i < aliases.length; i++) {
                if (!name.equals(aliases[i])) {
                    AliasNode an = new AliasNode(aliases[i], ALIAS_PREFIX + command.getId());
                    gn.add(an);
                }
            }

            register(command);
View Full Code Here

            CommandNode cn = new CommandNode(name, command.getId());
            gn.add(cn);

            for (int i = 0; i < aliases.length; i++) {
                if (!name.equals(aliases[i])) {
                    AliasNode an = new AliasNode(aliases[i], ALIAS_PREFIX + command.getId());
                    gn.add(an);
                }
            }

            register(command);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.gshell.layout.model.AliasNode

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.