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


Java DefaultSelectableValueHolderCollection类代码示例

本文整理汇总了Java中framework.utils.DefaultSelectableValueHolderCollection的典型用法代码示例。如果您正苦于以下问题:Java DefaultSelectableValueHolderCollection类的具体用法?Java DefaultSelectableValueHolderCollection怎么用?Java DefaultSelectableValueHolderCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getLCMilestoneAsVHByLCProcess

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get all life cycle milestones of a process as value holder collection.
 * 
 * @param lifeCycleProcessId
 *            the life cycle process id
 */
public static ISelectableValueHolderCollection<Long> getLCMilestoneAsVHByLCProcess(Long lifeCycleProcessId) {

    DefaultSelectableValueHolderCollection<Long> valueHolderCollection = new DefaultSelectableValueHolderCollection<>();
    List<LifeCycleMilestone> list = findLifeCycleMilestone.where().eq("deleted", false).eq("lifeCycleProcess.id", lifeCycleProcessId).findList();
    for (LifeCycleMilestone lifeCycleMilestone : list) {
        String name = lifeCycleMilestone.getShortName();
        if (lifeCycleMilestone.getName() != null && !lifeCycleMilestone.getName().equals("")) {
            name += " (" + lifeCycleMilestone.getName() + ")";
        }
        valueHolderCollection.add(new DefaultSelectableValueHolder<>(lifeCycleMilestone.id, name));

    }
    return valueHolderCollection;

}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:22,代码来源:LifeCycleMilestoneDao.java

示例2: getPEDependencyTypeActiveWithContraryAsVH

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get all active portfolio entry dependency types, including the contrary,
 * as value holder collection.
 */
public static ISelectableValueHolderCollection<String> getPEDependencyTypeActiveWithContraryAsVH() {
    ISelectableValueHolderCollection<String> types = new DefaultSelectableValueHolderCollection<String>();
    int i = 0;
    for (PortfolioEntryDependencyType type : getPEDependencyTypeActiveAsList()) {

        DefaultSelectableValueHolder<String> vh1 = new DefaultSelectableValueHolder<String>(type.id + "#false", Msg.get(type.getNameKey()));
        vh1.setOrder(i);
        i++;
        types.add(vh1);

        DefaultSelectableValueHolder<String> vh2 = new DefaultSelectableValueHolder<String>(type.id + "#true", Msg.get(type.contrary));
        vh2.setOrder(i);
        i++;
        types.add(vh2);

    }
    return types;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:23,代码来源:PortfolioEntryDao.java

示例3: editPortfolios

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Form to edit the selected portfolios of a portfolio entry.
 * 
 * @param id
 *            the portfolio entry id
 */
@With(CheckPortfolioEntryExists.class)
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_EDIT_DYNAMIC_PERMISSION)
public Result editPortfolios(Long id) {

    // get the portfolioEntry
    PortfolioEntry portfolioEntry = PortfolioEntryDao.getPEById(id);

    // construct the form
    Form<PortfolioEntryPortfoliosFormData> portfolioEntryPortfoliosForm = portfoliosFormTemplate
            .fill(new PortfolioEntryPortfoliosFormData(portfolioEntry));

    // get the portfolios value holders
    DefaultSelectableValueHolderCollection<Long> portfolios = PortfolioDao.getPortfolioActiveAsVH();

    return ok(views.html.core.portfolioentry.portfolios_edit.render(portfolioEntry, portfolios, portfolioEntryPortfoliosForm));
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:23,代码来源:PortfolioEntryController.java

示例4: getUserAccountsFromNameAsVH

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
@Override
public ISelectableValueHolderCollection<String> getUserAccountsFromNameAsVH(String searchString) {
    ISelectableValueHolderCollection<String> selectableValues = new DefaultSelectableValueHolderCollection<>();
    try {
        getUserAccountsFromName(searchString)
                .stream()
                .filter(IUserAuthenticationAccount::isActive)
                .forEach(userAccount -> selectableValues.add(new DefaultSelectableValueHolder<>(
                    userAccount.getUid(),
                    String.format("%s %s", userAccount.getFirstName(), userAccount.getLastName())
                )));
    } catch (AccountManagementException e) {
        log.error("Unable to get a list of users using the specified searchString", e);
    }
    return selectableValues;
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:17,代码来源:AccountManagerPluginImpl.java

示例5: getFilterConfig

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get the filter config.
 */
public FilterConfig<TimesheetLogListView> getFilterConfig() {
    return new FilterConfig<TimesheetLogListView>() {
        {

            addColumnConfiguration("actor", "timesheetEntry.timesheetReport.actor.id", "object.timesheet_report.actor.label",
                    new AutocompleteFilterComponent(controllers.routes.JsonController.manager().url()), true, false, SortStatusType.NONE);

            ISelectableValueHolderCollection<Long> orgUnits = OrgUnitDao.getOrgUnitActiveAsVH();
            if (orgUnits != null && orgUnits.getValues().size() > 0) {
                addColumnConfiguration("orgUnit", "timesheetEntry.timesheetReport.orgUnit.id", "object.timesheet_report.org_unit.label",
                        new SelectFilterComponent(orgUnits.getValues().iterator().next().getValue(), orgUnits), true, false, SortStatusType.NONE);
            } else {
                addColumnConfiguration("orgUnit", "timesheetEntry.timesheetReport.orgUnit.id", "object.timesheet_report.org_unit.label",
                        new NoneFilterComponent(), true, false, SortStatusType.NONE);
            }

            addColumnConfiguration("logDate", "logDate", "object.timesheet_log.log_date.label",
                    new DateRangeFilterComponent(new Date(), new Date(), Utilities.getDefaultDatePattern()), true, false, SortStatusType.ASC);

            addColumnConfiguration("hours", "hours", "object.timesheet_log.hours.label", new NumericFieldFilterComponent("0", "="), true, false,
                    SortStatusType.UNSORTED);

            ISelectableValueHolderCollection<String> statusVH = new DefaultSelectableValueHolderCollection<>();
            for (TimesheetReport.Status status : TimesheetReport.Status.values()) {
                statusVH.add(new DefaultSelectableValueHolder<>(status.name(),
                        Msg.get("object.timesheet_report.status." + status.name() + ".label")));
            }
            addColumnConfiguration("status", "timesheetEntry.timesheetReport.status", "object.timesheet_report.status.label",
                    new SelectFilterComponent(TimesheetReport.Status.APPROVED.name(), statusVH), true, false, SortStatusType.NONE);

            addColumnConfiguration("planningPackage", "timesheetEntry.portfolioEntryPlanningPackage.name",
                    "object.timesheet_entry.planning_package.label", new TextFieldFilterComponent("*"), true, false, SortStatusType.UNSORTED);

        }
    };
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:40,代码来源:TimesheetLogListView.java

示例6: getLCMilestoneActiveAsVH

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get all active life cycle milestones (of all active processes) as value
 * holder collection.
 */
public static ISelectableValueHolderCollection<Long> getLCMilestoneActiveAsVH() {

    DefaultSelectableValueHolderCollection<Long> valueHolderCollection = new DefaultSelectableValueHolderCollection<>();
    List<LifeCycleMilestone> list = findLifeCycleMilestone.where().eq("deleted", false).eq("isActive", true).eq("lifeCycleProcess.deleted", false)
            .eq("lifeCycleProcess.isActive", true).findList();
    for (LifeCycleMilestone lifeCycleMilestone : list) {
        valueHolderCollection.add(new DefaultSelectableValueHolder<>(lifeCycleMilestone.id,
                lifeCycleMilestone.lifeCycleProcess.getShortName() + " - " + lifeCycleMilestone.getName()));

    }
    return valueHolderCollection;

}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:18,代码来源:LifeCycleMilestoneDao.java

示例7: getPEReportStatusTypeActiveAsCssVH

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get all selectable status types as a value holder collection with the CSS
 * implementation.
 */
public static DefaultSelectableValueHolderCollection<CssValueForValueHolder> getPEReportStatusTypeActiveAsCssVH() {
    DefaultSelectableValueHolderCollection<CssValueForValueHolder> selectablePortfolioEntryReportStatusTypes;
    selectablePortfolioEntryReportStatusTypes = new DefaultSelectableValueHolderCollection<>();
    List<PortfolioEntryReportStatusType> list = findPortfolioEntryReportStatusType.orderBy("id").where().eq("deleted", false).eq("selectable", true)
            .findList();
    for (PortfolioEntryReportStatusType portfolioEntryReportStatusType : list) {
        selectablePortfolioEntryReportStatusTypes.add(new DefaultSelectableValueHolder<>(
                new CssValueForValueHolder(String.valueOf(portfolioEntryReportStatusType.id), portfolioEntryReportStatusType.getName(),
                        portfolioEntryReportStatusType.cssClass),
                String.valueOf(portfolioEntryReportStatusType.id)));

    }
    return selectablePortfolioEntryReportStatusTypes;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:19,代码来源:PortfolioEntryReportDao.java

示例8: getPEAsVHByKeywords

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get all selectable portfolio entry types as value holder collection.<br/>
 * @param key
 *            the search criteria (use % for wild cards)
 * @param limit 
 * 			   limit the number of entries (useful with auto-complete)
 */
public static ISelectableValueHolderCollection<Long> getPEAsVHByKeywords(String key, int limit) {
	DefaultSelectableValueHolderCollection<Long> valueHolderCollection=new DefaultSelectableValueHolderCollection<Long>();
	List<PortfolioEntry> PEList=getPEAsListByKeywords(key, limit);
	if(PEList!=null){
		for(PortfolioEntry pe : PEList){
			valueHolderCollection.add(new DefaultSelectableValueHolder<Long>(pe.id,pe.name));
		}
	}
	return valueHolderCollection;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:18,代码来源:PortfolioEntryDao.java

示例9: getActorActiveAsVHByKeywordsAndPE

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Search from the active actors that are direct stakholders of a portfolio
 * entry and return a value holder collection.
 * 
 * @param key
 *            the search criteria (use % for wild cards)
 * @param portfolioEntryId
 *            the portfolio entry id
 */
public static ISelectableValueHolderCollection<Long> getActorActiveAsVHByKeywordsAndPE(String key, Long portfolioEntryId) {
    key = key.replace("\"", "\\\"");
    String sql = "SELECT a.id FROM actor a JOIN stakeholder s ON a.id = s.actor_id WHERE "
            + "a.deleted = false AND a.is_active = true AND s.deleted = false AND s.portfolio_entry_id = '" + portfolioEntryId
            + "' AND (CONCAT_WS(\" \", a.first_name, a.last_name) like \"" + key + "%\" OR " + "CONCAT_WS(\" \", a.last_name, a.first_name) like \"" + key
            + "%\")";
    RawSql rawSql = RawSqlBuilder.parse(sql).columnMapping("a.id", "id").create();
    List<Actor> actors = findActor.query().setRawSql(rawSql).findList();

    return new DefaultSelectableValueHolderCollection<>(actors);
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:21,代码来源:ActorDao.java

示例10: getPEPlanningPackageAsVHWithExpenditureType

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Transform a list of planning packages to a value holder collection by
 * including the expenditure type in the name.
 * 
 * @param planningPackages
 *            the list of planning packages
 */
private static ISelectableValueHolderCollection<Long> getPEPlanningPackageAsVHWithExpenditureType(List<PortfolioEntryPlanningPackage> planningPackages) {
    ISelectableValueHolderCollection<Long> selectableObjects = new DefaultSelectableValueHolderCollection<Long>();
    for (PortfolioEntryPlanningPackage planningPackage : planningPackages) {
        selectableObjects.add(new DefaultSelectableValueHolder<Long>(planningPackage.id,
                planningPackage.getName() + " (" + display_is_opex.render(planningPackage.isOpex).toString().trim() + ")"));
    }
    return selectableObjects;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:16,代码来源:PortfolioEntryPlanningPackageDao.java

示例11: getPEPlanningPackageTypeActiveAsCssVH

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get active types as a value holder collection with the CSS
 * implementation.
 */
public static DefaultSelectableValueHolderCollection<CssValueForValueHolder> getPEPlanningPackageTypeActiveAsCssVH() {
    DefaultSelectableValueHolderCollection<CssValueForValueHolder> selectablePortfolioEntryReportStatusTypes;
    selectablePortfolioEntryReportStatusTypes = new DefaultSelectableValueHolderCollection<>();
    for (PortfolioEntryPlanningPackageType type : getPEPlanningPackageTypeActiveAsList()) {
        selectablePortfolioEntryReportStatusTypes.add(new DefaultSelectableValueHolder<>(
                new CssValueForValueHolder(String.valueOf(type.id), type.getName(), type.cssClass), String.valueOf(type.id)));

    }
    return selectablePortfolioEntryReportStatusTypes;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:15,代码来源:PortfolioEntryPlanningPackageDao.java

示例12: getLifeCycleMilestoneTypeAsVHC

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get the life cycle milestone types as a value holder collection.
 * 
 * Note: return null if there is no type.
 * 
 * @param isRelease
 *            true to get type for release process, false for initiative
 *            process.
 */
public static DefaultSelectableValueHolderCollection<String> getLifeCycleMilestoneTypeAsVHC(boolean isRelease) {
    DefaultSelectableValueHolderCollection<String> types = new DefaultSelectableValueHolderCollection<String>();
    for (LifeCycleMilestone.Type type : LifeCycleMilestone.Type.values()) {
        if (type.isRelease == isRelease) {
            types.add(new DefaultSelectableValueHolder<String>(type.name(), type.getLabel()));
        }
    }
    return types.getSortedValues().size() > 0 ? types : null;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:19,代码来源:ConfigurationGovernanceController.java

示例13: getStatusTypesAsValueHolderCollection

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Get the status types as a value holder collection.
 */
private static ISelectableValueHolderCollection<String> getStatusTypesAsValueHolderCollection() {
    ISelectableValueHolderCollection<String> statusTypes = new DefaultSelectableValueHolderCollection<String>();
    for (Type type : RequirementStatus.Type.values()) {
        statusTypes.add(new DefaultSelectableValueHolder<String>(type.name(), Msg.get("object.requirement_status.type." + type.name() + ".label")));
    }
    return statusTypes;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:11,代码来源:ConfigurationRequirementController.java

示例14: getSelectableValuesListForObjectClass

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Return the values which can be "selected" in the picker for the field
 * objectClass.
 * 
 * @param currentObjectClass
 *            the class name of the current object
 * @param auditLoggerService
 *            the audit logger service
 */
public static ISelectableValueHolderCollection<String> getSelectableValuesListForObjectClass(String currentObjectClass,
        IAuditLoggerService auditLoggerService) {

    // Get all the selectable entities from the configuration
    ISelectableValueHolderCollection<String> selectableObjects = new DefaultSelectableValueHolderCollection<String>();

    DataType.getAllAuditableDataTypes()
            .stream()
            .filter(
                    // Filter out the previously selected entities
                    dataType -> auditLoggerService.getAllActiveAuditable()
                            .stream()
                            .map(auditable -> auditable.objectClass)
                            .anyMatch(auditable -> auditable.equals(dataType.getDataTypeClassName()))
            )
            .map(dataType -> new DefaultSelectableValueHolder<>(dataType.getDataTypeClassName(), Msg.get(dataType.getLabel())))
            .forEach(selectableObjects::add);

    // Add the current value if any (so that it could be displayed and
    // selected again)
    if (currentObjectClass != null && !StringUtils.isBlank(currentObjectClass)) {
        DataType dataTypeFromClassName = DataType.getDataTypeFromClassName(currentObjectClass);
        selectableObjects.add(
                new DefaultSelectableValueHolder<>(currentObjectClass, Msg.get(dataTypeFromClassName != null ? dataTypeFromClassName.getLabel() : "")));
    }
    return selectableObjects;
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:37,代码来源:AuditableController.java

示例15: searchFormats

import framework.utils.DefaultSelectableValueHolderCollection; //导入依赖的package包/类
/**
 * Search reporting Format
 */
public Result searchFormats(Long id) {

    String query = request().queryString().get("query") != null ? request().queryString().get("query")[0] : null;
    String value = request().queryString().get("value") != null ? request().queryString().get("value")[0] : null;

    if (query != null) {
        ISelectableValueHolderCollection<String> reportingFormats = new DefaultSelectableValueHolderCollection<String>();
                  
        String str = ReportingDao.getReportingById(id).getFormats();
        String[] listFormats = str.split(",");
        
        for (String s:listFormats)
        {
        	reportingFormats.add(new DefaultSelectableValueHolder<String>(s,s));
        }
        return ok(Utilities.marshallAsJson(reportingFormats.getValues()));
    }
    
    if (value != null) {
       
        ISelectableValueHolder<String> v = new DefaultSelectableValueHolder<String>(value, value);
        return ok(Utilities.marshallAsJson(v, 0));
    }

    return ok(Json.newObject());

}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:31,代码来源:ReportingController.java


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