本文整理汇总了Java中org.apache.ecs.html.Label类的典型用法代码示例。如果您正苦于以下问题:Java Label类的具体用法?Java Label怎么用?Java Label使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Label类属于org.apache.ecs.html包,在下文中一共展示了Label类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: wrapInputInFormGroup
import org.apache.ecs.html.Label; //导入依赖的package包/类
private Element wrapInputInFormGroup(final IModelElement<?> e, final ConcreteElement element,
final String additionalClass) {
final Div divFormGroup = new Div();
divFormGroup.setClass("form-group");
final Label label = createLabel(e, null);
divFormGroup.addElement(label);
final Div divCol = new Div();
divCol.setClass("col-sm-4");
setGridColumnId(e, divCol);
if (Strings.isNotBlank(additionalClass)) {
Attributes.merge(element, "class", additionalClass);
}
divCol.addElement(element);
divFormGroup.addElement(divCol);
return divFormGroup;
}
示例2: wrapComponent
import org.apache.ecs.html.Label; //导入依赖的package包/类
@Override
protected Element wrapComponent(DomainElementI<?> e, Element element) {
//<div class="control-group">
Div controlGroup = new Div();
controlGroup.addAttribute(ATTR_CLASS, "control-group");
if (isInputButton(element))
((Input) element).setValue(e.getPrompt());
else {
// <label for="vertrag.Vertragsnummer" class="control-label">Salutation</label>
Label label = createLabel(e, element);
label.addAttribute(ATTR_CLASS, "control-label");
controlGroup.addElement(label);
}
// <div class="controls controls-row">
Div controlsRow = new Div();
controlsRow.addAttribute(ATTR_CLASS, "controls");
// <select class="span4" wicket:id="vertrag.Vertragsnummer" id="vertrag.Vertragsnummer" size="1"><option>[option]</option></select>
controlsRow.addElement(element);
// </div>
controlGroup.addElement(controlsRow);
//</div>
return controlGroup;
}
示例3: wrapCheckBoxInFormGroup
import org.apache.ecs.html.Label; //导入依赖的package包/类
private Element wrapCheckBoxInFormGroup(final CheckBoxInputModelElement e, final Input input) {
final Div divFormGroup = new Div();
divFormGroup.setClass("form-group");
final Div divCol = new Div();
divCol.setClass("col-sm-offset-2 col-sm-4");
setGridColumnId(e, divCol);
final Div divCheckbox = new Div();
divCheckbox.setClass("checkbox");
final Label label = createLabel(e, input);
divCheckbox.addElement(label);
divCol.addElement(divCheckbox);
divFormGroup.addElement(divCol);
return divFormGroup;
}
示例4: createLabel
import org.apache.ecs.html.Label; //导入依赖的package包/类
/**
* About how to create labels in wicket: https://cwiki.apache.org/confluence/display/WICKET/Wicket%27s+XHTML+tags
*/
private Label createLabel(final IModelElement<?> e, final Input input) {
final Label label = new Label();
label.addAttribute("wicket:for", e.getWicketId());
if (input == null) {
label.setClass("control-label col-sm-2");
} else {
label.addElement(input);
}
final XML wicketLabel = new XML("wicket:label");
wicketLabel.setTagText(e.getStaticTitle());
label.addElement(wicketLabel);
return label;
}
示例5: createLabel
import org.apache.ecs.html.Label; //导入依赖的package包/类
public Label createLabel(DomainElementI<?> de, Element e) {
Label label = new Label();
String prompt = de.getPrompt();
// Wicket doesn't support Labels for button-types input fields which we
// are using for file downloads
if (isInputButton(e)) {
label.setTagText(prompt);
} else {
label.addAttribute(ATTR_WICKET_ID, de.getWicketId() + ".label");
label.addAttribute("for", de.getWicketId());
label.addElement(de.getPrompt());
}
return label;
}
示例6: createFieldset
import org.apache.ecs.html.Label; //导入依赖的package包/类
public FieldSet createFieldset(HeadlineElement<?> headlineElement) {
// <fieldset><legend><label>my.text</label></legend></fieldset>
FieldSet fieldset = new FieldSet();
Label label = createFieldsetHeaderLabel(headlineElement);
fieldset.addElement(new Legend(label));
return fieldset;
}
示例7: createFieldsetHeaderLabel
import org.apache.ecs.html.Label; //导入依赖的package包/类
public Label createFieldsetHeaderLabel(HeadlineElement<?> headlineElement) {
Label label = new Label();
WebDomainProperties configuration = getProperties();
String key;
if (configuration.isLocalizationWicket()) {
key = headlineElement.getWicketId() + ".text";
} else {
// package.ClassName._property.text
key = FormBuilder.buildPromptIdentifier(headlineElement
.getAccessor().getClassRef(), headlineElement.getMethod(),
headlineElement.getPrompt());
}
label.addElement(key);
return label;
}
示例8: visitFieldsetOpen
import org.apache.ecs.html.Label; //导入依赖的package包/类
@Override
public void visitFieldsetOpen(HeadlineElement<E> e) {
TR tablerow = new TR();
//TODO JL: Legend is not allowed any more in a table cells since HTML although it looks fine
Legend legend = new Legend();
Label label = componentBuilder.createFieldsetHeaderLabel(e);
legend.addElement(label);
tablerow.addElement(new TD().setColSpan(5).addElement(legend));
maybeAdd(tablerow);
collectedButtons.push(new ArrayList<Element>());
}
示例9: makeField
import org.apache.ecs.html.Label; //导入依赖的package包/类
/**
* Description of the Method
*
* @param labeltext
* Description of the Parameter
* @param value
* Description of the Parameter
* @param e
* Description of the Parameter
* @return Description of the Return Value
*/
public static TR makeField(String labeltext, String value, Element e)
{
TD left = new TD().setAlign("right");
Label label = new Label().addElement(labeltext);
left.addElement(label);
TD right = new TD().setAlign("left");
right.addElement(e);
TR row = new TR();
row.addElement(left);
row.addElement(right);
return (row);
}
示例10: makeOption
import org.apache.ecs.html.Label; //导入依赖的package包/类
/**
* Description of the Method
*
* @param labeltext
* Description of the Parameter
* @param value
* Description of the Parameter
* @param e
* Description of the Parameter
* @return Description of the Return Value
*/
public static TR makeOption(String labeltext, String value, Element e)
{
TD left = new TD().setAlign("left").setWidth("10%");
left.addElement(e);
TD right = new TD().setAlign("right");
Label label = new Label().addElement(labeltext);
right.addElement(label);
TR row = new TR();
row.addElement(right);
row.addElement(left);
return (row);
}
示例11: createFieldsetHeaderLabel
import org.apache.ecs.html.Label; //导入依赖的package包/类
public Label createFieldsetHeaderLabel(HeadlineElement<?> headlineElement);
示例12: createLabel
import org.apache.ecs.html.Label; //导入依赖的package包/类
public Label createLabel(DomainElementI<?> de, Element e);