Beispiel #1
0
  @Override
  protected List<Object> loadChildData(ProgressMonitor monitor) {
    try {
      OrderID orderID = (OrderID) JDOHelper.getObjectId(recurringOrder);
      RecurringOrder o =
          RecurringOrderDAO.sharedInstance()
              .getRecurringOrder(
                  orderID, FETCH_GROUPS_ORDER, NLJDOHelper.MAX_FETCH_DEPTH_NO_LIMIT, monitor);

      ArrayList<Offer> res = new ArrayList<Offer>(o.getOffers());

      Collections.sort(
          res,
          new Comparator<Offer>() {
            public int compare(Offer o0, Offer o1) {
              long id0 = o0.getOfferID();
              long id1 = o1.getOfferID();

              if (id0 == id1) return 0;

              if (id0 > id1) return 1;
              else return -1;
            }
          });

      return CollectionUtil.castList(res);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  public List<State> getStates() {
    if (_states == null) _states = CollectionUtil.castList(Collections.unmodifiableList(states));

    return _states;
  }