本文整理汇总了Java中org.apache.wicket.markup.html.list.ListItem.getIndex方法的典型用法代码示例。如果您正苦于以下问题:Java ListItem.getIndex方法的具体用法?Java ListItem.getIndex怎么用?Java ListItem.getIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.list.ListItem
的用法示例。
在下文中一共展示了ListItem.getIndex方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateProcessStep
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
public void updateProcessStep(ListItem<String> listItem, int step) {
/* CSS Management */
if(listItem.getIndex() < currentStep) {
listItem.add(new AttributeAppender("class", new Model<>("step_visited"), ""));
} else if(listItem.getIndex() == currentStep) {
listItem.add(new AttributeAppender("class", new Model<>("step_current"), ""));
} else if(listItem.getIndex() > currentStep) {
listItem.add(new AttributeAppender("class", new Model<>("step_future"), ""));
}
if(listItem.getIndex() == 0) {
listItem.add(new AttributeAppender("class", new Model<>(" first"), ""));
}
if(listItem.getIndex() == stepsNumber - 1) {
listItem.add(new AttributeAppender("class", new Model<>(" last"), ""));
}
}
示例2: getPlusClassModifier
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
protected String getPlusClassModifier(ListItem<T> item){
if(buttonsDisabled()){
return CSS_DISABLED;
}
int size = getModelObject().size();
if (size <= 1) {
return "";
}
if (item.getIndex() == size - 1) {
return "";
}
return CSS_DISABLED;
}
示例3: isAddButtonVisible
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
protected boolean isAddButtonVisible(ListItem<T> item) {
if (isMultiple) {
int size = getModelObject().size();
if (size <= 1) {
return true;
}
if (item.getIndex() == size - 1) {
return true;
}
}
return false;
}
示例4: isAddButtonVisible
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
protected boolean isAddButtonVisible(ListItem<T> item) {
int size = getModelObject().size();
if (size <= 1) {
return true;
}
if (item.getIndex() == size - 1) {
return true;
}
return false;
}
示例5: getPlusClassModifier
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
protected String getPlusClassModifier(ListItem<T> item){
int size = getModelObject().size();
if (size <= 1) {
return "";
}
if (item.getIndex() == size - 1) {
return "";
}
return CSS_DISABLED;
}
示例6: isAddButtonVisible
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
protected boolean isAddButtonVisible(ListItem<ObjectPolicyConfigurationTypeDto> item) {
int size = getModelObject().size();
if (size <= 1) {
return true;
}
if (item.getIndex() == size - 1) {
return true;
}
return false;
}
示例7: isAddButtonVisible
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
protected boolean isAddButtonVisible(ListItem item) {
int size = model.getObject().getPropertyConstraintsList().size();
if (size <= 1) {
return true;
}
if (item.getIndex() == size - 1) {
return true;
}
return false;
}
示例8: AddonsInfoPanel
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
/**
* Main constructor
*
* @param id ID to assign to panel
* @param installedAddons Name list of installed addons
* @param noEnabledAddons True if no addons are enabled
*/
public AddonsInfoPanel(String id, List<AddonInfo> installedAddons, boolean noEnabledAddons) {
super(id);
add(new CssClass("addons-table"));
final boolean currentLicenseValid = addonsManager.isLicenseInstalled();
MarkupContainer addonTable = new WebMarkupContainer("addonTable");
boolean noAddons = installedAddons.isEmpty();
boolean admin = authorizationService.isAdmin();
addonTable.setVisible(!noAddons);
addonTable.setOutputMarkupId(true);
Component listView = new ListView<AddonInfo>("addonItem", installedAddons) {
@Override
protected void populateItem(ListItem<AddonInfo> item) {
AddonInfo addonInfo = item.getModelObject();
item.add(new ExternalLink("name", getAddonUrl(addonInfo.getAddonName()),
addonInfo.getAddonDisplayName()));
item.add(new Label("image", "").add(new CssClass("addon-" + addonInfo.getAddonName())));
String stateString = getAddonStatus(addonInfo.getAddonState());
item.add(new Label("status", stateString));
if (item.getIndex() % 2 == 0) {
item.add(new CssClass("even"));
}
}
};
addonTable.add(listView);
add(addonTable);
add(new Label("addonsDisabled", "No addons available")
.setVisible(currentLicenseValid && !noAddons && noEnabledAddons));
add(new Label("noAddons", "No add-ons currently installed.").setVisible(noAddons));
String licenseRequiredMessage = addonsWebManager.getLicenseRequiredMessage(
WicketUtils.absoluteMountPathForPage(LicensePage.class));
Label noLicenseKeyLabel = new Label("noLicenseKey", licenseRequiredMessage);
noLicenseKeyLabel.setVisible(
admin && !currentLicenseValid && !noAddons && noEnabledAddons);
noLicenseKeyLabel.setEscapeModelStrings(false);
add(noLicenseKeyLabel);
}