List of usage examples for org.apache.wicket.markup.html.list LoopItem LoopItem
public LoopItem(final int index)
From source file:au.org.theark.core.web.component.tabbedPanel.DynamicTabbedPanel.java
License:Open Source License
protected LoopItem newTabContainer(final int tabIndex) { return new LoopItem(tabIndex) { private static final long serialVersionUID = 1L; @Override//w ww . j a v a 2 s . c o m protected void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); String cssClass = (String) tag.getAttribute("class"); if (cssClass == null) { cssClass = " "; } cssClass += " tab" + getIndex(); if (getIndex() == getSelectedTab()) { cssClass += " selected"; } if (getIndex() == getTabs().size() - 1) { cssClass += " last"; } tag.put("class", cssClass.trim()); } @Override public boolean isVisible() { return getTabs().get(tabIndex).isVisible(); } }; }
From source file:com.evolveum.midpoint.web.component.TabbedPanel.java
License:Apache License
/** * Generates a loop item used to represent a specific tab's <code>li</code> element. * * @param tabIndex/*from w w w. ja v a 2s. com*/ * @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()); } }; }
From source file:com.userweave.pages.components.slidableajaxtabpanel.SlidableTabbedPanel.java
License:Open Source License
@Override protected LoopItem newTabContainer(final int tabIndex) { return new LoopItem(tabIndex) { private static final long serialVersionUID = 1L; @Override// ww w. java2 s . c om protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String cssClass = tag.getAttribute("class"); if (cssClass == null) { cssClass = " "; } int index = getIndex(); cssClass += " tab" + index; if (index == getSelectedTab()) { cssClass += " selected"; } if (index == getTabs().size() - 1) { cssClass += " last"; } tag.put("class", cssClass.trim()); if (whichTabbedPanel.equals(STUDY_TABBED_PANEL)) { tag.put("style", "z-index:" + (getTabs().size() - tabIndex) + ";left:-" + (tabIndex * 9) + "px;"); } } }; }
From source file:com.userweave.pages.components.slidableajaxtabpanel.StudiesSlidableAjaxTabbedPanel.java
License:Open Source License
@Override protected LoopItem newTabContainer(final int tabIndex) { return new LoopItem(tabIndex) { private static final long serialVersionUID = 1L; @Override// w w w.j a va2 s .c om protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String cssClass = tag.getAttribute("class"); if (cssClass == null) { cssClass = " "; } cssClass += " tab" + getIndex(); if (getIndex() == getSelectedTab() && isTabPanelActive) { cssClass += " selected"; } if (getIndex() == getTabs().size() - 1) { cssClass += " last"; } tag.put("class", cssClass.trim()); if (whichTabbedPanel.equals(STUDY_TABBED_PANEL)) { tag.put("style", "z-index:" + (getTabs().size() - tabIndex) + ";left:-" + (tabIndex * 9) + "px;"); } } }; }
From source file:de.alpharogroup.wicket.components.ajax.editable.tabs.AjaxAddableTabbedPanel.java
License:Apache License
/** * Generates a loop item used to represent a specific tab's <code>li</code> element. * * @param tabIndex//from w ww . ja v a 2s. c om * the tab index * @return new loop item */ protected LoopItem newTabContainer(final int tabIndex) { return new LoopItem(tabIndex) { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; /** * {@inheritDoc} */ @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()); } /** * {@inheritDoc} */ @Override protected void onConfigure() { super.onConfigure(); setVisible(getVisiblityCache().isVisible(tabIndex)); } }; }
From source file:org.hippoecm.frontend.plugins.standards.tabs.TabbedPanel.java
License:Apache License
protected LoopItem newTabContainer(final int tabIndex) { return new LoopItem(tabIndex) { private static final long serialVersionUID = 1L; @Override// ww w . j a va 2s .c om protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String cssClass = tag.getAttribute("class"); if (cssClass == null) { cssClass = " "; } cssClass += " tab" + getIndex(); if (getIndex() == getSelectedTab()) { cssClass += " selected"; } if (getIndex() == getTabs().size() - 1) { cssClass += " last"; } tag.put("class", cssClass.trim()); } }; }