本文整理汇总了Java中org.apache.wicket.markup.html.list.LoopItem类的典型用法代码示例。如果您正苦于以下问题:Java LoopItem类的具体用法?Java LoopItem怎么用?Java LoopItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoopItem类属于org.apache.wicket.markup.html.list包,在下文中一共展示了LoopItem类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newTabContainer
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
/**
* Generates a loop item used to represent a specific tab's <code>li</code> element.
*
* @param tabIndex
* @return new loop item
*/
protected LoopItem newTabContainer(final int tabIndex) {
return new LoopItem(tabIndex) {
private static final long serialVersionUID = 1L;
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(getVisiblityCache().isVisible(tabIndex));
}
@Override
protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
String cssClass = tag.getAttribute("class");
if (cssClass == null) {
cssClass = " ";
}
cssClass += " tab" + getIndex();
if (getIndex() == getSelectedTab()) {
cssClass += ' ' + getSelectedTabCssClass();
}
if (getVisiblityCache().getLastVisible() == getIndex()) {
cssClass += ' ' + getLastTabCssClass();
}
tag.put("class", cssClass.trim());
}
};
}
示例2: populateItem
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
@Override
protected void populateItem(LoopItem loopItem) {
super.populateItem(loopItem);
long pageIndex = getStartIndex() + loopItem.getIndex();
if (pageable.getCurrentPage() == pageIndex) {
loopItem.add(new ClassAttributeAppender("active"));
}
}
示例3: newTabContainer
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
@Override
protected LoopItem newTabContainer(final int tabIndex) {
final LoopItem item = super.newTabContainer(tabIndex);
item.add(new Behavior() {
@Override
public void onComponentTag(final Component component, final ComponentTag tag) {
super.onComponentTag(component, tag);
if (!isSuperEnabled() || !isTabEnabled(tabIndex)) {
tag.put("class", tag.getAttribute("class") + " disabled");
}
}
});
return item;
}
示例4: newTabContainer
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
@Override
protected LoopItem newTabContainer(int tabIndex) {
LoopItem item = super.newTabContainer(tabIndex);
Object tab = getTabs().get(tabIndex);
if (tab instanceof BaseTab) {
BaseTab baseTab = (BaseTab) tab;
baseTab.onNewTabItem(item);
}
return item;
}
示例5: WidgetTabs
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
public WidgetTabs(String id, List<AbstractTab> tabs, int selectedTab) {
super(id, new Model(Integer.valueOf(-1)));
setOutputMarkupId(true);
setVersioned(false);
this.setTabs(tabs);
if(this.tabs == null) {
this.tabs = new ArrayList<AbstractTab>();
}
// tabs
Loop tabLoop = new Loop("tabs", tabs.size()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(LoopItem item) {
int index = item.getIndex();
AbstractTab tab = ((AbstractTab) WidgetTabs.this.tabs.get(index));
int selected = getSelectedTab();
if(index == selected) {
item.add(new AttributeModifier("class", new Model("tabsel")));
}
final WebMarkupContainer titleLink = newLink("link", index);
titleLink.add(new Label("title", tab.getTitle()));
item.add(titleLink);
}
};
add(tabLoop);
// add ajax behavior
loadSelectedTabBehavior = new LoadSelectedTabBehavior();
add(loadSelectedTabBehavior);
// select initial tab
setSelectedTab(selectedTab, false);
}
示例6: addColumnsPanel
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
private void addColumnsPanel() {
if (getDashboard() != null) {
final int columnCount = getDashboard().getColumnCount();
Loop columnsView = new Loop("columns", columnCount) {
private static final long serialVersionUID = 1L;
@Override
protected void onBeforeRender() {
if (!hasBeenRendered()) {
columnPanels = new ArrayList<>();
}
super.onBeforeRender();
}
@Override
protected void populateItem(LoopItem item) {
float columnPanelWidth = 100f / columnCount;
DashboardColumnPanel columnPanel = new DashboardColumnPanel("column", getModel(), item.getIndex());
columnPanel.setRenderBodyOnly(true);
columnPanel.getColumnContainer().add(AttributeModifier.replace("style", "width: " + columnPanelWidth + "%;"));
item.add(columnPanel);
columnPanels.add(columnPanel);
}
};
add(columnsView);
}
}
示例7: newTabContainer
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
@Override
/**
* Setzt das class-Attribut auf 'active', wenn dieses Tab das selektierte ist.
*/
protected LoopItem newTabContainer(final int tabIndex) {
return new LoopItem(tabIndex) {
private static final long serialVersionUID = 1L;
@Override
protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
String cssClass = tag.getAttribute("class");
if (cssClass == null) {
cssClass = " ";
}
if (getIndex() == getSelectedTab()) {
cssClass += " active";
}
tag.put("class", cssClass.trim());
}
@Override
public boolean isVisible() {
return getTabs().get(tabIndex).isVisible();
}
};
}
示例8: populateItem
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
@Override
protected void populateItem(LoopItem loopItem) {
super.populateItem(loopItem);
// Get the index of page this link shall point to
final long pageIndex = getStartIndex() + loopItem.getIndex();
loopItem.add(new CssClassNameAppender(new ReadOnlyModel<>(() -> (pageIndex == pageable.getCurrentPage())
? "active" : "")));
}
示例9: initNavigation
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
private void initNavigation() {
IModel<Integer> model = new AbstractReadOnlyModel<Integer>() {
@Override
public Integer getObject() {
int count = (int) pageable.getPageCount();
if (count < PAGING_SIZE) {
return count;
}
return PAGING_SIZE;
}
};
Loop navigation = new Loop(ID_NAVIGATION, model) {
@Override
protected void populateItem(final LoopItem item) {
final NavigatorPageLink pageLink = new NavigatorPageLink(ID_PAGE_LINK,
computePageNumber(item.getIndex())) {
@Override
public void onClick(AjaxRequestTarget target) {
pageLinkPerformed(target, getPageNumber());
}
};
item.add(pageLink);
item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return pageable.getCurrentPage() == pageLink.getPageNumber() ? "active" : "";
}
}));
}
};
navigation.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return BooleanUtils.isTrue(showPageListingModel.getObject());
}
});
add(navigation);
}
示例10: onNewTabItem
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
@Override
public void onNewTabItem(LoopItem item) {
super.onNewTabItem(item);
item.add(new DisabledAddonBehavior(addon));
}
示例11: onNewTabItem
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
@Override
public void onNewTabItem(LoopItem item) {
super.onNewTabItem(item);
item.add(new AddonNeededBehavior(AddonType.BUILD));
}
示例12: onNewTabItem
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
public void onNewTabItem(LoopItem item) {
}
示例13: initNavigation
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
private void initNavigation() {
IModel<Integer> model = new AbstractReadOnlyModel<Integer>() {
@Override
public Integer getObject() {
int count = (int) pageable.getPageCount();
if (count < PAGING_SIZE) {
return count;
}
return PAGING_SIZE;
}
};
Loop navigation = new Loop(ID_NAVIGATION, model) {
@Override
protected void populateItem(final LoopItem item) {
final NavigatorPageLink pageLink = new NavigatorPageLink(ID_PAGE_LINK,
computePageNumber(item.getIndex())) {
@Override
public void onClick(AjaxRequestTarget target) {
pageLinkPerformed(target, getPageNumber());
}
};
item.add(pageLink);
item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return pageable.getCurrentPage() == pageLink.getPageNumber() ? "active" : "";
}
}));
}
};
navigation.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return showPageListing;
}
});
add(navigation);
}
示例14: initPanelLayout
import org.apache.wicket.markup.html.list.LoopItem; //导入依赖的package包/类
private void initPanelLayout() {
Loop monthRepeater = new Loop(ID_MONTH_REPEATER,
new PropertyModel<Integer>(getModel(), SummaryPanelDto.F_MONTH_COUNT)) {
@Override
protected void populateItem(final LoopItem item) {
Loop dayRepeater = new Loop(ID_DAY_REPEATER, TABLE_DAY_SIZE) {
@Override
protected void populateItem(final LoopItem dayItem) {
final int dayIndex = dayItem.getIndex() - 1;
Label label = new Label(ID_LABEL, createDayModel(item.getIndex(), dayIndex));
label.setRenderBodyOnly(true);
dayItem.add(label);
final SummaryPanelDto dto = getModelObject();
dayItem.add(new CssClassNameModifier(new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
// month year column
if (dayIndex == -1) {
return null;
}
if (dto.isToday(item.getIndex(), dayIndex)) {
return "info";
}
if (!dto.isWithinFilter(item.getIndex(), dayIndex)) {
return "active";
}
if (dto.isWeekend(item.getIndex(), dayIndex)) {
return "success";
}
if (!dto.isFullDayDone(item.getIndex(), dayIndex)) {
return "text-danger";
}
return null;
}
}));
}
};
item.add(dayRepeater);
}
};
add(monthRepeater);
}