当前位置: 首页>>代码示例>>Java>>正文


Java LoopItem.add方法代码示例

本文整理汇总了Java中org.apache.wicket.markup.html.list.LoopItem.add方法的典型用法代码示例。如果您正苦于以下问题:Java LoopItem.add方法的具体用法?Java LoopItem.add怎么用?Java LoopItem.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.markup.html.list.LoopItem的用法示例。


在下文中一共展示了LoopItem.add方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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"));
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:9,代码来源:BootstrapPagingNavigation.java

示例2: 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;
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:15,代码来源:ModelTabbedPanel.java

示例3: 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);		
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:37,代码来源:WidgetTabs.java

示例4: 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);
	}
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:33,代码来源:DashboardPanel.java

示例5: 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" : "")));
}
 
开发者ID:flex-oss,项目名称:flex-ui,代码行数:10,代码来源:FlexPagingNavigation.java

示例6: 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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:47,代码来源:NavigatorPanel.java

示例7: onNewTabItem

import org.apache.wicket.markup.html.list.LoopItem; //导入方法依赖的package包/类
@Override
public void onNewTabItem(LoopItem item) {
    super.onNewTabItem(item);
    item.add(new DisabledAddonBehavior(addon));
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:6,代码来源:DisabledAddonTab.java

示例8: 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));
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:6,代码来源:WicketAddonsImpl.java

示例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 showPageListing;
        }
    });
    add(navigation);
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:47,代码来源:NavigatorPanel.java

示例10: 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);
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:53,代码来源:SummaryPanel.java


注:本文中的org.apache.wicket.markup.html.list.LoopItem.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。