本文整理汇总了Java中org.apache.wicket.markup.html.WebMarkupContainer.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java WebMarkupContainer.setVisible方法的具体用法?Java WebMarkupContainer.setVisible怎么用?Java WebMarkupContainer.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.WebMarkupContainer
的用法示例。
在下文中一共展示了WebMarkupContainer.setVisible方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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());
}
示例3: 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);
}
示例4: newChangedContainer
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private void newChangedContainer(@Nullable AjaxRequestTarget target) {
WebMarkupContainer changedContainer = new WebMarkupContainer("changed");
changedContainer.setVisible(change != null);
changedContainer.setOutputMarkupPlaceholderTag(true);
if (change != null) {
changedContainer.add(new BlobDiffPanel("changes", new AbstractReadOnlyModel<Project>() {
@Override
public Project getObject() {
return context.getProject();
}
}, new Model<PullRequest>(null), change, DiffViewMode.UNIFIED, null, null));
} else {
changedContainer.add(new WebMarkupContainer("changes"));
}
if (target != null) {
replace(changedContainer);
target.add(changedContainer);
if (change != null) {
String script = String.format("$('#%s .commit-option input[type=submit]').val('Commit and overwrite');",
getMarkupId());
target.appendJavaScript(script);
}
} else {
add(changedContainer);
}
}
示例5: createNavigation
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private Component createNavigation(final String id) {
if (navigationModel != null) {
final IModel<String> tabModel = new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return TABS_ORDER.get(tabs.getSelectedTab());
}
};
// Add a panel that shows the index of the current record in the
// resultset and allows for forward/backward navigation
return new RecordNavigationPanel(id, navigationModel, tabModel) {
@Override
protected void onConfigure() {
final SearchContext context = navigationModel.getObject();
setVisible(context != null && context.getResultCount() > 1);
}
};
} else {
// If no context model is available (i.e. when coming from a bookmark
// or external link, do not show the navigation panel
final WebMarkupContainer navigationDummy = new WebMarkupContainer(id);
navigationDummy.setVisible(false);
return navigationDummy;
}
}
示例6: createDropDownLink
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
protected Component createDropDownLink(String id) {
//link that activates dropdown
final Link<Boolean> link = new Link<Boolean>(id, openStateModel) {
@Override
public void onClick() {
getModel().setObject(!getModelObject());
}
};
final Serializable buttonClass = getButtonClass();
if (buttonClass != null) {
link.add(new AttributeAppender("class", buttonClass, " "));
}
//optional icon
final WebMarkupContainer icon = new WebMarkupContainer("buttonIcon");
final Serializable iconClass = getButtonIconClass();
if (iconClass != null) {
icon.add(new AttributeModifier("class", iconClass));
}
link.add(icon);
//caret
final WebMarkupContainer caret = new WebMarkupContainer("caret");
caret.setVisible(showCaret());
link.add(caret);
return link;
}
示例7: buildContent
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
protected void buildContent() {
queue(new Label("nome", $m.ofValue(SingularSession.get().getName())));
WebMarkupContainer avatar = new WebMarkupContainer("codrh");
Optional<String> avatarSrc = Optional.ofNullable(null);
avatarSrc.ifPresent(src -> avatar.add($b.attr("src", src)));
queue(avatar);
avatar.setVisible(avatarSrc.isPresent());
SecurityAuthPathsFactory securityAuthPathsFactory = new SecurityAuthPathsFactory();
SecurityAuthPaths securityAuthPaths = securityAuthPathsFactory.get();
Link logout = new Link("logout") {
@Override
public void onClick() {
throw new RedirectToUrlException(securityAuthPaths.getLogoutPath(RequestCycle.get()));
}
};
queue(logout);
// final WebMarkupContainer opcoesVisuais = new WebMarkupContainer("opcoes-visuais");
// opcoesVisuais.setRenderBodyOnly(true);
// opcoesVisuais.setVisible(option.options().size() > 1);
// opcoesVisuais.queue(buildSkinOptions());
// queue(opcoesVisuais);
}
示例8: newEditOptions
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
protected WebMarkupContainer newEditOptions(String componentId) {
WebMarkupContainer options = new WebMarkupContainer(componentId);
options.setVisible(false);
return options;
}
示例9: newOptions
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
protected WebMarkupContainer newOptions(String id) {
WebMarkupContainer options = new WebMarkupContainer(id);
options.setVisible(false);
return options;
}
示例10: createHeader
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
protected WebMarkupContainer createHeader(String headerId) {
WebMarkupContainer header = new WebMarkupContainer(headerId);
header.setVisible(false);
return header;
}
示例11: initLayout
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的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);
}
示例12: initLayout
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的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);
}
示例13: initLayout
import org.apache.wicket.markup.html.WebMarkupContainer; //导入方法依赖的package包/类
private void initLayout(final boolean oldPasswordVisible) {
model = (LoadableModel<MyPasswordsDto>) getModel();
Label oldPasswordLabel = new Label(ID_OLD_PASSWORD_LABEL, createStringResource("PageSelfCredentials.oldPasswordLabel"));
add(oldPasswordLabel);
oldPasswordLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return oldPasswordVisible;
}
});
Label passwordLabel = new Label(ID_PASSWORD_LABEL, createStringResource("PageSelfCredentials.passwordLabel1"));
add(passwordLabel);
PasswordTextField oldPasswordField =
new PasswordTextField(ID_OLD_PASSWORD_FIELD, new PropertyModel<String>(model, MyPasswordsDto.F_OLD_PASSWORD));
oldPasswordField.setRequired(false);
oldPasswordField.setResetPassword(false);
add(oldPasswordField);
oldPasswordField.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
public boolean isVisible() {
return oldPasswordVisible;
};
});
PasswordPanel passwordPanel = new PasswordPanel(ID_PASSWORD_PANEL, new PropertyModel<ProtectedStringType>(model, MyPasswordsDto.F_PASSWORD));
passwordPanel.getBaseFormComponent().add(new AttributeModifier("autofocus", ""));
add(passwordPanel);
WebMarkupContainer accountContainer = new WebMarkupContainer(ID_ACCOUNTS_CONTAINER);
List<IColumn<PasswordAccountDto, String>> columns = initColumns();
ListDataProvider<PasswordAccountDto> provider = new ListDataProvider<PasswordAccountDto>(this,
new PropertyModel<List<PasswordAccountDto>>(model, MyPasswordsDto.F_ACCOUNTS));
TablePanel accounts = new TablePanel(ID_ACCOUNTS_TABLE, provider, columns);
accounts.setItemsPerPage(30);
accounts.setShowPaging(false);
if (model.getObject().getPropagation() != null && model.getObject().getPropagation()
.equals(CredentialsPropagationUserControlType.MAPPING)){
accountContainer.setVisible(false);
}
accountContainer.add(accounts);
AjaxLink help = new AjaxLink(ID_BUTTON_HELP) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
showHelpPerformed(target);
}
};
accountContainer.add(help);
add(accountContainer);
}