本文整理汇总了Java中org.apache.wicket.markup.html.basic.Label.setOutputMarkupId方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setOutputMarkupId方法的具体用法?Java Label.setOutputMarkupId怎么用?Java Label.setOutputMarkupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.basic.Label
的用法示例。
在下文中一共展示了Label.setOutputMarkupId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NotificationPage
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
public NotificationPage() {
super();
// Create the modal window.
this.addNotificationModal = new AddNotificationModal("addNotificationModal", this);
this.add(this.addNotificationModal);
// add notificationList
if (((AuthenticatedSession) Session.get()).getUser() != null) {
// logged in users see their notifications
final NotificationList notificationList = new NotificationList("notificationList", this);
notificationList.setOutputMarkupId(true);
this.add(notificationList);
} else {
final Label notificationListLabel = new Label("notificationList", "Log in to check your notifications.");
notificationListLabel.setOutputMarkupId(true);
this.add(notificationListLabel);
}
this.form = new Form<Void>("form");
this.form.add(this.addAddButton());
this.form.add(this.addDeleteAllButton());
this.add(this.form);
this.addNotificationRules();
}
示例2: 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);
}
示例3: updateAssignmentName
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void updateAssignmentName(AjaxRequestTarget target, Boolean isManager){
Label nameLabel = new Label(ID_NAME_LABEL, createAssignmentNameLabelModel(isManager));
nameLabel.setOutputMarkupId(true);
AjaxLink name = (AjaxLink) get(createComponentPath(ID_HEADER_ROW, ID_NAME));
name.addOrReplace(nameLabel);
target.add(name);
}
示例4: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(final CatalogItemsPanel catalogItemsPanel) {
WebMarkupContainer footerContainer = new WebMarkupContainer(ID_FOOTER_CONTAINER);
footerContainer.setOutputMarkupId(true);
final Label count = new Label(ID_COUNT, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return "";
}
});
count.setOutputMarkupId(true);
footerContainer.add(count);
BoxedPagingPanel nb2 = new BoxedPagingPanel(ID_PAGING, catalogItemsPanel, true) {
@Override
protected void onPageChanged(AjaxRequestTarget target, long page) {
CatalogItemsPanel catalogPanel = PagingFooter.this.findParent(CatalogItemsPanel.class);
catalogPanel.refreshItemsPanel();
target.add(catalogPanel);
target.add(count);
}
};
footerContainer.add(nb2);
add(footerContainer);
}
示例5: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
protected void initLayout(){
WebMarkupContainer typeImage = new WebMarkupContainer(ID_TYPE_IMAGE);
typeImage.setOutputMarkupId(true);
typeImage.add(AttributeModifier.append("class", createImageModel()));
typeImage.add(AttributeModifier.append("class", getAdditionalNameLabelStyleClass()));
add(typeImage);
Label name = new Label(ID_ASSIGNMENT_NAME, createHeaderModel());
name.add(AttributeModifier.append("class", getAdditionalNameLabelStyleClass()));
name.setOutputMarkupId(true);
add(name);
add(new Label(ID_DESCRIPTION, Model.of(getModelObject().getDescription())));
add(initPropertiesContainer(ID_PROPERTIES_PANEL));
AssignmentActivationPopupablePanel activationPanel = new AssignmentActivationPopupablePanel(ID_ACTIVATION_PANEL, getModel()){
private static final long serialVersionUID = 1L;
@Override
protected boolean getButtonsPanelVisibility() {
return false;
}
};
activationPanel.setOutputMarkupId(true);
add(activationPanel);
AjaxButton doneButton = new AjaxButton(ID_DONE_BUTTON, createStringResource("AbstractAssignmentDetailsPanel.doneButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
redirectBack(ajaxRequestTarget);
}
};
add(doneButton);
}
示例6: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
public void initLayout() {
// final Label question = new Label (F_QUESTION, mod.getPwdQuestion());
final Label question = new Label(F_QUESTION, new PropertyModel<PasswordQuestionsDto>(mod,
PasswordQuestionsDto.F_MY_QUESTIONS__QUESTIONITSELF));
question.setOutputMarkupId(true);
add(question);
final TextField<String> answer = new TextField<String>(F_ANSWER, new PropertyModel(mod,
SecurityQuestionAnswerDTO.F_PASSWORD_QUESTION_ANSWER));
answer.setRequired(true);
answer.setOutputMarkupId(true);
add(answer);
}
示例7: 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);
}
示例8: createResourcesList
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private PageableListView createResourcesList(String id, SolrFieldModel<String> resourceModel) {
// list of resources in this record
final IModel<List<String>> resourceListModel = new CollectionListModel<>(resourceModel);
// use a a pageable view so that the number of resources actually shown is limited
return new PageableListView<String>(id, resourceListModel, MAX_RESOURCES_TO_SHOW) {
@Override
protected void populateItem(final ListItem<String> item) {
// get resource string converted into a ResourceInfo model
final ResourceInfoModel resourceInfoModel = new ResourceInfoModel(resourceStringConverter, item.getModel());
final Label resourceName = new Label("resourceName", new PropertyModel(resourceInfoModel, "fileName"));
// once loaded, make Ajax request to resolve handles and update resource link
resourceName.add(new LazyResourceInfoUpdateBehavior(resolvingResourceStringConverter, resourceInfoModel) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
// update resource link
target.add(resourceName);
}
});
resourceName.setOutputMarkupId(true);
item.add(new RecordPageLink("resourceLink", SearchResultItemExpandedPanel.this.getModel(), searchContextModel, RecordPage.RESOURCES_SECTION)
.add(resourceName));
item.add(new ExternalLink("downloadLink", new HandleLinkModel(new PropertyModel(resourceInfoModel, "href"))));
item.add(new ResourceTypeGlyphicon("resourceTypeIcon", new PropertyModel<String>(resourceInfoModel, "resourceType")));
}
};
}
示例9: 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);
}
示例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, 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);
}
示例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, 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);
}
示例12: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(){
WebMarkupContainer metadataBlock = new WebMarkupContainer(ID_METADATA_BLOCK);
metadataBlock.setOutputMarkupId(true);
add(metadataBlock);
WebMarkupContainer headerContainer = new WebMarkupContainer(ID_HEADER_CONTAINER);
headerContainer.setOutputMarkupId(true);
headerContainer.add(new AttributeAppender("class", "prism-header " + additionalHeaderStyle));
metadataBlock.add(headerContainer);
Label metadataHeader = new Label(ID_METADATA_LABEL,
createStringResource("AssignmentEditorPanel.metadataBlock", header != null ? header : ""));
metadataHeader.setOutputMarkupId(true);
headerContainer.add(metadataHeader);
RepeatingView metadataRowRepeater = new RepeatingView(ID_METADATA_ROW);
metadataBlock.add(metadataRowRepeater);
for (QName qname : metadataFieldsList){
WebMarkupContainer metadataRow = new WebMarkupContainer(metadataRowRepeater.newChildId());
metadataRow.setOutputMarkupId(true);
if (metadataFieldsList.indexOf(qname) % 2 != 0){
metadataRow.add(new AttributeAppender("class", "stripe"));
}
metadataRowRepeater.add(metadataRow);
metadataRow.add(new Label(ID_METADATA_PROPERTY_KEY, createStringResource(DOT_CLASS + qname.getLocalPart())));
AbstractReadOnlyModel<String> metadataFieldModel = new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
PropertyModel<Object> tempModel = new PropertyModel<Object>(getModel(),
qname.getLocalPart());
if (tempModel.getObject() instanceof XMLGregorianCalendar){
return WebComponentUtil.getLocalizedDate((XMLGregorianCalendar)tempModel.getObject(),
DateLabelComponent.MEDIUM_MEDIUM_STYLE);
} else if (tempModel.getObject() instanceof ObjectReferenceType){
ObjectReferenceType ref = (ObjectReferenceType) tempModel.getObject();
return WebComponentUtil.getName(ref, getPageBase(), OPERATION_LOAD_USER);
} else if (tempModel.getObject() instanceof List){
List list = (List) tempModel.getObject();
String result = "";
for (Object o : list){
if (o instanceof ObjectReferenceType){
if (result.length() > 0){
result += ", ";
}
result += WebComponentUtil.getName((ObjectReferenceType) o, getPageBase(), OPERATION_LOAD_USER);
}
}
return result;
}
return "";
}
};
metadataRow.add(new Label(ID_METADATA_FILED, metadataFieldModel));
metadataRow.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible(){
return StringUtils.isNotEmpty(metadataFieldModel.getObject());
}
});
}
}
示例13: initCartButton
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initCartButton(WebMarkupContainer headerPanel){
AjaxButton cartButton = new AjaxButton(ID_CART_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
}
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
pageBase.navigateToNext(new PageAssignmentsList(true));
}
};
cartButton.add(new VisibleEnableBehaviour(){
public boolean isVisible(){
return !isCatalogOidEmpty();
}
});
cartButton.setOutputMarkupId(true);
headerPanel.add(cartButton);
Label cartItemsCount = new Label(ID_CART_ITEMS_COUNT, new LoadableModel<String>(true) {
private static final long serialVersionUID = 1L;
@Override
public String load(){
return Integer.toString(getRoleCatalogStorage().getAssignmentShoppingCart().size());
}
});
cartItemsCount.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
SessionStorage storage = pageBase.getSessionStorage();
if (storage.getRoleCatalog().getAssignmentShoppingCart().size() == 0) {
return false;
} else {
return true;
}
}
});
cartItemsCount.setOutputMarkupId(true);
cartButton.add(cartItemsCount);
}
示例14: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(final IModel<LockoutStatusType> model){
WebMarkupContainer container = new WebMarkupContainer(ID_CONTAINER);
add(container);
Label label = new Label(ID_LABEL, new IModel<String>() {
@Override
public String getObject() {
LockoutStatusType object = model != null ? model.getObject() : null;
String labelValue = object == null ?
((PageBase)getPage()).createStringResource("LockoutStatusType.UNDEFINED").getString()
: WebComponentUtil.createLocalizedModelForEnum(object, getLabel()).getObject();
if (!isInitialState){
labelValue += " " + ((PageBase) getPage()).createStringResource("LockoutStatusPanel.changesSaving").getString();
}
return labelValue;
}
@Override
public void setObject(String s) {
}
@Override
public void detach() {
}
});
label.setOutputMarkupId(true);
container.add(label);
AjaxButton button = new AjaxButton(ID_BUTTON, getButtonModel()) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
PrismPropertyValue oldValue = (PrismPropertyValue)valueWrapper.getOldValue();
if (!isInitialState){
model.setObject(initialValue);
oldValue.setValue(initialValue);
valueWrapper.setStatus(ValueStatus.NOT_CHANGED);
} else {
model.setObject(LockoutStatusType.NORMAL);
if (oldValue.getValue() != null) {
oldValue.setValue(null);
}
}
isInitialState = !isInitialState;
ajaxRequestTarget.add(getButton());
ajaxRequestTarget.add(getLabel());
}
};
button.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible(){
return true;
}
});
button.setOutputMarkupId(true);
container.add(button);
}
示例15: initLayout
import org.apache.wicket.markup.html.basic.Label; //导入方法依赖的package包/类
private void initLayout(String localPartLabelKey, String localPartTooltipKey,
String namespaceLabelKey, String namespaceTooltipKey, boolean markLocalPartAsRequired, boolean markNamespaceAsRequired){
Label localPartLabel = new Label(ID_LOCAL_PART_LABEL, getString(localPartLabelKey));
localPartLabel.setOutputMarkupId(true);
localPartLabel.setOutputMarkupPlaceholderTag(true);
add(localPartLabel);
WebMarkupContainer localPartRequired = new WebMarkupContainer(ID_LOCAL_PART_REQUIRED);
localPartRequired.setVisible(markLocalPartAsRequired);
add(localPartRequired);
Label namespaceLabel = new Label(ID_NAMESPACE_LABEL, getString(namespaceLabelKey));
namespaceLabel.setOutputMarkupId(true);
namespaceLabel.setOutputMarkupPlaceholderTag(true);
add(namespaceLabel);
WebMarkupContainer namespaceRequired = new WebMarkupContainer(ID_NAMESPACE_REQUIRED);
namespaceRequired.setVisible(markNamespaceAsRequired);
add(namespaceRequired);
TextField localPart = new TextField<>(ID_LOCAL_PART, localpartModel);
localPart.setOutputMarkupId(true);
localPart.setOutputMarkupPlaceholderTag(true);
localPart.setRequired(isLocalPartRequired());
localPart.add(new UpdateBehavior());
add(localPart);
DropDownChoice namespace = new DropDownChoice<>(ID_NAMESPACE, namespaceModel, prepareNamespaceList());
namespace.setOutputMarkupId(true);
namespace.setOutputMarkupPlaceholderTag(true);
namespace.setNullValid(false);
namespace.setRequired(isNamespaceRequired());
namespace.add(new UpdateBehavior());
add(namespace);
Label localPartTooltip = new Label(ID_T_LOCAL_PART);
localPartTooltip.add(new AttributeAppender("data-original-title", getString(localPartTooltipKey)));
localPartTooltip.add(new InfoTooltipBehavior());
localPartTooltip.setOutputMarkupPlaceholderTag(true);
add(localPartTooltip);
Label namespaceTooltip = new Label(ID_T_NAMESPACE);
namespaceTooltip.add(new AttributeAppender("data-original-title", getString(namespaceTooltipKey)));
namespaceTooltip.add(new InfoTooltipBehavior());
namespaceTooltip.setOutputMarkupPlaceholderTag(true);
add(namespaceTooltip);
}