Package com.webobjects.appserver

Examples of com.webobjects.appserver.WODisplayGroup$Delegate


    public void setNumberOfObjectsPerBatch(Number newValue) {
      ERXThreadStorage.takeValueForKey(newValue, _threadStorageKey);
    }

    public int filteredObjectsCount() {
        WODisplayGroup dg=displayGroup();
        if (dg instanceof ERXDisplayGroup) {
      ERXDisplayGroup erxdg = (ERXDisplayGroup) dg;
      return erxdg.filteredObjects().count();
    }
        int result=0;
        EOQualifier q=dg.qualifier();
        if (q!=null) {
            result=EOQualifier.filteredArrayWithQualifier(dg.allObjects(),q).count();
        } else {
            result=dg.allObjects().count();
        }
        return result;
    }
View Full Code Here


    }

    private void _removeSortOrderingWithKey(String s)
    {
        int i = 0;
        WODisplayGroup wodisplaygroup = displayGroup();
        NSArray nsarray = wodisplaygroup.sortOrderings();
        if(nsarray != null)
        {
            NSMutableArray nsmutablearray = new NSMutableArray(nsarray); //.mutableClone();
            for(Enumeration enumeration = nsmutablearray.objectEnumerator(); enumeration.hasMoreElements(); i++)
            {
                EOSortOrdering eosortordering = (EOSortOrdering)enumeration.nextElement();
                if(!s.equals(eosortordering.key()))
                    continue;
                nsmutablearray.removeObjectAtIndex(i);
                break;
            }

            wodisplaygroup.setSortOrderings(nsmutablearray);
        }
    }
View Full Code Here

    }

    private void _makePrimarySortOrderingWithSelector(NSSelector nsselector)
    {
        String s = key();
        WODisplayGroup wodisplaygroup = displayGroup();
        NSArray nsarray = wodisplaygroup.sortOrderings();
        NSMutableArray nsmutablearray;
        if(nsarray != null)
            nsmutablearray = new NSMutableArray(nsarray);
        else
            nsmutablearray = new NSMutableArray();
        EOSortOrdering eosortordering = EOSortOrdering.sortOrderingWithKey(s, nsselector);
        nsmutablearray.insertObjectAtIndex(eosortordering, 0);
        if(nsmutablearray.count() > 3)
            nsmutablearray.removeLastObject();
        wodisplaygroup.setSortOrderings(nsmutablearray);
    }
View Full Code Here

  }

  public WOActionResults previousPage() {
    WOActionResults previousPage = null;
    if(displayGroup() != null){
      WODisplayGroup displayGroup = displayGroup();
      displayGroup.displayPreviousBatch();
    } else if(parentActionName() != null){
      Integer previousBatchIndex = Integer.valueOf((currentBatchIndex() - 1));
      if(previousBatchIndex.intValue() < 1){
        previousBatchIndex = Integer.valueOf(1);
      }
View Full Code Here

  }

  public WOActionResults nextPage() {
    WOActionResults nextPage = null;
    if(displayGroup() != null){
      WODisplayGroup displayGroup = displayGroup();
      displayGroup.displayNextBatch();
    } else if(parentActionName() != null){
      Integer nextBatchIndex = Integer.valueOf(currentBatchIndex() + 1);
      int pageCount  = batchCount();
      if(nextBatchIndex.intValue()  > pageCount){
        nextBatchIndex = Integer.valueOf(pageCount);
View Full Code Here

    }

    protected void _removeSortOrderingWithKey(String aKey) {
        int anIndex = 0;
        EOSortOrdering aSortOrdering = null;
        WODisplayGroup aDisplayGroup = displayGroup();
        NSArray<EOSortOrdering> sortOrderings = aDisplayGroup.sortOrderings();
        if (sortOrderings!=null) {
            NSMutableArray<EOSortOrdering> aSortOrderingArray = sortOrderings.mutableClone();
            Enumeration anEnumerator = aSortOrderingArray.objectEnumerator();
            while (anEnumerator.hasMoreElements()) {
                aSortOrdering = (EOSortOrdering) anEnumerator.nextElement();
                if (aKey.equals(aSortOrdering.key())) {
                    aSortOrderingArray.removeObjectAtIndex(anIndex);
                    break;
                }
                anIndex++;
            }
            aDisplayGroup.setSortOrderings(aSortOrderingArray);
        }
    }
View Full Code Here

        }
    }

    protected void _makePrimarySortOrderingWithSelector(NSSelector aSelector) {
        String aKey = key();
        WODisplayGroup aDisplayGroup = displayGroup();
        NSArray<EOSortOrdering> sortOrderings = aDisplayGroup.sortOrderings();
        NSMutableArray<EOSortOrdering> aSortOrderingArray;
        if (sortOrderings!=null) {
            aSortOrderingArray = new NSMutableArray<EOSortOrdering>(sortOrderings);
        } else {
            aSortOrderingArray = new NSMutableArray<EOSortOrdering>();
        }
        EOSortOrdering aNewSortOrdering = EOSortOrdering.sortOrderingWithKey(aKey, aSelector);
        aSortOrderingArray.insertObjectAtIndex(aNewSortOrdering, 0);
        if (aSortOrderingArray.count() > 3) {
            // ** limits sorting to 3 levels
            aSortOrderingArray.removeLastObject();
        }
        aDisplayGroup.setSortOrderings(aSortOrderingArray);
    }
View Full Code Here

TOP

Related Classes of com.webobjects.appserver.WODisplayGroup$Delegate

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.