Package org.apache.isis.viewer.xhtml.viewer.tree

Examples of org.apache.isis.viewer.xhtml.viewer.tree.Element


        addClassAttribute(a, htmlClassAttribute);
        return a;
    }

    public <T> Element table(final List<TableColumn<T>> columns, final List<T> rows, final String htmlClassAttribute) {
        final Element table = new Element("table");
        table.addAttribute(new Attribute("border", "1"));
        table.appendChild(appendTrTh(columns));
        appendTrTd(table, columns, rows);
        return table;
    }
View Full Code Here


        appendTrTd(table, columns, rows);
        return table;
    }

    private static <T> Element appendTrTh(final List<TableColumn<T>> columns) {
        final Element tr = new Element("tr");
        for (final TableColumn<T> column : columns) {
            tr.appendChild(column.th());
        }
        return tr;
    }
View Full Code Here

        return tr;
    }

    private static <T> void appendTrTd(final Element table, final List<TableColumn<T>> columns, final List<T> rows) {
        for (final T row : rows) {
            final Element tr = new Element("tr");
            for (final TableColumn<T> column : columns) {
                tr.appendChild(column.td(row));
            }
            table.appendChild(tr);
        }
    }
View Full Code Here

            table.appendChild(tr);
        }
    }

    public Element dl(final String htmlClassAttribute) {
        final Element dl = new Element("dl");
        addClassAttribute(dl, htmlClassAttribute);
        return dl;
    }
View Full Code Here

        addClassAttribute(dl, htmlClassAttribute);
        return dl;
    }

    public DtDd dt_dd(final String dtText, final String ddText, final String htmlClassAttribute) {
        final Element dt = new Element("dt");
        dt.appendChild(dtText);
        final Element dd = new Element("dd");
        dd.appendChild(ddText);
        return new DtDd(dt, dd);
    }
View Full Code Here

        final XhtmlTemplate xhtml = new XhtmlTemplate("User", getServletRequest());
        xhtml.appendToBody(asDivIsisSession());
        xhtml.appendToBody(resourcesDiv());

        final Element div = xhtmlRenderer.div_p("Roles", HtmlClass.SECTION);

        final Element ul = xhtmlRenderer.ul(HtmlClass.ROLES);
        final List<String> roles = getSession().getRoles();
        for (final String role : roles) {
            ul.appendChild(xhtmlRenderer.li_p(role, HtmlClass.ROLE));
        }
        div.appendChild(ul);

        xhtml.appendToBody(div);
View Full Code Here

        }
        if (!association.isUsable(getSession(), getNakedObject()).isAllowed()) {
            return xhtmlRenderer.p(null, getHtmlClassAttribute());
        }

        final Element div = xhtmlRenderer.div(getHtmlClassAttribute());

        div.appendChild(form(association));
        return div;
    }
View Full Code Here

    }

    private Element form(final T association) {
        final String associationId = association.getId();
        final String formName = getFormNamePrefix() + associationId;
        final Element form = xhtmlRenderer.form(formName, getHtmlClassAttribute());
        form.addAttribute(new Attribute("class", associationId));

        final String inputFieldName = "proposedValue";
        if (inputField) {
            final Element inputValue = new Element("input");
            inputValue.addAttribute(new Attribute("type", "value"));
            inputValue.addAttribute(new Attribute("name", inputFieldName));
            form.appendChild(inputValue);
        }

        final Element inputButton = new Element("input");
        inputButton.addAttribute(new Attribute("type", "button"));
        inputButton.addAttribute(new Attribute("value", getFormButtonLabel()));
        final String servletContextName = getContextPath();
        final String url = MessageFormat.format("{0}/object/{1}", servletContextName, getOidStr());
        inputButton.addAttribute(new Attribute("onclick", invokeJavascript(url, associationId, inputFieldName)));

        form.appendChild(inputButton);
        form.addAttribute(new Attribute("action", url));

        return form;
View Full Code Here

        final Oid oid = propertyValue.getOid();
        if (oid == null) {
            return xhtmlRenderer.p(null, HtmlClass.PROPERTY);
        }
        final String uri = MessageFormat.format("{0}/object/{1}", getContextPath(), getOidStr(propertyValue));
        return new Element(xhtmlRenderer.aHref(uri, titleString, "propertyValue", "property", HtmlClass.PROPERTY));
    }
View Full Code Here

        final String memberName = oneToOneAssociation.getIdentifier().getMemberName();
        final String memberType = "property";
        final String uri =
            MessageFormat.format("{0}/specs/{1}/{2}/{3}", getContextPath(), getNoSpec().getFullIdentifier(),
                memberType, memberName);
        return new Element(xhtmlRenderer.aHref(uri, oneToOneAssociation.getName(), "propertySpec", memberType,
            HtmlClass.PROPERTY));
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.xhtml.viewer.tree.Element

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.