本文整理汇总了Java中org.rendersnake.HtmlCanvas.div方法的典型用法代码示例。如果您正苦于以下问题:Java HtmlCanvas.div方法的具体用法?Java HtmlCanvas.div怎么用?Java HtmlCanvas.div使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rendersnake.HtmlCanvas
的用法示例。
在下文中一共展示了HtmlCanvas.div方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateNode
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
protected void generateNode(StructureNode structureNode, HtmlCanvas html, Content content) throws IOException {
if (structureNode.getNodes() != null && structureNode.getNodes().size() > 0) {
html.div(class_(structureNode.getCss()));
for (StructureNode childNode : structureNode.getNodes()) {
generateNode(childNode, html, content);
}
html._div();
} else {
html.div(class_(structureNode.getCss()));
if (!StringUtils.isBlank(structureNode.getNodeId())) {
if (content.getContentNodes() != null) {
Optional<ContentNode> node = content.getContentNodes().stream()
.filter(n -> n.getNodeId().equals(structureNode.getNodeId())).findFirst();
if (node.isPresent()) {
generateNode(node.get(), html);
}
}
}
html._div();
}
}
示例2: renderHierarchy
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
private void renderHierarchy(HtmlCanvas html, ClassDocAccess classDocAccess) throws IOException {
List<Type> hierarchy = classDocAccess.getHierarchy();
if (!hierarchy.isEmpty()) {
html.div(class_("hierarchy"));
for (int cnt = 0; cnt < hierarchy.size(); cnt++) {
int flags = ClassNameRenderable.FQN;
if (cnt < hierarchy.size() - 1) {
flags |= ClassNameRenderable.LINK;
}
html.p(style("text-indent:" + cnt * 2 + "em;")).write(cnt > 0 ? "↳" : " ",
false).render(new ClassNameRenderable(generator, hierarchy.get(cnt), flags))._p();
}
html._div();
} else {
html.div(class_("separator")).close();
}
}
示例3: renderOn
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
@Override
public void renderOn(HtmlCanvas html) throws IOException {
MarkupPage page = PageRenderer.getPage(html);
MarkupDoc markupDoc = page.getMarkupDoc();
LinkedList<IndexDoc> indexes = new LinkedList<>();
// build indexes list in reverse order
IndexDoc indexDoc = generator.getRootProjectDoc().getIndexDoc(markupDoc);
while (indexDoc != null && indexDoc != rootIndexDoc) {
indexes.addFirst(indexDoc);
indexDoc = generator.getRootProjectDoc().getIndexDoc(indexDoc.getParentContainer());
}
html.div(class_("nav"));
writeIndexes(indexes, 0, markupDoc, page, html);
html._div();
}
示例4: generatePiechart
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
private void generatePiechart(HtmlCanvas reportPageBody, IRunTestResults iRunTestResults) throws IOException {
HtmlCanvas divSummary = reportPageBody.div();
divSummary.div(new HtmlAttributes().id(PIECHART_ID))._div();
HtmlCanvas divTestSummary = divSummary.div(new HtmlAttributes().class_(TEST_SUMMARY_CLASS));
int passedCount = iRunTestResults.getPassedTests().size();
int skippedCount = iRunTestResults.getSkippedTests().size();
int failedCount = iRunTestResults.getFailedTests().size();
divTestSummary.h2().content(format(PASSED_TESTS, passedCount));
divTestSummary.h2().content(format(FAILED_TESTS, failedCount));
divTestSummary.h2().content(format(SKIPPED_TESTS, skippedCount));
divTestSummary._div();
divSummary._div();
// Hidden divs used to be able to link data to piechart.js
reportPageBody.div(new HtmlAttributes().id(PASSED.toLowerCase(ENGLISH))
.class_(HIDDEN_CLASS)).content(passedCount);
reportPageBody.div(new HtmlAttributes().id(FAILED.toLowerCase(ENGLISH))
.class_(HIDDEN_CLASS)).content(failedCount);
reportPageBody.div(new HtmlAttributes().id(SKIPPED.toLowerCase(ENGLISH))
.class_(HIDDEN_CLASS)).content(skippedCount);
}
示例5: renderOn
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
@Override
public void renderOn(HtmlCanvas html) throws IOException {
if (currentRecipe == null) {
System.out.println("No recipe defined. Stacktrace for call: ");
Exception runtimeException = new RuntimeException();
runtimeException.printStackTrace();
return;
}
html.macros().stylesheet("/bootstrap-v4/css/bootstrap.min.css");
html.div(id("recipeView").class_("text-center"));
renderMash(html);
renderHops(html);
renderFermentation(html);
renderDryHops(html);
html._div();
}
示例6: renderOn
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
@Override
public final void renderOn(HtmlCanvas html) throws IOException {
html.div(class_("content"));
doRenderOn(html);
html.div(class_("footer")).write("Generated by ").a(href("https://github.com/nicolaschriste/docdown"))
.content("Docdown " + DocdownDoclet.version)._div();
html._div();
}
示例7: generateHeader
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
void generateHeader(HtmlCanvas reportPageBody, String cloudSlangImage) throws IOException {
HtmlCanvas headerDiv = reportPageBody.div(new HtmlAttributes().id(HEADER_BAR_ID));
HtmlCanvas anchor = headerDiv.a(new HtmlAttributes().href(HTTP_CLOUD_SLANG_IO).target(BLANK));
HtmlCanvas img = new HtmlCanvas().img(new HtmlAttributes().src(cloudSlangImage).alt(CLOUD_SLANG_LOGO_ALT));
anchor.content(img.toHtml(), false);
headerDiv._div();
reportPageBody.h1(new HtmlAttributes().class_(REPORT_TITLE_CLASS)).content(TEST_CASE_REPORT);
}
示例8: getForm
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
@Override
public HtmlCanvas getForm() throws IOException {
HtmlCanvas html = new HtmlCanvas();
html.div(id("NewWaitTrigger").class_(""));
html.form(id("newTriggersForm"));
html.input(id("type").name("type").class_("form-control m-t")
.hidden("true").value("Wait"));
html.input(class_("inputBox temperature form-control m-t")
.type("number").add("step", "any")
.add("placeholder", Messages.MINUTES)
.name(WAITTIMEMINS).value(""));
html.input(class_("inputBox temperature form-control m-t")
.type("number").add("step", "any")
.add("placeholder", Messages.SECS)
.name(WAITTIMESECS).value(""));
html.input(class_("inputBox form-control m-t")
.name(NOTES).value("")
.add("placeholder", Messages.NOTES)
.value(this.note));
html.button(name("submitWait")
.class_("btn btn-primary col-md-12")
.add("data-toggle", "clickover")
.onClick("submitNewTriggerStep(this);"))
.write(Messages.ADD_TRIGGER)
._button();
html._form();
html._div();
return html;
}
示例9: getEditForm
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
@Override
public HtmlCanvas getEditForm() throws IOException {
HtmlCanvas html = new HtmlCanvas();
html.div(id("EditWaitTrigger").class_(""));
html.form(id("editTriggersForm"));
html.input(id("type").name("type")
.hidden("true").value("Wait"));
html.input(id("type").name("position")
.hidden("position").value("" + this.position));
html.input(class_("inputBox temperature form-control")
.type("number").add("step", "any")
.add("placeholder", Messages.MINUTES)
.name(WAITTIMEMINS)
.value(Double.toString(this.minutes)));
html.input(class_("inputBox temperature form-control")
.type("number").add("step", "any")
.add("placeholder", Messages.SECS)
.name(WAITTIMESECS)
.value(Double.toString(this.seconds)));
html.input(class_("inputBox form-control")
.name(NOTES).value("")
.add("placeholder", Messages.NOTES)
.value(this.note));
html.button(name("submitWait")
.class_("btn col-md-12")
.add("data-toggle", "clickover")
.onClick("updateTriggerStep(this);"))
.write(Messages.ADD_TRIGGER)
._button();
html._form();
html._div();
return html;
}
示例10: renderFermentation
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
public HtmlCanvas renderFermentation(HtmlCanvas html) throws IOException
{
if (currentRecipe.getFermentStepSize() > 0) {
html.div(id("recipeFermProfile"));
html.div(class_("lead")).write(Messages.FERMENT_PROFILE);
html._div();
html.table(id("fermentTable").class_("table table-striped table-bordered"));
html.tr();
html.th().write(Messages.NAME)._th();
html.th().write(Messages.TEMP)._th();
html.th().write(Messages.TIME)._th();
html._tr();
for (int i = 0; i < currentRecipe.getFermentStepSize(); i++) {
html.tr(id("fermStep-" + i));
html.td(id("ferm-Name")).write(currentRecipe.getFermentStepType(i))._td();
html.td(id("ferm-Temp")).write(String.format("%.2f", currentRecipe.getFermentStepTemp(i)) + currentRecipe.getFermentStepTempU(i))._td();
html.td(id("ferm-Time")).write(currentRecipe.getFermentStepTime(i) + " days")._td();
html._tr();
}
html._table();
html.select(name("tempprobe").class_("form-control"));
html.option(value("").selected_if(true))
.write("Select Probe")
._option();
for (PID entry: LaunchControl.pidList) {
html.option(value(entry.getName()))
.write(entry.getName())
._option();
}
html._select();
html.button(id("setFermProfile").class_("btn btn-default").onClick("setFermProfile(this)"))
.write(Messages.SET_FERM_PROFILE)._button();
html._div();
}
return html;
}
示例11: getForm
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
/**
* Get the Form HTML Canvas representing a temperature trigger.
* @return {@link org.rendersnake.HtmlCanvas} representing the input form.
* @throws IOException when the HTMLCanvas could not be created.
*/
@Override
public final HtmlCanvas getForm() throws IOException {
HtmlCanvas html = new HtmlCanvas(new PrettyWriter());
html.div(id("NewTempTrigger").class_(""));
html.form(id("newTriggersForm"));
html.input(id("type").name("type").class_("form-control m-t")
.hidden("true").value("Temperature"));
html.input(id("type").name("position").class_("form-control m-t")
.hidden("position").value("" + this.position));
html.input(class_("inputBox temperature form-control m-t")
.type("number").add("step", "any")
.add("placeholder", Messages.SET_POINT)
.name("targetTemperature").value(""));
html.input(class_("inputBox temperature form-control m-t")
.type("number").add("step", "any")
.add("placeholder", Messages.END_TEMP)
.name("exitTemperature").value(""));
html.input(class_("inputBox form-control m-t")
.name("method").value("")
.add("placeholder", Messages.METHOD));
html.input(class_("inputBox form-control m-t")
.name("stepType").value("")
.add("placeholder", Messages.TYPE));
// Add the on/off values
html.select(class_("form-control m-t").name("mode")
.id("mode"));
html.option(value(""))
.write("")
._option();
html.option(value(TemperatureTrigger.INCREASE))
.write(TemperatureTrigger.INCREASE)
._option();
html.option(value(TemperatureTrigger.DECREASE))
.write(TemperatureTrigger.DECREASE)
._option();
html._select();
html.button(name("submitTemperature")
.class_("btn btn-primary m-t col-md-12")
.add("data-toggle", "clickover")
.onClick("submitNewTriggerStep(this);"))
.write(Messages.ADD_TRIGGER)
._button();
html._form();
html._div();
return html;
}
示例12: getEditForm
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
/**
* Get the Form HTML Canvas representing a temperature trigger.
* @return {@link org.rendersnake.HtmlCanvas} representing the input form.
* @throws IOException when the HTMLCanvas could not be created.
*/
@Override
public final HtmlCanvas getEditForm() throws IOException {
HtmlCanvas html = new HtmlCanvas(new PrettyWriter());
html.div(id("EditTempTrigger").class_(""));
html.form(id("editTriggersForm"));
html.input(id("type").name("type")
.hidden("true").value("Temperature"));
html.input(id("type").name("position")
.hidden("position").value("" + this.position));
html.input(class_("inputBox temperature form-control")
.type("number").add("step", "any")
.add("placeholder", Messages.SET_POINT)
.value(this.targetTemp.toPlainString())
.name("targetTemperature"));
html.input(class_("inputBox temperature form-control")
.type("number").add("step", "any")
.add("placeholder", Messages.END_TEMP)
.value(this.targetTemp.toPlainString())
.name("exitTemperature"));
html.input(class_("inputBox form-control")
.name("method").value("")
.value(this.method)
.add("placeholder", Messages.METHOD));
html.input(class_("inputBox form-control")
.name("stepType").value("")
.value(this.type)
.add("placeholder", Messages.TYPE));
// Add the on/off values
html.select(class_("holo-spinner").name("mode")
.id("mode"));
html.option(value(""))
.write("")
._option();
html.option(value(TemperatureTrigger.INCREASE)
.selected_if(
this.mode.equals(TemperatureTrigger.INCREASE)))
.write(TemperatureTrigger.INCREASE)
._option();
html.option(value(TemperatureTrigger.DECREASE)
.selected_if(
this.mode.equals(TemperatureTrigger.DECREASE)))
.write(TemperatureTrigger.DECREASE)
._option();
html._select();
html.button(name("submitTemperature")
.class_("btn col-md-12")
.add("data-toggle", "clickover")
.onClick("updateTriggerStep(this);"))
.write(Messages.ADD_TRIGGER)
._button();
html._form();
html._div();
return html;
}
示例13: getForm
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
/**
* @return The HTML elements for this form.
* @throws IOException if the form could not be created.
*/
@Override
public final HtmlCanvas getForm() throws IOException {
HtmlCanvas html = new HtmlCanvas();
html.div(id("NewSwitchTrigger").class_(""));
html.form(id("newTriggersForm"));
html.input(id("type").name("type")
.hidden("true").value("Switch"));
// Add the Switches as a drop down list.
html.select(class_("holo-spinner").name("switchname")
.id("switchName"));
html.option(value(""))
.write(Messages.SWITCHES)
._option();
for (Switch tSwitch : LaunchControl.switchList) {
String tName = tSwitch.getName();
html.option(value(tName))
.write(tName)
._option();
}
html._select();
// Add the on/off values
html.select(class_("holo-spinner").name("activate")
.id("activate"));
html.option(value(""))
.write("")
._option();
html.option(value("on"))
.write(Messages.SWITCH_ON)
._option();
html.option(value("off"))
.write(Messages.SWITCH_OFF)
._option();
html._select();
html.button(name("submitSwitchTrigger")
.class_("btn col-md-12")
.add("data-toggle", "clickover")
.onClick("submitNewTriggerStep(this);"))
.write(Messages.ADD_TRIGGER)
._button();
html._form();
html._div();
return html;
}
示例14: getEditForm
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
/**
* @return The HTML elements for this form.
* @throws IOException if the form could not be created.
*/
@Override
public final HtmlCanvas getEditForm() throws IOException {
HtmlCanvas html = new HtmlCanvas();
html.div(id("EditSwitchTrigger").class_(""));
html.form(id("editTriggersForm"));
html.input(id("type").name("type").class_("form-control m-t")
.hidden("true").value("switch"));
html.input(id("type").name("position").class_("form-control m-t")
.hidden("position").value("" + this.position));
// Add the Switches as a drop down list.
html.select(class_("form-control m-t").name(SWITCHNAME)
.id("switchName"));
html.option(value(""))
.write(Messages.SWITCHES)
._option();
for (Switch tSwitch : LaunchControl.switchList) {
String tName = tSwitch.getName();
html.option(value(tName)
.selected_if(this.switchName.equals(tName)))
.write(tName)
._option();
}
html._select();
// Add the on/off values
html.select(class_("form-control m-t").name("activate")
.id("activate"));
html.option(value(""))
.write("")
._option();
html.option(value(Messages.SWITCH_ON)
.selected_if(this.activate.equals("on")))
.write("On")
._option();
html.option(value(Messages.SWITCH_OFF)
.selected_if(this.activate.equals("off")))
.write("Off")
._option();
html._select();
html.button(name("submitSwitchTrigger")
.class_("btn btn-primary col-md-12")
.add("data-toggle", "clickover")
.onClick("updateTriggerStep(this);"))
.write(Messages.EDIT)
._button();
html._form();
html._div();
return html;
}
示例15: getForm
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
/**
* @return The HTML elements for this form.
* @throws IOException if the form could not be created.
*/
@Override
public final HtmlCanvas getForm() throws IOException {
HtmlCanvas html = new HtmlCanvas();
html.div(id("NewTriggerTrigger").class_(""));
html.form(id("newTriggersForm"));
html.input(id("type").name("type").class_("form-control m-t")
.hidden("true").value("Profile"));
// Add the probe as a drop down list.
html.select(class_("form-control m-t").name(TARGET_NAME)
.id(TARGET_NAME));
html.option(value(""))
.write("Target Probe")
._option();
for (Temp tTemp: LaunchControl.tempList) {
String tName = tTemp.getName();
html.option(value(tName))
.write(tName)
._option();
}
html._select();
// Add the on/off values
html.select(class_("form-control m-t").name(ACTIVATE)
.id(ACTIVATE));
html.option(value(""))
.write("")
._option();
html.option(value(ACTIVATE))
.write(Messages.ACTIVATE)
._option();
html.option(value(DISABLE))
.write(Messages.DISABLE)
._option();
html._select();
html.button(name("submitTriggerTrigger")
.class_("btn btn-primary col-md-12")
.add("data-toggle", "clickover")
.onClick("submitNewTriggerStep(this);"))
.write(Messages.ADD_TRIGGER)
._button();
html._form();
html._div();
return html;
}