本文整理汇总了Java中org.apache.wicket.markup.html.WebMarkupContainer.add方法的典型用法代码示例。如果您正苦于以下问题:Java WebMarkupContainer.add方法的具体用法?Java WebMarkupContainer.add怎么用?Java WebMarkupContainer.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.WebMarkupContainer
的用法示例。
在下文中一共展示了WebMarkupContainer.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newSuggestionItem
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private Component newSuggestionItem(String itemId, InputCompletion suggestion) {
WebMarkupContainer item = new WebMarkupContainer(itemId);
WebMarkupContainer link = new WebMarkupContainer("link");
Range matchRange = suggestion.getMatchRange();
String label = suggestion.getLabel();
if (matchRange != null) {
String prefix = StringEscapeUtils.escapeHtml4(label.substring(0, matchRange.getFrom()));
String suffix = StringEscapeUtils.escapeHtml4(label.substring(matchRange.getTo()));
String matched = StringEscapeUtils.escapeHtml4(label.substring(matchRange.getFrom(), matchRange.getTo()));
link.add(new Label("label", prefix + "<b>" + matched + "</b>" + suffix).setEscapeModelStrings(false));
} else {
link.add(new Label("label", label));
}
item.add(link);
if (suggestion.getDescription() != null)
item.add(new Label("description", suggestion.getDescription()));
else
item.add(new Label("description").setVisible(false));
item.add(AttributeAppender.append("data-content", suggestion.complete(inputStatus).getContent()));
item.add(AttributeAppender.append("data-caret", suggestion.getCaret()));
item.setOutputMarkupId(true);
return item;
}
示例2: newManageContainer
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private WebMarkupContainer newManageContainer() {
WebMarkupContainer container = new WebMarkupContainer("manage");
container.setVisible(SecurityUtils.canModify(getPullRequest()));
container.add(new Link<Void>("synchronize") {
@Override
public void onClick() {
GitPlex.getInstance(PullRequestManager.class).check(getPullRequest());
Session.get().success("Pull request is synchronized");
}
});
container.add(new Link<Void>("delete") {
@Override
public void onClick() {
PullRequest request = getPullRequest();
GitPlex.getInstance(PullRequestManager.class).delete(request);
Session.get().success("Pull request #" + request.getNumber() + " is deleted");
setResponsePage(RequestListPage.class, RequestListPage.paramsOf(getProject()));
}
}.add(new ConfirmOnClick("Do you really want to delete this pull request?")));
return container;
}
示例3: newAddReplyContainer
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private WebMarkupContainer newAddReplyContainer() {
WebMarkupContainer addReplyContainer = new Fragment("addReply", "addReplyFrag", this) {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(SecurityUtils.getUser() != null);
}
};
addReplyContainer.setOutputMarkupId(true);
addReplyContainer.add(new AjaxLink<Void>("reply") {
@Override
public void onClick(AjaxRequestTarget target) {
onAddReply(target, false, null);
}
});
return addReplyContainer;
}
示例4: newSinceChangesRow
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private Component newSinceChangesRow(String id, Date sinceDate) {
WebMarkupContainer row = new WebMarkupContainer(id);
row.setOutputMarkupId(true);
row.add(AttributeAppender.append("class", " non-discussion"));
WebMarkupContainer avatarColumn = new WebMarkupContainer("avatar");
avatarColumn.add(new WebMarkupContainer("avatar"));
row.add(avatarColumn);
WebMarkupContainer contentColumn = new Fragment("content", "sinceChangesRowContentFrag", this);
contentColumn.add(new SinceChangesLink("sinceChanges", requestModel, sinceDate));
row.add(contentColumn);
row.add(AttributeAppender.append("class", "since-changes"));
return row;
}
示例5: newAdditionalActions
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
@Override
public WebMarkupContainer newAdditionalActions(String id) {
WebMarkupContainer actions = new Fragment(id, "actionsFrag", this);
if (!symbols.isEmpty()) {
actions.add(new CheckBox("outline", Model.of(isOutlineVisibleInitially())).add(new OnChangeAjaxBehavior() {
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setMethod(Method.POST);
}
@Override
protected void onUpdate(AjaxRequestTarget target) {
toggleOutline(target);
}
}));
} else {
actions.add(new WebMarkupContainer("outline").setVisible(false));
}
return actions;
}
示例6: createInfoContainer
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private WebMarkupContainer createInfoContainer(final String id) {
final WebMarkupContainer container = new WebMarkupContainer(id) {
@Override
protected void onConfigure() {
setVisible(isInfoAvailable());
}
};
//add labels for all license values
container.add(createLicenseItems("license"));
//add labels for all availability values
container.add(createAvailabilityItems("availability"));
container.add(createAccessInfo("accessInfo"));
container.add(createOriginalContextContainer("originalContext"));
return container;
}
示例7: initLayout
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private void initLayout() {
Form mainForm = new Form("mainForm");
mainForm.setMultiPart(true);
add(mainForm);
WebMarkupContainer protectedMessage = new WebMarkupContainer(ID_PROTECTED_MESSAGE);
protectedMessage.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
ObjectWrapper wrapper = accountModel.getObject();
return wrapper.isProtectedAccount();
}
});
mainForm.add(protectedMessage);
PrismObjectPanel<ShadowType> userForm = new PrismObjectPanel<ShadowType>("account", accountModel, new PackageResourceReference(
ImgResources.class, ImgResources.HDD_PRISM), mainForm, this);
mainForm.add(userForm);
initButtons(mainForm);
}
示例8: addRelationDropDown
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private void addRelationDropDown(WebMarkupContainer relationContainer){
List<RelationTypes> availableRelations = getModelObject().getNotAssignedRelationsList();
DropDownChoicePanel relation = WebComponentUtil.createEnumPanel(RelationTypes.class, ID_RELATION,
getModelObject().isMultyAssignable() ?
WebComponentUtil.createReadonlyModelFromEnum(RelationTypes.class) : Model.ofList(availableRelations),
getRelationModel(availableRelations), this, false);
relation.setEnabled(getModel().getObject().isEditable());
relation.setOutputMarkupId(true);
relation.setOutputMarkupPlaceholderTag(true);
relation.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isCreatingNewAssignment();
}
});
relationContainer.add(relation);
}
示例9: createPasswordPanel
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private void createPasswordPanel(WebMarkupContainer staticRegistrationForm) {
// ProtectedStringType initialPassword = null;
PasswordPanel password = new PasswordPanel(ID_PASSWORD,
new PropertyModel<ProtectedStringType>(userModel, "credentials.password.value"), false, true);
password.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
password.getBaseFormComponent().setRequired(true);
staticRegistrationForm.add(password);
Label help = new Label(ID_TOOLTIP);
final StringResourceModel tooltipText = createStringResource("PageSelfRegistration.password.policy");
help.add(AttributeModifier.replace("title", tooltipText));
help.add(new InfoTooltipBehavior());
help.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return StringUtils.isNotEmpty(tooltipText.getObject());
}
});
staticRegistrationForm.add(help);
}
示例10: ContentSearchFormPanel
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
public ContentSearchFormPanel(String id, final IModel<SolrDocument> documentModel, final IModel<String> endpointModel) {
super(id);
// Create a model that returns a JSON representation of the endpoint and document id
final IModel<String> jsonModel = createJsonModel(documentModel, endpointModel);
setModel(jsonModel);
// Populate attributes in form elements...
// Outer <form> element
final WebMarkupContainer fcsForm = new WebMarkupContainer("fcsForm");
// The action of the form should be the aggregator endpoint
fcsForm.add(new AttributeModifier("action", vloConfig.getFederatedContentSearchUrl()));
add(fcsForm);
// Hidden form field for aggregation context
final WebMarkupContainer aggregationContext = new WebMarkupContainer("aggregationContent");
// The value should be the JSON object
aggregationContext.add(new AttributeModifier("value", jsonModel));
fcsForm.add(aggregationContext);
}
示例11: initLayout
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
protected void initLayout() {
WebMarkupContainer cogButton = new WebMarkupContainer(ID_COG_BUTTON);
cogButton.setOutputMarkupId(true);
add(cogButton);
WebMarkupContainer pageSize = new WebMarkupContainer(ID_PAGE_SIZE);
pageSize.setOutputMarkupId(true);
cogButton.add(pageSize);
AjaxLink tableColumns = new AjaxLink(ID_TABLE_COLUMNS) {
@Override
public void onClick(AjaxRequestTarget target) {
tableColumnsPerformed(target);
}
};
cogButton.add(tableColumns);
tableColumns.setVisible(false); //todo implement [lazyman]
initPopoverLayout();
}
示例12: onInitialize
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
add(new ListView<PropertyContext<Serializable>>("headers", elementPropertyContexts) {
@Override
protected void populateItem(ListItem<PropertyContext<Serializable>> item) {
item.add(new Label("header", EditableUtils.getName(item.getModelObject().getPropertyGetter())));
}
});
add(new ListView<Serializable>("rows", elements) {
@Override
protected void populateItem(final ListItem<Serializable> rowItem) {
rowItem.add(new ListView<PropertyContext<Serializable>>("columns", elementPropertyContexts) {
@Override
protected void populateItem(ListItem<PropertyContext<Serializable>> columnItem) {
PropertyContext<Serializable> propertyContext = columnItem.getModelObject();
Serializable elementPropertyValue = (Serializable) propertyContext.getPropertyValue(rowItem.getModelObject());
columnItem.add(propertyContext.renderForView("cell", Model.of(elementPropertyValue)));
}
});
}
});
WebMarkupContainer noElements = new WebMarkupContainer("noElements");
noElements.setVisible(elements.isEmpty());
noElements.add(AttributeModifier.append("colspan", elementPropertyContexts.size()));
add(noElements);
}
示例13: addRow
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private WebMarkupContainer addRow(final RepeatingView rows, Serializable element) {
final WebMarkupContainer row = new WebMarkupContainer(rows.newChildId());
row.setOutputMarkupId(true);
rows.add(row);
RepeatingView columns = new RepeatingView("properties");
row.add(columns);
for (PropertyContext<Serializable> propertyContext: propertyContexts) {
WebMarkupContainer column = new WebMarkupContainer(columns.newChildId());
column.add(AttributeAppender.append("class", " " + propertyContext.getPropertyName()));
columns.add(column);
Serializable propertyValue = (Serializable) propertyContext.getPropertyValue(element);
PropertyEditor<?> propertyEditor = propertyContext.renderForEdit("propertyEditor", Model.of(propertyValue));
column.add(propertyEditor);
column.add(new FencedFeedbackPanel("feedback", propertyEditor));
}
row.add(new AjaxButton("deleteElement") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
target.appendJavaScript($(row).chain("remove").get());
rows.remove(row);
if (rows.size() == 0) {
WebMarkupContainer table = (WebMarkupContainer) ConcreteListPropertyEditor.this.get("listEditor");
target.add(table.get("noElementsRow"));
}
send(ConcreteListPropertyEditor.this, Broadcast.BUBBLE, new EditorChanged(target));
}
}.setDefaultFormProcessing(false));
return row;
}
示例14: ActionTabLink
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
public ActionTabLink(String id, ActionTab tab) {
super(id);
WebMarkupContainer link = newLink("link", tab);
add(link);
link.add(new Label("label", tab.getTitleModel()));
}
示例15: onInitialize
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
WebMarkupContainer dialog = new WebMarkupContainer("dialog");
add(dialog);
dialog.add(newContent(CONTENT_ID));
if (size == Size.LARGE)
dialog.add(AttributeAppender.append("class", "modal-lg"));
else if (size == Size.SMALL)
dialog.add(AttributeAppender.append("class", "modal-sm"));
add(new AbstractPostAjaxBehavior() {
@Override
protected void respond(AjaxRequestTarget target) {
ModalPanel.this.remove();
onClosed();
}
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
response.render(JavaScriptHeaderItem.forReference(new ModalResourceReference()));
String script = String.format("gitplex.server.modal.onDomReady('%s', %s);",
getMarkupId(true), getCallbackFunction());
response.render(OnDomReadyHeaderItem.forScript(script));
}
});
setOutputMarkupId(true);
}