本文整理匯總了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);
}