Package org.jboss.as.console.client.domain.topology

Examples of org.jboss.as.console.client.domain.topology.HtmlGenerator


    @Override
    public void updateHosts(SortedSet<ServerGroup> groups, final int index)
    {
        // validation
        HtmlGenerator html = new HtmlGenerator();
        if (groups == null || groups.isEmpty())
        {
            // no server/groups available ...
            Hint blank = new Hint(Console.MESSAGES.topology_no_server());
            container.clear();
            container.insert(blank, 0);
            return;
        }


        // initialization
        assignColors(groups);
        List<HostInfo> hosts = groups.first().getHosts();
        this.hostSize = hosts.size();
        this.visibleHosts = min(TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);
        this.hostIndex = index;
        this.hostIndex = max(0, this.hostIndex);
        this.hostIndex = min(this.hostIndex, this.hostSize - 1);
        int endIndex = min(this.hostIndex + TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);

        // start table and add columns
        html.startTable().appendHtmlConstant("<colgroup>");
        int columnWidth = HOSTS_COLUMNS / (endIndex - this.hostIndex);
        html.appendColumn(SERVER_GROUPS_COLUMN);
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            html.appendColumn(columnWidth);
        }
        html.appendHtmlConstant("</colgroup>");

        // first row contains host names
        html.appendHtmlConstant("<thead><tr><th class='cellTableHeader'>Hosts&nbsp;&rarr;<br/>Groups&nbsp;&darr;</th>");
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            HostInfo host = hosts.get(i);
            html.appendHost(host);
        }
        html.appendHtmlConstant("</tr></thead>");

        // remaining rows contain server groups and server instances
        html.appendHtmlConstant("<tbody>");
        for (ServerGroup group : groups)
        {
            for (int serverIndex = 0; serverIndex < group.maxServersPerHost; serverIndex++)
            {
                html.appendHtmlConstant("<tr>");
                if (serverIndex == 0)
                {
                    html.appendServerGroup(group);
                }
                for (int i = this.hostIndex; i < endIndex; i++)
                {
                    HostInfo host = hosts.get(i);
                    List<ServerInstance> servers = group.serversPerHost.get(host);
                    if (servers.isEmpty() || serverIndex >= servers.size())
                    {
                        html.emptyCell();
                    }
                    else
                    {
                        html.appendServer(group, host.getName(), servers.get(serverIndex));
                    }
                }
                html.appendHtmlConstant("</tr>");
            }
        }
        html.appendHtmlConstant("</tbody>").endTable();

        // create html panel and register events
        HTMLPanel panel = html.createPanel();
        for (String id : html.getLifecycleIds())
        {
            com.google.gwt.user.client.Element element = panel.getElementById(id);
            if (element != null)
            {
                DOM.setEventListener(element, lifecycleLinkListener);
View Full Code Here


    @Override
    public void updateHosts(SortedSet<ServerGroup> groups, final int index)
    {
        // validation
        HtmlGenerator html = new HtmlGenerator();
        if (groups == null || groups.isEmpty())
        {
            // TODO Add "no data" html
            return;
        }

        // initialization
        assignColors(groups);
        List<HostInfo> hosts = groups.first().getHosts();
        this.hostSize = hosts.size();
        this.visibleHosts = min(TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);
        this.hostIndex = index;
        this.hostIndex = max(0, this.hostIndex);
        this.hostIndex = min(this.hostIndex, this.hostSize - 1);
        int endIndex = min(this.hostIndex + TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);

        // start table and add columns
        html.startTable().appendHtmlConstant("<colgroup>");
        int columnWidth = HOSTS_COLUMNS / (endIndex - this.hostIndex);
        html.appendColumn(SERVER_GROUPS_COLUMN);
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            html.appendColumn(columnWidth);
        }
        html.appendHtmlConstant("</colgroup>");

        // first row contains host names
        html.appendHtmlConstant("<thead><tr><th class='cellTableHeader'>Hosts&nbsp;&rarr;<br/>Groups&nbsp;&darr;</th>");
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            HostInfo host = hosts.get(i);
            html.appendHost(host);
        }
        html.appendHtmlConstant("</tr></thead>");

        // remaining rows contain server groups and server instances
        html.appendHtmlConstant("<tbody>");
        for (ServerGroup group : groups)
        {
            for (int serverIndex = 0; serverIndex < group.maxServersPerHost; serverIndex++)
            {
                html.appendHtmlConstant("<tr>");
                if (serverIndex == 0)
                {
                    html.appendServerGroup(group);
                }
                for (int i = this.hostIndex; i < endIndex; i++)
                {
                    HostInfo host = hosts.get(i);
                    List<ServerInstance> servers = group.serversPerHost.get(host);
                    if (servers.isEmpty() || serverIndex >= servers.size())
                    {
                        html.emptyCell();
                    }
                    else
                    {
                        html.appendServer(group, host.getName(), servers.get(serverIndex));
                    }
                }
                html.appendHtmlConstant("</tr>");
            }
        }
        html.appendHtmlConstant("</tbody>").endTable();

        // create html panel and register events
        HTMLPanel panel = html.createPanel();
        for (String id : html.getLifecycleIds())
        {
            com.google.gwt.user.client.Element element = panel.getElementById(id);
            if (element != null)
            {
                DOM.setEventListener(element, lifecycleLinkListener);
View Full Code Here

    @Override
    public void updateHosts(SortedSet<ServerGroup> groups, final int index)
    {
        // validation
        HtmlGenerator html = new HtmlGenerator();
        if (groups == null || groups.isEmpty())
        {
            // no server/groups available ...
            Hint blank = new Hint("No server available!");
            container.clear();
            container.insert(blank, 0);
            return;
        }


        // initialization
        assignColors(groups);
        List<HostInfo> hosts = groups.first().getHosts();
        this.hostSize = hosts.size();
        this.visibleHosts = min(TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);
        this.hostIndex = index;
        this.hostIndex = max(0, this.hostIndex);
        this.hostIndex = min(this.hostIndex, this.hostSize - 1);
        int endIndex = min(this.hostIndex + TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);

        // start table and add columns
        html.startTable().appendHtmlConstant("<colgroup>");
        int columnWidth = HOSTS_COLUMNS / (endIndex - this.hostIndex);
        html.appendColumn(SERVER_GROUPS_COLUMN);
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            html.appendColumn(columnWidth);
        }
        html.appendHtmlConstant("</colgroup>");

        // first row contains host names
        html.appendHtmlConstant("<thead><tr><th class='cellTableHeader'>Hosts&nbsp;&rarr;<br/>Groups&nbsp;&darr;</th>");
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            HostInfo host = hosts.get(i);
            html.appendHost(host);
        }
        html.appendHtmlConstant("</tr></thead>");

        // remaining rows contain server groups and server instances
        html.appendHtmlConstant("<tbody>");
        for (ServerGroup group : groups)
        {
            for (int serverIndex = 0; serverIndex < group.maxServersPerHost; serverIndex++)
            {
                html.appendHtmlConstant("<tr>");
                if (serverIndex == 0)
                {
                    html.appendServerGroup(group);
                }
                for (int i = this.hostIndex; i < endIndex; i++)
                {
                    HostInfo host = hosts.get(i);
                    List<ServerInstance> servers = group.serversPerHost.get(host);
                    if (servers.isEmpty() || serverIndex >= servers.size())
                    {
                        html.emptyCell();
                    }
                    else
                    {
                        html.appendServer(group, host.getName(), servers.get(serverIndex));
                    }
                }
                html.appendHtmlConstant("</tr>");
            }
        }
        html.appendHtmlConstant("</tbody>").endTable();

        // create html panel and register events
        HTMLPanel panel = html.createPanel();
        for (String id : html.getLifecycleIds())
        {
            com.google.gwt.user.client.Element element = panel.getElementById(id);
            if (element != null)
            {
                DOM.setEventListener(element, lifecycleLinkListener);
View Full Code Here

    @Override
    public void updateHosts(SortedSet<ServerGroup> groups, final int index)
    {
        // validation
        HtmlGenerator html = new HtmlGenerator();
        if (groups == null || groups.isEmpty())
        {
            // no server/groups available ...
            HTML blank = new HTML("There don't seem to be any servers configured on this system.");
            container.clear();
            container.insert(blank, 0);
            return;
        }


        // initialization
        assignColors(groups);
        List<HostInfo> hosts = groups.first().getHosts();
        this.hostSize = hosts.size();
        this.visibleHosts = min(TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);
        this.hostIndex = index;
        this.hostIndex = max(0, this.hostIndex);
        this.hostIndex = min(this.hostIndex, this.hostSize - 1);
        int endIndex = min(this.hostIndex + TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);

        // start table and add columns
        html.startTable().appendHtmlConstant("<colgroup>");
        int columnWidth = HOSTS_COLUMNS / (endIndex - this.hostIndex);
        html.appendColumn(SERVER_GROUPS_COLUMN);
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            html.appendColumn(columnWidth);
        }
        html.appendHtmlConstant("</colgroup>");

        // first row contains host names
        html.appendHtmlConstant("<thead><tr><th class='cellTableHeader'>Hosts&nbsp;&rarr;<br/>Groups&nbsp;&darr;</th>");
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            HostInfo host = hosts.get(i);
            html.appendHost(host);
        }
        html.appendHtmlConstant("</tr></thead>");

        // remaining rows contain server groups and server instances
        html.appendHtmlConstant("<tbody>");
        for (ServerGroup group : groups)
        {
            for (int serverIndex = 0; serverIndex < group.maxServersPerHost; serverIndex++)
            {
                html.appendHtmlConstant("<tr>");
                if (serverIndex == 0)
                {
                    html.appendServerGroup(group);
                }
                for (int i = this.hostIndex; i < endIndex; i++)
                {
                    HostInfo host = hosts.get(i);
                    List<ServerInstance> servers = group.serversPerHost.get(host);
                    if (servers.isEmpty() || serverIndex >= servers.size())
                    {
                        html.emptyCell();
                    }
                    else
                    {
                        html.appendServer(group, host.getName(), servers.get(serverIndex));
                    }
                }
                html.appendHtmlConstant("</tr>");
            }
        }
        html.appendHtmlConstant("</tbody>").endTable();

        // create html panel and register events
        HTMLPanel panel = html.createPanel();
        for (String id : html.getLifecycleIds())
        {
            com.google.gwt.user.client.Element element = panel.getElementById(id);
            if (element != null)
            {
                DOM.setEventListener(element, lifecycleLinkListener);
View Full Code Here

    }

    @Override
    public void updateHosts(SortedSet<ServerGroup> groups, final int index) {
        // validation
        HtmlGenerator html = new HtmlGenerator();
        if (groups == null || groups.isEmpty()) {
            // no server/groups available ...
            HTML blank = new HTML("There don't seem to be any servers configured on this system.");
            container.clear();
            container.add(blank);
            return;
        }

        // initialization
        assignColors(groups);
        List<HostInfo> hosts = groups.first().getHosts();
        this.hostSize = hosts.size();
        this.visibleHosts = min(TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);
        this.hostIndex = index;
        this.hostIndex = max(0, this.hostIndex);
        this.hostIndex = min(this.hostIndex, this.hostSize - 1);
        int endIndex = min(this.hostIndex + TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);

        // start table and add columns
        html.startTable().appendHtmlConstant("<colgroup>");
        int columnWidth = HOSTS_COLUMNS / (endIndex - this.hostIndex);
        html.appendColumn(SERVER_GROUPS_COLUMN);
        for (int i = this.hostIndex; i < endIndex; i++) {
            html.appendColumn(columnWidth);
        }
        html.appendHtmlConstant("</colgroup>");

        // first row contains host names
        html.appendHtmlConstant("<thead><tr><th class='cellTableHeader'>Hosts&nbsp;&rarr;<br/>Groups&nbsp;&darr;</th>");
        for (int i = this.hostIndex; i < endIndex; i++) {
            HostInfo host = hosts.get(i);
            html.appendHost(host);
        }
        html.appendHtmlConstant("</tr></thead>");

        // remaining rows contain server groups and server instances
        html.appendHtmlConstant("<tbody>");
        for (ServerGroup group : groups) {
            for (int serverIndex = 0; serverIndex < group.maxServersPerHost; serverIndex++) {
                html.appendHtmlConstant("<tr>");
                if (serverIndex == 0) {
                    html.appendServerGroup(group);
                }
                for (int i = this.hostIndex; i < endIndex; i++) {
                    HostInfo host = hosts.get(i);
                    List<ServerInstance> servers = group.serversPerHost.get(host);
                    if (servers.isEmpty() || serverIndex >= servers.size()) {
                        html.emptyCell();
                    } else {
                        html.appendServer(group, host.getName(), servers.get(serverIndex));
                    }
                }
                html.appendHtmlConstant("</tr>");
            }
        }
        html.appendHtmlConstant("</tbody>").endTable();

        // create html panel and register events
        HTMLPanel panel = html.createPanel();
        for (String id : html.getLifecycleIds()) {
            com.google.gwt.user.client.Element element = panel.getElementById(id);
            if (element != null) {
                DOM.setEventListener(element, lifecycleLinkListener);
                DOM.sinkEvents(element, ONCLICK);
            }
View Full Code Here

    }

    @Override
    public void updateHosts(SortedSet<ServerGroup> groups, final int index) {
        // validation
        HtmlGenerator html = new HtmlGenerator();
        if (groups == null || groups.isEmpty()) {
            // no server/groups available ...
            HTML blank = new HTML("There don't seem to be any servers configured on this system.");
            container.clear();
            container.add(blank);
            return;
        }

        // initialization
        assignColors(groups);
        List<HostInfo> hosts = groups.first().getHosts();
        this.hostSize = hosts.size();
        this.visibleHosts = min(TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);
        this.hostIndex = index;
        this.hostIndex = max(0, this.hostIndex);
        this.hostIndex = min(this.hostIndex, this.hostSize - 1);
        int endIndex = min(this.hostIndex + TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);

        // start table and add columns
        html.startTable().appendHtmlConstant("<colgroup>");
        int columnWidth = HOSTS_COLUMNS / (endIndex - this.hostIndex);
        html.appendColumn(SERVER_GROUPS_COLUMN);
        for (int i = this.hostIndex; i < endIndex; i++) {
            html.appendColumn(columnWidth);
        }
        html.appendHtmlConstant("</colgroup>");

        // first row contains host names
        html.appendHtmlConstant("<thead><tr><th class='cellTableHeader'>Hosts&nbsp;&rarr;<br/>Groups&nbsp;&darr;</th>");
        for (int i = this.hostIndex; i < endIndex; i++) {
            HostInfo host = hosts.get(i);
            html.appendHost(host);
        }
        html.appendHtmlConstant("</tr></thead>");

        // remaining rows contain server groups and server instances
        html.appendHtmlConstant("<tbody>");
        for (ServerGroup group : groups) {
            for (int serverIndex = 0; serverIndex < group.maxServersPerHost; serverIndex++) {
                html.appendHtmlConstant("<tr>");
                if (serverIndex == 0) {
                    html.appendServerGroup(group);
                }
                for (int i = this.hostIndex; i < endIndex; i++) {
                    HostInfo host = hosts.get(i);
                    List<ServerInstance> servers = group.serversPerHost.get(host);
                    if (servers.isEmpty() || serverIndex >= servers.size()) {
                        html.emptyCell();
                    } else {
                        html.appendServer(group, host.getName(), servers.get(serverIndex));
                    }
                }
                html.appendHtmlConstant("</tr>");
            }
        }
        html.appendHtmlConstant("</tbody>").endTable();

        // create html panel and register events
        HTMLPanel panel = html.createPanel();
        for (String id : html.getLifecycleIds()) {
            com.google.gwt.user.client.Element element = panel.getElementById(id);
            if (element != null) {
                DOM.setEventListener(element, lifecycleLinkListener);
                DOM.sinkEvents(element, ONCLICK);
            }
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.domain.topology.HtmlGenerator

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.