本文整理汇总了Java中org.rendersnake.HtmlCanvas.select方法的典型用法代码示例。如果您正苦于以下问题:Java HtmlCanvas.select方法的具体用法?Java HtmlCanvas.select怎么用?Java HtmlCanvas.select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rendersnake.HtmlCanvas
的用法示例。
在下文中一共展示了HtmlCanvas.select方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: logLevels
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
@GET
@Path("/logLevels/{instanceKey}")
public Response logLevels(@PathParam("instanceKey") @DefaultValue("") String instanceKey) {
try {
HtmlCanvas canvas = new HtmlCanvas();
canvas.form(HtmlAttributesFactory
.action("/ui/deployable/setLogLevel/" + instanceKey)
.method("post")
.id("setLogLevel-form"));
canvas.fieldset();
org.apache.logging.log4j.Logger rl = LogManager.getRootLogger();
if (rl instanceof Logger) {
LoggerContext rlContext = ((Logger) rl).getContext();
Collection<Logger> loggers = rlContext.getLoggers();
canvas.select(HtmlAttributesFactory.name("logger"));
for (Logger logger : loggers) {
try {
Class.forName(logger.getName());
String level = (logger.getLevel() == null) ? null : logger.getLevel().toString();
canvas.option(HtmlAttributesFactory.value(logger.getName())).content(level + "=" + logger.getName());
} catch (ClassNotFoundException e) {
LOG.warn("Failed to find class:{}", e.getLocalizedMessage());
}
}
canvas._select();
} else {
canvas.h1().content("Loggers unavailable, RootLogger is: " + rl.getClass().getName() + " expected: " + Logger.class.getName());
}
canvas.select(HtmlAttributesFactory.name("level"));
canvas.option(HtmlAttributesFactory.value("")).content("Inherit");
canvas.option(HtmlAttributesFactory.value("TRACE")).content("TRACE");
canvas.option(HtmlAttributesFactory.value("DEBUG")).content("DEBUG");
canvas.option(HtmlAttributesFactory.value("INFO")).content("INFO");
canvas.option(HtmlAttributesFactory.value("WARN")).content("WARN");
canvas.option(HtmlAttributesFactory.value("ERROR")).content("ERROR");
canvas.option(HtmlAttributesFactory.value("OFF")).content("OFF");
canvas._select();
canvas.input(HtmlAttributesFactory.type("submit").value("Change"))
._fieldset()
._form();
return Response.ok(canvas.toHtml(), MediaType.TEXT_HTML).build();
} catch (Exception x) {
LOG.warn("Failed to set logging level.", x);
return ResponseHelper.INSTANCE.errorResponse("Failed to set logging level.", x);
}
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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("NewTriggerTrigger").class_(""));
html.form(id("newTriggersForm"));
html.input(id(TYPE).name(TYPE)
.hidden("true").value("Profile"));
html.input(id("type").name(POSITION)
.hidden(POSITION).value(this.position));
// Add the triggers as a drop down list.
html.select(class_("holo-spinner").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_("holo-spinner").name(ACTIVATE)
.id(ACTIVATE));
html.option(value(""))
.write("")
._option();
html.option(value(ACTIVATE)
.selected_if(this.activate))
.write(Messages.ACTIVATE)
._option();
html.option(value(DISABLE)
.selected_if(!this.activate))
.write(Messages.DISABLE)
._option();
html._select();
html.button(name("submitTempTrigger")
.class_("btn col-md-12")
.add("data-toggle", "clickover")
.onClick("updateTriggerStep(this);"))
.write(Messages.EDIT)
._button();
html._form();
html._div();
return html;
}
示例9: renderDryHops
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
public HtmlCanvas renderDryHops(HtmlCanvas html) throws IOException
{
// Do we have hop additions?
if (currentRecipe.getHopsListSize() > 0) {
// Show them!
html.div(id("recipeDryHops"));
html.div(class_("lead")).write(Messages.DRY_ADDITIONS);
html._div();
html.table(id("hopTable").class_("table table-striped table-bordered"));
html.tr(id("hopTitle"));
html.th().write(Messages.HOP)._th();
html.th().write(Messages.AMOUNT)._th();
html.th().write(Messages.ALPHA)._th();
html.th().write(Messages.TIME)._th();
html._tr();
for(int i = 0; i < currentRecipe.getHopsListSize(); i++) {
Hop currentHop = currentRecipe.getHop(i);
if (!currentHop.getAdd().equals(Hop.DRY)) {
continue;
}
html.tr(id("hopDry-" + i));
html.td(id("hop-Name")).write(currentHop.getName())._td();
html.td(id("hop-Amount")).write(currentHop.getAmount().toString())._td();
html.td(id("hop-Alpha")).write(String.format("%.2f", currentHop.getAlpha()))._td();
html.td(id("hop-Time")).write(SBStringUtils.formatTime(currentHop.getMinutes()))._td();
html._tr();
}
html._table();
html.select(name("tempprobe").class_("form-control"));
html.option(value("").selected_if(true))
.write("Select Probe")
._option();
for (Temp entry: LaunchControl.tempList) {
html.option(value(entry.getName()))
.write(entry.getName())
._option();
}
html._select();
html.button(id("setDryHopProfile").class_("btn btn-default").onClick("setDryHopProfile(this)"))
.write(Messages.SET_DRY_HOP_PROFILE)._button();
html._div();
}
return html;
}
示例10: renderHops
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
/****
* Render the hops values for a HTML form
* @param html
* @return
* @throws IOException
*/
public HtmlCanvas renderHops(HtmlCanvas html) throws IOException
{
// Do we have hop additions?
if (currentRecipe.getHopsListSize() > 0) {
// Show them!
html.div(id("recipeBoilHops"));
html.div(class_("lead")).write(Messages.BOIL_ADDITIONS);
html._div();
html.table(id("hopTable").class_("table table-striped table-bordered"));
html.tr(id("hopTitle"));
html.th().write(Messages.HOP)._th();
html.th().write(Messages.AMOUNT)._th();
html.th().write(Messages.IBU)._th();
html.th().write(Messages.ALPHA)._th();
html.th().write(Messages.TIME)._th();
html._tr();
for(int i = 0; i < currentRecipe.getHopsListSize(); i++) {
if (!currentRecipe.getHop(i).getAdd().equals(Hop.BOIL)) {
continue;
}
html.tr(id("hopAdd-" + i));
html.td(id("hop-Name")).write(currentRecipe.getHop(i).getName())._td();
html.td(id("hop-Amount")).write(currentRecipe.getHop(i).getAmount().toString())._td();
html.td(id("hop-IBU")).write(String.format("%.2f", currentRecipe.getHop(i).getIBU()))._td();
html.td(id("hop-Alpha")).write(String.format("%.2f", currentRecipe.getHop(i).getAlpha()))._td();
html.td(id("hop-Time")).write(SBStringUtils.formatTime(currentRecipe.getHop(i).getMinutes()))._td();
html._tr();
}
html._table();
html.select(name("tempprobe").class_("form-control"));
html.option(value("").selected_if(true))
.write("Select Probe")
._option();
for (Temp entry: LaunchControl.tempList) {
html.option(value(entry.getName()))
.write(entry.getName())
._option();
}
html._select();
html.button(id("setBoilHopProfile").class_("btn btn-default").onClick("setBoilHopProfile(this)"))
.write(Messages.SET_BOIL_HOP_PROFILE)._button();
html._div();
}
return html;
}
示例11: renderMash
import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
public HtmlCanvas renderMash(HtmlCanvas html) throws IOException
{
// Do we have mash steps?
if (currentRecipe.getMash() != null && currentRecipe.getMash().getStepSize() > 0) {
// Show them!
Mash mash = currentRecipe.getMash();
html.div(id("recipeMash"));
html.div(class_("lead")).write(Messages.MASH_PROFILE);
html._div();
html.table(id("mashTable").class_("table table-striped table-bordered"));
html.tr();
html.td().write(Messages.METHOD)._td();
html.td().write(Messages.TYPE)._td();
html.td().write(Messages.START)._td();
html.td().write(Messages.END_TEMP)._td();
html.td().write(Messages.TIME)._td();
html._tr();
for(int i = 0; i < mash.getStepSize(); i++) {
html.tr(id("mashStep-" + i));
html.td(id("step-Method")).write(mash.getStepMethod(i))._td();
html.td(id("step-Type")).write(mash.getStepType(i))._td();
html.td(id("step-startTemp")).write(String.format("%.2f", mash.getStepStartTemp(i)) + mash.getStepTempU(i))._td();
html.td(id("step-endTemp")).write(String.format("%.2f", mash.getStepEndTemp(i)) + mash.getStepTempU(i))._td();
html.td(id("step-time")).write(SBStringUtils.formatTime(mash.getStepMin(i)))._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("setMashProfile").class_("btn btn-default").onClick("setMashProfile(this)"))
.write(Messages.SET_MASH_PROFILE)._button();
html._div();
}
return html;
}