/** * Creates a {@link Table} element with the specified child nodes. * * @param children The child nodes. * @return The new element. */ public static final Table table(Object...children) { return table().children(children); }
/** * Creates a {@link Table} element with the specified child nodes. * * @param children The child nodes. * @return The new element. */ public static final Table table(Object...children) { return table().children(children); }
/** * Creates a {@link Table} element with the specified child nodes. * * @param children The child nodes. * @return The new element. */ public static final Table table(Object...children) { return table().children(children); }
private Div headers(Session s, ResponseInfo ri) { if (! ri.hasHeaders()) return null; Table sectionTable = table(tr(th("Name"),th("Description"),th("Schema")))._class("section-table"); Div headers = div( div("Headers:")._class("section-name"), sectionTable )._class("headers"); for (Map.Entry<String,HeaderInfo> e : ri.getHeaders().entrySet()) { String name = e.getKey(); HeaderInfo hi = e.getValue(); sectionTable.child( tr( td(name)._class("name"), td(toBRL(hi.getDescription()))._class("description"), td(hi.asMap().keepAll("type","format","items","collectionFormat","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf")) ) ); } return headers; }
private Div headers(Session s, ResponseInfo ri) { if (! ri.hasHeaders()) return null; Table sectionTable = table(tr(th("Name"),th("Description"),th("Schema")))._class("section-table"); Div headers = div( div("Headers:")._class("section-name"), sectionTable )._class("headers"); for (Map.Entry<String,HeaderInfo> e : ri.getHeaders().entrySet()) { String name = e.getKey(); HeaderInfo hi = e.getValue(); sectionTable.child( tr( td(name)._class("name"), td(toBRL(hi.getDescription()))._class("description"), td(hi.asMap().keepAll("type","format","items","collectionFormat","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf")) ) ); } return headers; }
private Div headers(Session s, ResponseInfo ri) { if (! ri.hasHeaders()) return null; Table sectionTable = table(tr(th("Name"),th("Description"),th("Schema")))._class("section-table"); Div headers = div( div("Headers:")._class("section-name"), sectionTable )._class("headers"); for (Map.Entry<String,HeaderInfo> e : ri.getHeaders().entrySet()) { String name = e.getKey(); HeaderInfo hi = e.getValue(); sectionTable.child( tr( td(name)._class("name"), td(toBRL(hi.getDescription()))._class("description"), td(hi.asMap().keepAll("type","format","items","collectionFormat","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf")) ) ); } return headers; }
tableContainer.child(div(h4("Parameters")._class("title"))._class("op-block-section-header")); Table parameters = table(tr(th("Name")._class("parameter-key"), th("Description")._class("parameter-key")))._class("parameters"); tableContainer.child(div(h4("Responses")._class("title"))._class("op-block-section-header")); Table responses = table(tr(th("Code")._class("response-key"), th("Description")._class("response-key")))._class("responses"); tableContainer.child(responses);
tableContainer.child(div(h4("Parameters")._class("title"))._class("op-block-section-header")); Table parameters = table(tr(th("Name")._class("parameter-key"), th("Description")._class("parameter-key")))._class("parameters"); tableContainer.child(div(h4("Responses")._class("title"))._class("op-block-section-header")); Table responses = table(tr(th("Code")._class("response-key"), th("Description")._class("response-key")))._class("responses"); tableContainer.child(responses);
@RestMethod( summary="Initialize database form entry page" ) public Div getInit() { return div( form("servlet:/init").method(POST).target("buf").children( table( tr( th("Initialize petstore database:"), td(input("radio").name("init-method").value("direct").checked(true), "direct", input("radio").name("init-method").value("rest"), "rest"), td(button("submit", "Submit").style("float:right").onclick("scrolling=true")) ) ) ), br(), iframe().id("buf").name("buf").style("width:800px;height:600px;").onload("window.parent.scrolling=false;"), script("text/javascript", "var scrolling = false;", "function scroll() { if (scrolling) { document.getElementById('buf').contentWindow.scrollBy(0,50); } setTimeout('scroll()',200); } ", "scroll();" ) ); }
@RestMethod( summary="Initialize database form entry page" ) public Div getInit() { return div( form("servlet:/init").method(POST).target("buf").children( table( tr( th("Initialize petstore database:"), td(input("radio").name("init-method").value("direct").checked(true), "direct", input("radio").name("init-method").value("rest"), "rest"), td(button("submit", "Submit").style("float:right").onclick("scrolling=true")) ) ) ), br(), iframe().id("buf").name("buf").style("width:800px;height:600px;").onload("window.parent.scrolling=false;"), script("text/javascript", "var scrolling = false;", "function scroll() { if (scrolling) { document.getElementById('buf').contentWindow.scrollBy(0,50); } setTimeout('scroll()',200); } ", "scroll();" ) ); }
@RestMethod( name=GET, path="/edit", summary="Render form entry page for editing config file", description="Renders a form entry page for editing the raw text of a config file." ) public Form getConfigEditForm() { return form().id("form").action("servlet:/").method("POST").enctype("application/x-www-form-urlencoded").children( div()._class("data").children( table( tr(td().style("text-align:right").children(button("submit","Submit"),button("reset","Reset"))), tr(th().child("Contents")), tr(th().child( textarea().name("contents").rows(40).cols(120).style("white-space:pre;word-wrap:normal;overflow-x:scroll;font-family:monospace;") .text(getServletConfig().getConfig().toString())) ) ) ) ); }
@RestMethod( name=GET, path="/edit", summary="Render form entry page for editing config file", description="Renders a form entry page for editing the raw text of a config file." ) public Form getConfigEditForm() { return form().id("form").action("servlet:/").method("POST").enctype("application/x-www-form-urlencoded").children( div()._class("data").children( table( tr(td().style("text-align:right").children(button("submit","Submit"),button("reset","Reset"))), tr(th().child("Contents")), tr(th().child( textarea().name("contents").rows(40).cols(120).style("white-space:pre;word-wrap:normal;overflow-x:scroll;font-family:monospace;") .text(getServletConfig().getConfig().toString())) ) ) ) ); }
@Override /* Widget */ public Object getContent(RestRequest req) throws Exception { return div( form().id("form").action("servlet:/store/order").method(POST).children( table( tr( th("Pet:"), td( select().id("addPet_names").name("petId") ), td(new Tooltip("❓", "The pet to purchase.")) ), tr( th("Ship date:"), td(input().name("shipDate").type("date")), td(new Tooltip("❓", "The requested ship date.")) ), tr( td().colspan(2).style("text-align:right").children( button("reset", "Reset"), button("submit", "Submit") ) ) ).style("white-space:nowrap") ) ); } }
@Override /* Widget */ public Object getContent(RestRequest req) throws Exception { return div( form().id("form").action("servlet:/store/order").method(POST).children( table( tr( th("Pet:"), td( select().id("addPet_names").name("petId") ), td(new Tooltip("❓", "The pet to purchase.")) ), tr( th("Ship date:"), td(input().name("shipDate").type("date")), td(new Tooltip("❓", "The requested ship date.")) ), tr( td().colspan(2).style("text-align:right").children( button("reset", "Reset"), button("submit", "Submit") ) ) ).style("white-space:nowrap") ) ); } }
@Override /* Widget */ public Object getContent(RestRequest req) throws Exception { return div( form().id("form").action("servlet:/upload").method(POST).enctype("multipart/form-data").children( table( tr( th("ID:"), td(input().name("id").type("text")), td(new Tooltip("❓", "The unique identifier of the photo.", br(), "e.g. 'Fluffy'")) ), tr( th("File:"), td(input().name("file").type("file").accept("image/*")), td(new Tooltip("❓", "The image file.")) ), tr( td().colspan(2).style("text-align:right").children( button("reset", "Reset"), button("button","Cancel").onclick("window.location.href='/'"), button("submit", "Submit") ) ) ).style("white-space:nowrap") ) ); } }
@Override /* Widget */ public Object getContent(RestRequest req) throws Exception { return div( form().id("form").action("servlet:/upload").method(POST).enctype("multipart/form-data").children( table( tr( th("ID:"), td(input().name("id").type("text")), td(new Tooltip("❓", "The unique identifier of the photo.", br(), "e.g. 'Fluffy'")) ), tr( th("File:"), td(input().name("file").type("file").accept("image/*")), td(new Tooltip("❓", "The image file.")) ), tr( td().colspan(2).style("text-align:right").children( button("reset", "Reset"), button("button","Cancel").onclick("window.location.href='/'"), button("submit", "Submit") ) ) ).style("white-space:nowrap") ) ); } }
return div( form().id("form").action("servlet:/pet").method(POST).children( table( tr( th("Name:"),