Package info.magnolia.cms.i18n

Examples of info.magnolia.cms.i18n.Messages


        super(name, request, response);
    }

    public void configureList(ListControl list)
    {
        final Messages msgs = getMsgs();

        AdminListControlRenderer renderer = new AdminListControlRenderer()
        {

            {
                setJavaScriptClass("mgnl.scheduler.JobList");
            }

            protected String buildJavaScriptObject(ListControl list, Object value)
            {
                return super.buildJavaScriptObject(list, value) + ", path: '" + list.getIteratorValue("path") + "'";
            }

        };

        list.setRenderer(renderer);

        list.addColumn(new ListColumn()
        {

            {
                setName("active");
                setColumnName("active");
                setLabel(msgs.get("list.column.active"));
                setWidth("55px");
            }

            public Object getValue()
            {
                Boolean status = Boolean.valueOf(super.getValue().toString());
                StringBuilder str = new StringBuilder("/.resources/icons/16/flag_");

                if (status == null)
                {
                    str.append("yellow.gif");
                }
                else if (status.booleanValue())
                {
                    str.append("green.gif");
                }
                else
                {
                    str.append("red.gif");
                }

                return str.toString();
            }

            public Renderer getRenderer()
            {
                return new IconListColumnRenderer();
            }
        });

        list.addColumn(new ListColumn("title", msgs.get("list.column.jobName"), "150", true));
        list.addColumn(new ListColumn("lastFireTime", msgs.get("list.column.lastFireTime"), "150", true));
        list.addColumn(new ListColumn()
        {

            {
                setName("terminatedWithError");
                setColumnName("terminatedWithError");
                setLabel(msgs.get("list.column.status"));
                setWidth("55px");
            }

            public Object getValue()
            {
                Boolean status = Boolean.valueOf(super.getValue().toString());
                StringBuilder str = new StringBuilder("/.resources/scheduler/css/images/");

                if (status == null)
                {
                    str.append("warning.png");
                }
                else if (status.booleanValue())
                {
                    str.append("error.png");
                }
                else
                {
                    str.append("success.png");
                }

                return str.toString();
            }

            public Renderer getRenderer()
            {
                return new IconListColumnRenderer();
            }
        });

        list.addColumn(new ListColumn("nextFireTime", "Next fire time", "150", true));
        list.addColumn(new ListColumn("startTime", msgs.get("list.column.startTime"), "150", true));
        list.addColumn(new ListColumn("endTime", msgs.get("list.column.endTime"), "150", true));
        list.addColumn(new ListColumn("cron", msgs.get("list.column.cron"), "100", true));
        list.addColumn(new ListColumn("description", msgs.get("list.column.jobDescription"), "200", true));

        list.addSortableField("active");
        list.addSortableField("title");
        list.addSortableField("lastFireTime");
        list.addSortableField("terminatedWithError");
View Full Code Here

TOP

Related Classes of info.magnolia.cms.i18n.Messages

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.