本文整理汇总了Java中org.apache.wicket.markup.html.link.BookmarkablePageLink.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java BookmarkablePageLink.setVisible方法的具体用法?Java BookmarkablePageLink.setVisible怎么用?Java BookmarkablePageLink.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.link.BookmarkablePageLink
的用法示例。
在下文中一共展示了BookmarkablePageLink.setVisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addMenuElement
import org.apache.wicket.markup.html.link.BookmarkablePageLink; //导入方法依赖的package包/类
protected void addMenuElement(MarkupContainer menuContainer,
Class<? extends Page> selectedPageClass,
String name,
Class<? extends Page> pageClass,
PageParameters parameters,
boolean isVisible) {
BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(name + "MenuLink", pageClass, parameters);
link.setVisible(isVisible && isPageAccessible(pageClass));
MarkupContainer container = new WebMarkupContainer(name + "MenuLinkContainer");
if (pageClass.equals(selectedPageClass)) {
container.add(new ClassAttributeAppender("active"));
}
container.add(link);
menuContainer.add(container);
}
示例2: getLocationLink
import org.apache.wicket.markup.html.link.BookmarkablePageLink; //导入方法依赖的package包/类
public static BookmarkablePageLink<Void> getLocationLink(String id, LocationDto dto) {
PageParameters parameters = getParameters(dto);
BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(id, LocationViewPage.class, parameters);
link.setEnabled(dto != null);
link.setVisible(dto != null);
return link;
}
示例3: populateItem
import org.apache.wicket.markup.html.link.BookmarkablePageLink; //导入方法依赖的package包/类
@Override
protected void populateItem(ListItem<ChampionMasteryItem> item) {
ChampionMasteryItem mastery = item.getModelObject();
ChampionStatisticItem championStatistic = null;
// create boolean to storing whether or not element should be shown
// set to false if mastery or championStatistic is null
boolean visible = true;
// check if mastery is null
if (mastery != null) {
championStatistic = PageDataProvider.getChampionStatisticById(mastery.getChampionId());
} else {
// if mastery is null create a new one and fill it with default data
mastery = new ChampionMasteryItem();
mastery.setChampionPoints(42);
mastery.setChampionLevel(1);
visible = false;
}
if (championStatistic == null) {
// if champion statistic is null use default champion for statistic
championStatistic = PageDataProvider.championStatisticMap.get("bard");
visible = false;
}
// create link to champion page
PageParameters linkParameters = new PageParameters();
linkParameters.set(0, championStatistic.getKeyName());
BookmarkablePageLink<String> link = new BookmarkablePageLink<>("champion_link",
SingleChampionPage.class, linkParameters);
item.add(link);
// add champion portrait, name and mastery score as well as champion level
link.add(new ExternalImage("champion_portrait", championStatistic.getPortraitUrl()));
link.add(new Label("champion_name", championStatistic.getChampionName()));
link.add(new Label("champion_stats", String.format("%s - Level %d", NumberFormatter.formatLong(
mastery.getChampionPoints()), mastery.getChampionLevel())));
// hide link if necessary
link.setVisible(visible);
}
示例4: createHistoryLink
import org.apache.wicket.markup.html.link.BookmarkablePageLink; //导入方法依赖的package包/类
private MarkupContainer createHistoryLink(String id, IModel<BoxItemDataMap> boxItemModel) {
BoxItemDataMap boxItem = boxItemModel.getObject();
PageParameters pageParameters = new PageParameters();
if (boxItem.getFlowInstanceId() != null) {
pageParameters.add(REQUIREMENT_ID, boxItem.getCod());
pageParameters.add(INSTANCE_ID, boxItem.getFlowInstanceId());
pageParameters.add(MODULE_PARAM_NAME, getModule().getCod());
pageParameters.add(MENU_PARAM_NAME, getMenu());
}
BookmarkablePageLink<?> historiLink = new BookmarkablePageLink<>(id, getHistoricoPage(), pageParameters);
historiLink.setVisible(boxItem.getProcessBeginDate() != null);
return historiLink;
}
示例5: initComponents
import org.apache.wicket.markup.html.link.BookmarkablePageLink; //导入方法依赖的package包/类
private void initComponents() {
Label summaryResultLabel = new Label("summaryResultLabel",new StringResourceModel("portal.design.service.summary_result.title", null));
add(summaryResultLabel);
String key = "";
logger.debug("looking for key");
if (!canCreateEnvironment) {
key = "portal.design.service.summary.read.only";
} else if (isLocked) {
key = "portal.design.service.summary.locked";
} else if (isLogicalDeploymentConsistent) {
key = "portal.design.service.summary.validated";
} else {
key = "portal.design.service.summary.errors";
}
statusLabel = new Label("archiValidatedLabel", new StringResourceModel(key, null));
add(statusLabel);
PageParameters newEnvPageParameters = new PageParameters(params);
newEnvPageParameters.set("new", "1");
BookmarkablePageLink<Page> newEnv = new BookmarkablePageLink<Page>("newEnvLink", SelectedReleasePage.class, newEnvPageParameters);
newEnv.setVisible(isLogicalDeploymentConsistent && canCreateEnvironment);
add(newEnv);
}