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


Java LookupView类代码示例

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


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

示例1: doesLookupFieldTreatWildcardsAndOperatorsAsLiteral

import org.kuali.rice.krad.lookup.LookupView; //导入依赖的package包/类
@Deprecated
protected boolean doesLookupFieldTreatWildcardsAndOperatorsAsLiteral(Class<?> type, String fieldName) {
    // determine the LookupInputField for the field and use isDisableWildcardsAndOperators
    Map<String, String> indexKey = new HashMap<String, String>();
    indexKey.put(UifParameters.VIEW_NAME, UifConstants.DEFAULT_VIEW_NAME);
    indexKey.put(UifParameters.DATA_OBJECT_CLASS_NAME, type.getName());

    // obtain the Lookup View for the data object
    View view = getDataDictionaryService().getDataDictionary().getViewByTypeIndex(UifConstants.ViewType.LOOKUP, indexKey);
    if (view != null && view instanceof LookupView) {
        LookupView lookupView = (LookupView) view;
        // iterate through the criteria fields to find the lookup field for the given property
        List<Component> criteriaFields = lookupView.getCriteriaFields();
        for (Component criteriaField: criteriaFields) {
            if (criteriaField instanceof LookupInputField) {
                LookupInputField lookupInputField = (LookupInputField) criteriaField;
                if (fieldName.equals(lookupInputField.getPropertyName())) {
                    // this is the droid we're looking for
                    return lookupInputField.isDisableWildcardsAndOperators();
                }
            }
        }
    }

    return false;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:LookupCriteriaGeneratorImpl.java

示例2: deriveLookupViewFromMetadata

import org.kuali.rice.krad.lookup.LookupView; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.uif.service.UifDefaultingService#deriveLookupViewFromMetadata(org.kuali.rice.krad.datadictionary.DataObjectEntry)
 */
@Override
public LookupView deriveLookupViewFromMetadata(DataObjectEntry dataObjectEntry) {
    LookupView view = ComponentFactory.getLookupView();
    view.setHeaderText(dataObjectEntry.getObjectLabel() + " Lookup");
    view.setDataObjectClass(dataObjectEntry.getDataObjectClass());
    view.setCriteriaFields(new ArrayList<Component>());
    view.setResultFields(new ArrayList<Component>());
    view.setDefaultSortAttributeNames(dataObjectEntry.getPrimaryKeys());

    addAttributesToLookupCriteria(view, dataObjectEntry);
    addAttributesToLookupResults(view, dataObjectEntry);

    return view;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:UifDefaultingServiceImpl.java

示例3: generateMissingLookupDefinitions

import org.kuali.rice.krad.lookup.LookupView; //导入依赖的package包/类
protected void generateMissingLookupDefinitions() {
    Collection<LookupView> lookupViewBeans = ddBeans.getBeansOfType(LookupView.class).values();
    // Index all the inquiry views by the data object class so we can find them easily below
    Map<Class<?>,LookupView> defaultViewsByDataObjectClass = new HashMap<>();
    for ( LookupView view : lookupViewBeans ) {
        if ( view.getViewName().equals(UifConstants.DEFAULT_VIEW_NAME) ) {
            defaultViewsByDataObjectClass.put(view.getDataObjectClass(), view);
        }
    }
    for (DataObjectEntry entry : ddBeans.getBeansOfType(DataObjectEntry.class).values()) {
        // if an inquiry already exists, just ignore - we only default if none exist
        if ( defaultViewsByDataObjectClass.containsKey(entry.getDataObjectClass())) {
            continue;
        }
        // We only generate the inquiry if the metadata says to
        if ( entry.getDataObjectMetadata() == null ) {
            continue;
        }
        if ( !entry.getDataObjectMetadata().shouldAutoCreateUifViewOfType(UifAutoCreateViewType.LOOKUP)) {
            continue;
        }
        // no inquiry exists and we want one to, create one
        if ( LOG.isInfoEnabled() ) {
            LOG.info( "Generating Lookup View for : " + entry.getDataObjectClass() );
        }
        String lookupBeanName = entry.getDataObjectClass().getSimpleName()+"-LookupView-default";

        LookupView lookupView = KRADServiceLocatorWeb.getUifDefaultingService().deriveLookupViewFromMetadata(entry);
        lookupView.setId(lookupBeanName);
        lookupView.setViewName(UifConstants.DEFAULT_VIEW_NAME);

        ChildBeanDefinition lookupBean = new ChildBeanDefinition(ComponentFactory.LOOKUP_VIEW);
        lookupBean.setScope(BeanDefinition.SCOPE_SINGLETON);
        lookupBean.setAttribute("dataObjectClassName", lookupView.getDataObjectClass());
        lookupBean.getPropertyValues().add("dataObjectClassName", lookupView.getDataObjectClass().getName());
        lookupBean.setResourceDescription("Autogenerated From Metadata");
        ddBeans.registerBeanDefinition(lookupBeanName, lookupBean);
        ddBeans.registerSingleton(lookupBeanName, lookupView);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:41,代码来源:DataDictionary.java

示例4: generateMissingLookupDefinitions

import org.kuali.rice.krad.lookup.LookupView; //导入依赖的package包/类
protected void generateMissingLookupDefinitions() {
    Collection<LookupView> lookupViewBeans = ddBeans.getBeansOfType(LookupView.class).values();
    // Index all the inquiry views by the data object class so we can find them easily below
    Map<Class<?>,LookupView> defaultViewsByDataObjectClass = new HashMap<Class<?>, LookupView>();
    for ( LookupView view : lookupViewBeans ) {
        if ( view.getViewName().equals(UifConstants.DEFAULT_VIEW_NAME) ) {
            defaultViewsByDataObjectClass.put(view.getDataObjectClass(), view);
        }
    }
    for (DataObjectEntry entry : ddBeans.getBeansOfType(DataObjectEntry.class).values()) {
        // if an inquiry already exists, just ignore - we only default if none exist
        if ( defaultViewsByDataObjectClass.containsKey(entry.getDataObjectClass())) {
            continue;
        }
        // We only generate the inquiry if the metadata says to
        if ( entry.getDataObjectMetadata() == null ) {
            continue;
        }
        if ( !entry.getDataObjectMetadata().shouldAutoCreateUifViewOfType(UifAutoCreateViewType.LOOKUP)) {
            continue;
        }
        // no inquiry exists and we want one to, create one
        if ( LOG.isInfoEnabled() ) {
            LOG.info( "Generating Lookup View for : " + entry.getDataObjectClass() );
        }
        String lookupBeanName = entry.getDataObjectClass().getSimpleName()+"-LookupView-default";

        LookupView lookupView = KRADServiceLocatorWeb.getUifDefaultingService().deriveLookupViewFromMetadata(entry);
        lookupView.setId(lookupBeanName);
        lookupView.setViewName(UifConstants.DEFAULT_VIEW_NAME);

        ChildBeanDefinition lookupBean = new ChildBeanDefinition(ComponentFactory.LOOKUP_VIEW);
        lookupBean.setScope(BeanDefinition.SCOPE_SINGLETON);
        lookupBean.setAttribute("dataObjectClassName", lookupView.getDataObjectClass());
        lookupBean.getPropertyValues().add("dataObjectClassName", lookupView.getDataObjectClass().getName());
        lookupBean.setResourceDescription("Autogenerated From Metadata");
        ddBeans.registerBeanDefinition(lookupBeanName, lookupBean);
        ddBeans.registerSingleton(lookupBeanName, lookupView);
    }
}
 
开发者ID:kuali,项目名称:rice,代码行数:41,代码来源:DataDictionary.java

示例5: buildSortOptions

import org.kuali.rice.krad.lookup.LookupView; //导入依赖的package包/类
/**
 * Builds default sorting options.
 *
 * @param lookupView the view for the lookup
 * @param collectionGroup the collection group for the table
 */
protected void buildSortOptions(LookupView lookupView, CollectionGroup collectionGroup) {
    if (!isDisableTableSort() && CollectionUtils.isNotEmpty(lookupView.getDefaultSortAttributeNames())) {
        LayoutManager layoutManager = collectionGroup.getLayoutManager();

        if (layoutManager instanceof TableLayoutManager) {
            TableLayoutManager tableLayoutManager = (TableLayoutManager) layoutManager;

            List<String> firstRowPropertyNames = getFirstRowPropertyNames(tableLayoutManager.getFirstRowFields());
            List<String> defaultSortAttributeNames = lookupView.getDefaultSortAttributeNames();
            String sortDirection = lookupView.isDefaultSortAscending() ? "'asc'" : "'desc'";
            boolean actionFieldVisible = collectionGroup.isRenderLineActions() && !Boolean.TRUE.equals(
                    collectionGroup.getReadOnly());
            int actionIndex = ((TableLayoutManager) layoutManager).getActionColumnIndex();
            int columnIndexPrefix = 0;

            if (tableLayoutManager.isRenderSequenceField()) {
                columnIndexPrefix++;
            }

            if (tableLayoutManager.getRowDetailsGroup() != null && CollectionUtils.isNotEmpty(
                    tableLayoutManager.getRowDetailsGroup().getItems())) {
                columnIndexPrefix++;
            }

            StringBuffer tableToolsSortOptions = new StringBuffer("[");

            for (String defaultSortAttributeName : defaultSortAttributeNames) {
                int index = firstRowPropertyNames.indexOf(defaultSortAttributeName);
                if (index >= 0) {
                    if (tableToolsSortOptions.length() > 1) {
                        tableToolsSortOptions.append(",");
                    }
                    int columnIndex = columnIndexPrefix + index;
                    if (actionFieldVisible && actionIndex != -1 && actionIndex <= columnIndex + 1) {
                        columnIndex++;
                    }
                    tableToolsSortOptions.append("[" + columnIndex + "," + sortDirection + "]");
                }
            }

            tableToolsSortOptions.append("]");

            if (templateOptions.isEmpty()) {
                setTemplateOptions(new HashMap<String, String>());
            }
            templateOptions.put(UifConstants.TableToolsKeys.AASORTING, tableToolsSortOptions.toString());
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:56,代码来源:RichTable.java

示例6: setup

import org.kuali.rice.krad.lookup.LookupView; //导入依赖的package包/类
@Before
public void setup() throws Throwable {
    richTable = new RichTable();

    richTable = spy(richTable);

    ConfigurationService configurationService = mock(ConfigurationService.class);
    doReturn(configurationService).when(richTable).getConfigurationService();

    group = new CollectionGroupBase();
    group.setCollectionObjectClass(Employee.class);

    TableLayoutManager layoutManager = new TableLayoutManagerBase();
    layoutManager.setRenderSequenceField(true);

    List<Component> items = new ArrayList<Component>(1);
    DataField name = new DataFieldBase();
    name.setPropertyName("employeeId");
    items.add(name);
    DataField number = new DataFieldBase();
    number.setPropertyName("positionTitle");
    items.add(number);
    DataField contactEmail = new DataFieldBase();
    contactEmail.setPropertyName("contactEmail");
    items.add(contactEmail);

    layoutManager = spy(layoutManager);
    doReturn(items).when(layoutManager).getFirstRowFields();
    doReturn(layoutManager).when(layoutManager).clone();

    group.setLayoutManager(layoutManager);
    group.setIncludeLineSelectionField(false);
    group.setRenderLineActions(false);

    group.setItems(items);

    mockView = mock(LookupView.class);
    ViewHelperService mockViewHelperService = mock(ViewHelperService.class);
    when(mockView.getViewHelperService()).thenReturn(mockViewHelperService);
    when(mockView.clone()).thenReturn(mockView);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:42,代码来源:RichTableTest.java

示例7: deriveLookupViewFromMetadata

import org.kuali.rice.krad.lookup.LookupView; //导入依赖的package包/类
/**
 * Build an instance of an {@link LookupView} for the given data object entry.
 * Information will be pulled from the {@link DataObjectEntry} and the embedded
 * {@link DataObjectMetadata} and {@link DataObjectAttribute} instances as needed.
 *
 * In the present implementation, all non-hidden properties on the DataObjectEntry
 * will be added to the lookup search criteria and results.
 * @param dataObjectEntry data object entry
 * @return lookup view based on the data object
 */
LookupView deriveLookupViewFromMetadata( DataObjectEntry dataObjectEntry );
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:UifDefaultingService.java

示例8: getLookupView

import org.kuali.rice.krad.lookup.LookupView; //导入依赖的package包/类
/**
 * Gets an empty lookup view configuration for population.
 *
 * @return LookupView component
 */
public static LookupView getLookupView() {
    return (LookupView) getNewComponentInstance(LOOKUP_VIEW);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:ComponentFactory.java


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