本文整理匯總了Java中org.apache.wicket.markup.html.WebMarkupContainer類的典型用法代碼示例。如果您正苦於以下問題:Java WebMarkupContainer類的具體用法?Java WebMarkupContainer怎麽用?Java WebMarkupContainer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WebMarkupContainer類屬於org.apache.wicket.markup.html包,在下文中一共展示了WebMarkupContainer類的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: getPropertyEditorsAtRow
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private List<PropertyEditor<Serializable>> getPropertyEditorsAtRow(int index) {
WebMarkupContainer table = (WebMarkupContainer) get("listEditor");
RepeatingView rows = (RepeatingView) table.get("elements");
int currentIndex = 0;
Iterator<Component> it = rows.iterator();
Component row = it.next();
while (currentIndex++ < index) {
row = it.next();
}
List<PropertyEditor<Serializable>> propertyEditors = new ArrayList<>();
RepeatingView columns = (RepeatingView) row.get("properties");
for (Component column: columns) {
propertyEditors.add((PropertyEditor<Serializable>) column.get("propertyEditor"));
}
return propertyEditors;
}
示例4: onInitialize
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
add(new UserLink("author", author));
if (committer.getEmailAddress().equals(author.getEmailAddress())
&& committer.getName().equals(author.getName())) {
add(new WebMarkupContainer("committer").setVisible(false));
} else {
add(new UserLink("committer", committer));
}
if (withDate)
add(new Label("date", DateUtils.formatAge(committer.getWhen())));
else
add(new WebMarkupContainer("date").setVisible(false));
}
示例5: render
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
@Override
public Component render(String componentId) {
return new ActionTabLink(componentId, this) {
@Override
protected WebMarkupContainer newLink(String id, ActionTab tab) {
return new AjaxLink<Void>("link") {
@Override
public void onClick(AjaxRequestTarget target) {
selectTab(this);
}
};
}
};
}
示例6: 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;
}
示例7: 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;
}
示例8: newOptions
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
@Override
protected WebMarkupContainer newOptions(String id) {
sourceFormat = new SourceFormatPanel(id, null, new OptionChangeCallback() {
@Override
public void onOptioneChange(AjaxRequestTarget target) {
String script = String.format("gitplex.server.sourceView.onTabSizeChange(%s);", sourceFormat.getTabSize());
target.appendJavaScript(script);
}
}, new OptionChangeCallback() {
@Override
public void onOptioneChange(AjaxRequestTarget target) {
String script = String.format("gitplex.server.sourceView.onLineWrapModeChange('%s');", sourceFormat.getLineWrapMode());
target.appendJavaScript(script);
}
});
return sourceFormat;
}
示例9: 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;
}
示例10: onInitialize
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
add(new ResourceLink<Void>("download", new ServerLogResourceReference()));
List<String> lines = ServerLogResource.readServerLog();
String content;
if (lines.size() > MAX_DISPLAY_LINES) {
add(new Label("warning", "Too many log entries, displaying recent " + MAX_DISPLAY_LINES));
content = Joiner.on("\n").join(lines.subList(lines.size()-MAX_DISPLAY_LINES, lines.size()));
} else {
add(new WebMarkupContainer("warning").setVisible(false));
content = Joiner.on("\n").join(lines);
}
add(new Label("logContent", content));
}
示例11: onInitialize
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
add(new Label("title", initStage.getMessage()));
if (!initStage.getManualConfigs().isEmpty()) {
List<ManualConfigStep> configSteps = new ArrayList<ManualConfigStep>();
for (ManualConfig each: initStage.getManualConfigs())
configSteps.add(new ManualConfigStep(each));
add(new Wizard("wizard", configSteps) {
@Override
protected void finished() {
WebSession.get().logout();
User root = GitPlex.getInstance(UserManager.class).getRoot();
SecurityUtils.getSubject().runAs(root.getPrincipals());
throw new RestartResponseException(DashboardPage.class);
}
});
} else {
add(new WebMarkupContainer("wizard").setVisible(false));
}
}
示例12: populateNode
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
private void populateNode() throws ExternalServiceException, IOException, RemoteException {
ListView<NodeDto> list = new ListView<NodeDto>("nodeList", this.model) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<NodeDto> item) {
NodeDto node = item.getModelObject();
BookmarkablePageLink<Void> link = NodePageUtil.createNodeLink("nodeLink", node);
item.add(link);
}
};
add(list);
WebMarkupContainer container = new WebMarkupContainer("nodeBlock");
add(container);
container.setVisible(this.model.isVisible());
}
示例13: RichHyperlinkConfigDialog
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
public RichHyperlinkConfigDialog(String id, final RichHyperlinkType link, boolean isMenuItem, String titleKey){
super(id);
this.isMenuItem = isMenuItem;
model = new LoadableModel<RichHyperlinkType>(false) {
@Override
protected RichHyperlinkType load() {
return loadModel(link);
}
};
setOutputMarkupId(true);
setTitle(createStringResource(titleKey));
showUnloadConfirmation(false);
setCssClassName(ModalWindow.CSS_CLASS_GRAY);
setCookieName(RichHyperlinkConfigDialog.class.getSimpleName() + ((int) (Math.random() * 100)));
setInitialWidth(625);
setInitialHeight(400);
setWidthUnit("px");
WebMarkupContainer content = new WebMarkupContainer(getContentId());
content.setOutputMarkupId(true);
setContent(content);
}
示例14: addOrReplaceTable
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
private void addOrReplaceTable(RepositoryObjectDataProvider provider) {
Form mainForm = (Form) get(ID_MAIN_FORM);
BoxedTablePanel table = new BoxedTablePanel(ID_TABLE, provider, initColumns(provider.getType()),
UserProfileStorage.TableId.CONF_DEBUG_LIST_PANEL,
(int) getItemsPerPage(UserProfileStorage.TableId.CONF_DEBUG_LIST_PANEL)) {
@Override
protected WebMarkupContainer createHeader(String headerId) {
return new SearchFragment(headerId, ID_TABLE_HEADER, PageDebugList.this, searchModel,
resourcesModel);
}
};
table.setOutputMarkupId(true);
ConfigurationStorage storage = getSessionStorage().getConfiguration();
table.setCurrentPage(storage.getPaging());
mainForm.addOrReplace(table);
}
示例15: initLayout
import org.apache.wicket.markup.html.WebMarkupContainer; //導入依賴的package包/類
public void initLayout(final String messageKey){
WebMarkupContainer content = new WebMarkupContainer(ID_CONTENT);
add(content);
Label helpLabel = new Label(ID_HELP, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(messageKey);
}
});
helpLabel.setEscapeModelStrings(false);
content.add(helpLabel);
AjaxLink ok = new AjaxLink(ID_BUTTON_OK) {
@Override
public void onClick(AjaxRequestTarget target) {
closePerformed(target);
}
};
content.add(ok);
}