Package ariba.util.fieldvalue

Examples of ariba.util.fieldvalue.OrderedList


    protected void accumulateList (List all, Object currSubList)
    {
        if (currSubList == null) return;

        incrementNestingLevel();
        OrderedList orderedListClassExtension = OrderedList.get(currSubList);
        int count = orderedListClassExtension.size(currSubList);
        for (int i=0; i<count; i++) {
            Object currObj = orderedListClassExtension.elementAt(currSubList, i);
            all.add(currObj);
            setCurrentItem(currObj);
            if (isExpanded()) {
                accumulateList(all, currentItemChildren());
            }
View Full Code Here


    public Object nextSublist ()
    {
        Object sublist = null;
        int startIndex = _nextGroupIndex;
        if (startIndex < _orderedListCount) {
            OrderedList orderedListClassExtension = OrderedList.get(_orderedList);
            Object currentItem = orderedListClassExtension.elementAt(_orderedList, startIndex);
            Object groupingValue = FieldValue.getFieldValue(currentItem, _groupByKeyPath);
            int currentIndex = startIndex + 1;
            while (currentIndex < _orderedListCount) {
                Object currentElement = orderedListClassExtension.elementAt(_orderedList, currentIndex);
                Object currentValue = FieldValue.getFieldValue(currentElement, _groupByKeyPath);
                if ((groupingValue == currentValue) || ((groupingValue != null) && groupingValue.equals(currentValue))) {
                    currentIndex++;
                }
                else {
                    break;
                }
            }
            _nextGroupIndex = currentIndex;
            sublist = orderedListClassExtension.sublist(_orderedList, startIndex, _nextGroupIndex);
            // ** For convenience, push an element of the sublist into the parent.
            pushItemFromSublist(sublist);
        }
        return sublist;
    }
View Full Code Here

    public void setSelectedIndexArray (String[] optionIndexArray)
    {
        // ** This is called once during applyValues phase.
        Object orderedList = orderedList();
        Object resultList = _orderedListClassExtension.mutableInstance(orderedList);
        OrderedList resultListClassExtension = OrderedList.get(resultList);
        int optionIndexCount = optionIndexArray.length;
        if (optionIndexCount > 0) {
            for (int index = 0; index < optionIndexCount; index++) {
                String optionIndexString = optionIndexArray[index];
                if (!optionIndexString.equals(NoSelectionString)) {
                    int optionIndex = Integer.parseInt(optionIndexString);
                    Object object = _orderedListClassExtension.elementAt(orderedList, optionIndex);
                    resultListClassExtension.addElement(resultList, object);
                }
            }
        }
        setValueForBinding(resultList, BindingNames.selections);
    }
View Full Code Here

            }
        }
        requestContext.pushElementIdLevel();
        AWElementIdPath parentPath = requestContext.currentElementIdPath();
        Object orderedList = null;
        OrderedList orderedListClassExtension = null;
        int repeatCount;
        if (_list != null) {
            orderedList = _orderedListInComponent(component);
            orderedListClassExtension = OrderedList.get(orderedList);
            repeatCount = orderedListClassExtension.size(orderedList);
            repeatCount = minimumRepeatCount(repeatCount, component);
        }
        else {
            repeatCount = _count.intValue(component);
        }
View Full Code Here

        // If we made it this far, the sender is somewhere in one of our iterations.
        boolean scoping = scopeSubcomponentsByItem(component);
        requestContext.pushElementIdLevel();
        AWElementIdPath parentPath = requestContext.currentElementIdPath();
        Object orderedList = null;
        OrderedList orderedListClassExtension = null;
        int repeatCount = -1;
        if (_list != null) {
            orderedList = _orderedListInComponent(component);
            orderedListClassExtension = OrderedList.get(orderedList);
            repeatCount = orderedListClassExtension.size(orderedList);
            repeatCount = minimumRepeatCount(repeatCount, component);
        }
        else {
            repeatCount = _count.intValue(component);
        }
View Full Code Here

            requestContext._debugPushSemanticKeyPrefix();
        }

        Object orderedList = null;
        int repeatCount;
        OrderedList orderedListClassExtension = null;
        if (_list != null) {
            orderedList = _orderedListInComponent(component);
            orderedListClassExtension = OrderedList.get(orderedList);
            repeatCount = orderedListClassExtension.size(orderedList);
            repeatCount = minimumRepeatCount(repeatCount, component);
        }
        else {
            repeatCount = _count.intValue(component);
        }
        int index = _startIndex(component);
        if (index > 0) requestContext.incrementElementId(index)// bump elementId to match start pos
        for (; index < repeatCount; index++) {
            requestContext.pushElementIdLevel();
            pushIterationValues(component, index, orderedListClassExtension, orderedList, parentPath, scoping);
            // record & playback
            if (shouldPushSemanticKeyPrefix) {
                String key = null;
                if (_semanticKey != null) {
                    key = (String)_semanticKey.value(component);
                }
                if (key == null && orderedList != null) {
                    Object item = orderedListClassExtension.elementAt(orderedList, index);
                    if (item != null) {
                        SemanticKeyProvider provider = AWSemanticKeyProvider.get(item);
                        if (provider != null) {
                            key = SemanticKeyProviderUtil.getKey(provider, item, component);
                        }
View Full Code Here

    }
   
    public void setFormValues (String[] selectedIndexes)
    {
        Object itemList = itemList();
        OrderedList itemListClassExtension = OrderedList.get(itemList);
        Object resultList = itemListClassExtension.mutableInstance(itemList);
        OrderedList resultListClassExtension = OrderedList.get(resultList);
        int selectedIndexCount = selectedIndexes.length;
        for (int index = 0; index < selectedIndexCount; index++) {
            String selectedIndexString = selectedIndexes[index];
            int selectedIndex = Integer.parseInt(selectedIndexString);
            Object object = itemListClassExtension.elementAt(itemList, selectedIndex);
            resultListClassExtension.addElement(resultList, object);
        }
        if (itemList instanceof Object[]) {
            resultList = AWUtil.getArray((List)resultList, itemList.getClass().getComponentType());
        }
        setValueForBinding(resultList, AWBindingNames.selections);
View Full Code Here

    {
        if (_selectedTab == null) {
            _selectedTab = valueForBinding(AWBindingNames.selection);
            if (_selectedTab == null) {
                Object tabList = tabList();
                OrderedList list = OrderedList.get(tabList);
                Object selectedTab = null;
                for (int i=0, size=list.size(tabList);
                     i < size && selectedTab == null; i++) {
                    selectedTab = list.elementAt(tabList, i);
                }
                Assert.that(selectedTab != null, "No visible tabs found in tabset.");
                setSelectedTab(selectedTab);
            }
        }
View Full Code Here

        Element layout = (Element)table.valueForBinding(_layoutBinding);
        if (layout == null) return;

        Object columnMetas = FieldValue.getFieldValue(layout, "children");
        OrderedList listImpl = OrderedList.get(columnMetas);
        int count = listImpl.size(columnMetas);

        Assert.that(count > 0, "Meta data table must have > 0 columns in the Layout");

        // alloc and register AWTGroupColumns based on the meta data
        boolean useXMLFieldPath = table.booleanValueForBinding(_useXMLFieldPathBinding);
        for (int i=0; i<count; i++) {
            Element columnMeta = (Element)listImpl.elementAt(columnMetas, i);
            String key = columnMeta.getAttribute("key");
            String label = columnMeta.hasAttribute("label") ? columnMeta.getAttribute("label") : null;
            AWTMetaColumn column = new AWTMetaColumn();
            column.init(table, key, label, columnMeta, useDirectActionBinding, formatters, useXMLFieldPath);
            table.registerColumn(column);
View Full Code Here

        if ( v2 == null ) {
            // A null collection is always treated as empty
            return false;
        }

        OrderedList listInterface = OrderedList.get(v2);

        for (Iterator e = listInterface.elements(v2); e.hasNext();) {
            Object      o = e.next();

            if ( equal(v1, o) ) {
                return true;
            }
View Full Code Here

TOP

Related Classes of ariba.util.fieldvalue.OrderedList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.