當前位置: 首頁>>代碼示例>>Java>>正文


Java ListItem.getIndex方法代碼示例

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

    }
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:21,代碼來源:DesignerSteppedProcessPanel.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:16,代碼來源:MultiValueDropDownPanel.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:13,代碼來源:GenericMultiValueLabelEditPanel.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:12,代碼來源:MultiValueTextFormGroup.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:12,代碼來源:MultiValueTextPanel.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:12,代碼來源:ObjectPolicyConfigurationEditor.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:12,代碼來源:ObjectPolicyPanel.java

示例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);
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:54,代碼來源:AddonsInfoPanel.java


注:本文中的org.apache.wicket.markup.html.list.ListItem.getIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。