本文整理汇总了Java中org.apache.wicket.markup.html.basic.Label.add方法的典型用法代码示例。如果您正苦于以下问题:Java Label.add方法的具体用法?Java Label.add怎么用?Java Label.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.basic.Label
的用法示例。
在下文中一共展示了Label.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(IModel<String> label, String labelSize, String textSize, boolean required) {
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
l.add(AttributeAppender.prepend("class", labelSize));
}
add(l);
WebMarkupContainer dateWrapper = new WebMarkupContainer(ID_DATE_WRAPPER);
if (StringUtils.isNotEmpty(textSize)) {
dateWrapper.add(AttributeAppender.prepend("class", textSize));
}
add(dateWrapper);
DateInput date = new DateInput(ID_DATE, new XmlGregorianCalendarModel(getModel()));
date.setRequired(required);
date.setLabel(label);
dateWrapper.add(date);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(date));
dateWrapper.add(feedback);
}
示例2: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout() {
Label titleLabel = new Label(ID_TITLE, new PropertyModel<>(getModel(), InformationType.F_TITLE.getLocalPart()));
titleLabel.add(new VisibleBehaviour(() -> getModelObject().getTitle() != null));
add(titleLabel);
ListView<InformationPartType> list = new ListView<InformationPartType>(ID_PARTS,
new PropertyModel<>(getModel(), InformationType.F_PART.getLocalPart())) {
@Override
protected void populateItem(ListItem<InformationPartType> item) {
InformationPartType part = item.getModelObject();
Label label = new Label(ID_PART, part.getText());
if (Boolean.TRUE.equals(part.isHasMarkup())) {
label.setEscapeModelStrings(false);
}
item.add(label);
}
};
add(list);
}
示例3: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(IModel<String> model, IModel<String> titleModel) {
AjaxLink link = new AjaxLink(ID_LINK) {
@Override
public void onClick(AjaxRequestTarget target) {
onClickPerformed(target);
}
};
Label image = new Label(ID_IMAGE);
image.add(AttributeModifier.replace("class", model));
if (titleModel != null) {
image.add(AttributeModifier.replace("title", titleModel));
}
link.add(image);
link.setOutputMarkupId(true);
add(link);
}
示例4: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize, String textSize) {
WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
add(labelContainer);
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
labelContainer.add(AttributeAppender.prepend("class", labelSize));
}
labelContainer.add(l);
Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
tooltipLabel.add(new AttributeAppender("data-original-title", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(tooltipKey);
}
}));
tooltipLabel.add(new InfoTooltipBehavior(isTooltipInModal));
tooltipLabel.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible() {
return tooltipKey != null;
}
});
tooltipLabel.setOutputMarkupId(true);
tooltipLabel.setOutputMarkupPlaceholderTag(true);
labelContainer.add(tooltipLabel);
WebMarkupContainer checkWrapper = new WebMarkupContainer(ID_CHECK_WRAPPER);
if (StringUtils.isNotEmpty(textSize)) {
checkWrapper.add(AttributeAppender.prepend("class", textSize));
}
add(checkWrapper);
CheckBox check = new CheckBox(ID_CHECK, getModel());
check.setLabel(label);
checkWrapper.add(check);
}
示例5: initContexts
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initContexts(WebMarkupContainer operationContent, final IModel<OpResult> model, Page parentPage) {
Label contextsLabel = new Label("contextsLabel", parentPage.getString("FeedbackAlertMessageDetails.contexts"));
contextsLabel.setOutputMarkupId(true);
contextsLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(model.getObject().getContexts());
}
});
operationContent.add(contextsLabel);
ListView<Context> contexts = new ListView<Context>("contexts", createContextsModel(model)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<Context> item) {
item.add(new Label("contextName", new PropertyModel<Object>(item.getModel(), "name")));
item.add(new Label("contextValue", new PropertyModel<Object>(item.getModel(), "value")));
}
};
contexts.setOutputMarkupId(true);
contexts.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(model.getObject().getContexts());
}
});
operationContent.add(contexts);
}
示例6: initCountPanel
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private Label initCountPanel(final IModel<OpResult> model) {
Label count = new Label("count", new PropertyModel<String>(model, "count"));
count.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
OpResult result = model.getObject();
return result.getCount() > 1;
}
});
return count;
}
示例7: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
protected void initLayout(final WebMarkupContainer capabilitiesTable, PageResourceWizard parentPage) {
parentPage.addEditingEnabledBehavior(this);
Label passLabel = new Label(ID_LABEL_PASSWORD, createStringResource("capabilityCredentialsPanel.label.password"));
add(passLabel);
CheckBox enabled = new CheckBox(ID_ENABLED, new PropertyModel<Boolean>(getModel(), "capability.enabled"));
enabled.add(new EmptyOnChangeAjaxFormUpdatingBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(capabilitiesTable);
}
});
add(enabled);
CheckBox passwordEnabled = new CheckBox(ID_PASSWORD_ENABLED, new PropertyModel<Boolean>(getModel(), "capability.password.enabled"));
add(passwordEnabled);
CheckBox passwordReturned = new CheckBox(ID_PASSWORD_RETURNED, new PropertyModel<Boolean>(getModel(), "capability.password.returnedByDefault"));
add(passwordReturned);
Label enabledTooltip = new Label(ID_T_ENABLED);
enabledTooltip.add(new InfoTooltipBehavior());
add(enabledTooltip);
Label passEnabledTooltip = new Label(ID_T_PASS_ENABLED);
passEnabledTooltip.add(new InfoTooltipBehavior());
add(passEnabledTooltip);
Label passReturnTooltip = new Label(ID_T_PASS_RETURN);
passReturnTooltip.add(new InfoTooltipBehavior());
add(passReturnTooltip);
}
示例8: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
protected void initLayout(final WebMarkupContainer capabilitiesTable, PageResourceWizard parentPage) {
parentPage.addEditingEnabledBehavior(this);
CheckBox enabled = new CheckBox(ID_ENABLED, new PropertyModel<Boolean>(getModel(), "capability.enabled"));
enabled.add(new EmptyOnChangeAjaxFormUpdatingBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(capabilitiesTable);
}
});
add(enabled);
MultiValueTextPanel onConnector = new MultiValueTextPanel(ID_ON_CONNECTOR, prepareOnConnectorModel(), parentPage.getReadOnlyModel(), true);
add(onConnector);
MultiValueTextPanel onResource = new MultiValueTextPanel(ID_ON_RESOURCE, Model.of(prepareOnResourceModel()), parentPage.getReadOnlyModel(),
true);
add(onResource);
Label enabledTooltip = new Label(ID_T_ENABLED);
enabledTooltip.add(new InfoTooltipBehavior());
add(enabledTooltip);
Label onConnectorTooltip = new Label(ID_T_ON_CONNECTOR);
onConnectorTooltip.add(new InfoTooltipBehavior());
add(onConnectorTooltip);
Label onResourceTooltip = new Label(ID_T_ON_RESOURCE);
onResourceTooltip.add(new InfoTooltipBehavior());
add(onResourceTooltip);
}
示例9: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(IModel<InlineMenuItem> item) {
final InlineMenuItem menuItem = item.getObject();
Label menuItemLabel = new Label(ID_MENU_ITEM_LABEL, menuItem.getLabel());
menuItemLabel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return menuItem.isMenuHeader();
}
});
add(menuItemLabel);
}
示例10: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize,
String textSize, boolean required, int rowNumber) {
WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
add(labelContainer);
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
labelContainer.add(AttributeAppender.prepend("class", labelSize));
}
labelContainer.add(l);
Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
tooltipLabel.add(new AttributeAppender("data-original-title", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(tooltipKey);
}
}));
tooltipLabel.add(new InfoTooltipBehavior(isTooltipInModal));
tooltipLabel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return tooltipKey != null;
}
});
tooltipLabel.setOutputMarkupId(true);
tooltipLabel.setOutputMarkupPlaceholderTag(true);
labelContainer.add(tooltipLabel);
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
if (StringUtils.isNotEmpty(textSize)) {
textWrapper.add(AttributeAppender.prepend("class", textSize));
}
add(textWrapper);
AceEditor text = new AceEditor(ID_TEXT, getModel());
text.add(new AttributeModifier("rows", rowNumber));
text.setOutputMarkupId(true);
text.setRequired(required);
text.setLabel(label);
text.add(AttributeAppender.replace("placeholder", label));
textWrapper.add(text);
}
示例11: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize, String textSize, final boolean required,
final boolean markAsRequired) {
WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
add(labelContainer);
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
labelContainer.add(AttributeAppender.prepend("class", labelSize));
}
labelContainer.add(l);
Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
tooltipLabel.add(new AttributeAppender("data-original-title", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(tooltipKey);
}
}));
tooltipLabel.add(new InfoTooltipBehavior(isTooltipInModal));
tooltipLabel.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible() {
return tooltipKey != null;
}
});
tooltipLabel.setOutputMarkupId(true);
tooltipLabel.setOutputMarkupPlaceholderTag(true);
labelContainer.add(tooltipLabel);
WebMarkupContainer requiredContainer = new WebMarkupContainer(ID_REQUIRED);
requiredContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return markAsRequired;
}
});
labelContainer.add(requiredContainer);
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
if (StringUtils.isNotEmpty(textSize)) {
textWrapper.add(AttributeAppender.prepend("class", textSize));
}
add(textWrapper);
TextField text = createText(getModel(), label, required);
text.setLabel(label);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ContainerFeedbackMessageFilter(this));
feedback.setOutputMarkupId(true);
textWrapper.add(feedback);
}
示例12: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(final IModel<String> label, final String labelSize, final String textSize,
final boolean required) {
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
l.add(AttributeAppender.prepend("class", labelSize));
}
add(l);
ListView repeater = new ListView<T>(ID_REPEATER, getModel()) {
@Override
protected void populateItem(final ListItem<T> item) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.add(AttributeAppender.prepend("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
StringBuilder sb = new StringBuilder();
if (StringUtils.isNotEmpty(textSize)) {
sb.append(textSize).append(' ');
}
if (item.getIndex() > 0 && StringUtils.isNotEmpty(getOffsetClass())) {
sb.append(getOffsetClass()).append(' ');
sb.append(CLASS_MULTI_VALUE);
}
return sb.toString();
}
}));
item.add(textWrapper);
TextField text = new TextField(ID_TEXT, createTextModel(item.getModel()));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
}
});
text.setRequired(required);
text.add(AttributeAppender.replace("placeholder", label));
text.setLabel(label);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
buttonGroup.add(AttributeAppender.append("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (item.getIndex() > 0 && StringUtils.isNotEmpty(labelSize)) {
return CLASS_MULTI_VALUE;
}
return null;
}
}));
item.add(buttonGroup);
initButtons(buttonGroup, item);
}
};
add(repeater);
}
示例13: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize,
String textSize, boolean required, int rowNumber) {
WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
add(labelContainer);
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
labelContainer.add(AttributeAppender.prepend("class", labelSize));
}
labelContainer.add(l);
Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
tooltipLabel.add(new AttributeAppender("data-original-title", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(tooltipKey);
}
}));
tooltipLabel.add(new InfoTooltipBehavior(isTooltipInModal));
tooltipLabel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return tooltipKey != null;
}
});
tooltipLabel.setOutputMarkupId(true);
tooltipLabel.setOutputMarkupPlaceholderTag(true);
labelContainer.add(tooltipLabel);
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
if (StringUtils.isNotEmpty(textSize)) {
textWrapper.add(AttributeAppender.prepend("class", textSize));
}
add(textWrapper);
TextArea text = new TextArea<>(ID_TEXT, getModel());
text.add(new AttributeModifier("rows", rowNumber));
text.setOutputMarkupId(true);
text.setRequired(required);
text.setLabel(label);
text.add(AttributeAppender.replace("placeholder", label));
textWrapper.add(text);
}
示例14: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(PageSystemConfiguration parentPage) {
WebMarkupContainer profilingEnabledNote = new WebMarkupContainer(ID_PROFILING_ENABLED_NOTE);
profilingEnabledNote.setVisible(!parentPage.getMidpointConfiguration().isProfilingEnabled());
add(profilingEnabledNote);
//Entry-Exit profiling init
DropDownChoice<ProfilingLevel> profilingLevel = new DropDownChoice<>("profilingLevel",
new PropertyModel<ProfilingLevel>(getModel(), "profilingLevel"),
WebComponentUtil.createReadonlyModelFromEnum(ProfilingLevel.class),
new EnumChoiceRenderer<ProfilingLevel>(this));
profilingLevel.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
add(profilingLevel);
DropDownChoice<String> profilingAppender = new DropDownChoice<>("profilingAppender",
new PropertyModel<String>(getModel(), "profilingAppender"), createAppendersListModel());
profilingAppender.setNullValid(true);
profilingAppender.add(new EmptyOnChangeAjaxFormUpdatingBehavior());
add(profilingAppender);
//Subsystem and general profiling init
CheckBox requestFilter = WebComponentUtil.createAjaxCheckBox("requestFilter", new PropertyModel<Boolean>(getModel(), "requestFilter"));
CheckBox performanceStatistics = WebComponentUtil.createAjaxCheckBox("performanceStatistics", new PropertyModel<Boolean>(getModel(), "performanceStatistics"));
CheckBox subsystemModel = WebComponentUtil.createAjaxCheckBox("subsystemModel", new PropertyModel<Boolean>(getModel(), "subsystemModel"));
CheckBox subsystemRepository = WebComponentUtil.createAjaxCheckBox("subsystemRepository", new PropertyModel<Boolean>(getModel(), "subsystemRepository"));
CheckBox subsystemProvisioning = WebComponentUtil.createAjaxCheckBox("subsystemProvisioning", new PropertyModel<Boolean>(getModel(), "subsystemProvisioning"));
//CheckBox subsystemUcf = WebComponentUtil.createAjaxCheckBox("subsystemUcf", new PropertyModel<Boolean>(getModel(), "subsystemUcf"));
CheckBox subsystemResourceObjectChangeListener = WebComponentUtil.createAjaxCheckBox("subsystemSynchronizationService", new PropertyModel<Boolean>(getModel(), "subsystemSynchronizationService"));
CheckBox subsystemTaskManager = WebComponentUtil.createAjaxCheckBox("subsystemTaskManager", new PropertyModel<Boolean>(getModel(), "subsystemTaskManager"));
CheckBox subsystemWorkflow = WebComponentUtil.createAjaxCheckBox("subsystemWorkflow", new PropertyModel<Boolean>(getModel(), "subsystemWorkflow"));
add(requestFilter);
add(performanceStatistics);
add(subsystemModel);
add(subsystemRepository);
add(subsystemProvisioning);
//add(subsystemUcf);
add(subsystemResourceObjectChangeListener);
add(subsystemTaskManager);
add(subsystemWorkflow);
TextField<Integer> dumpInterval = WebComponentUtil.createAjaxTextField("dumpInterval", new PropertyModel<Integer>(getModel(),
"dumpInterval"));
add(dumpInterval);
Label dumpIntervalTooltip = new Label(ID_DUMP_INTERVAL_TOOLTIP);
dumpIntervalTooltip.add(new InfoTooltipBehavior());
add(dumpIntervalTooltip);
}
示例15: createTitleLabel
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
@Override
protected Label createTitleLabel(String id) {
final Label label = new Label(id, new SolrFieldNameModel(getModel()));
label.add(new AttributeAppender("title", new SolrFieldDescriptionModel(getModel())));
return label;
}