Examples of PropertyComparator


Examples of org.dmlite.util.order.PropertyComparator

   */
  public Members getMembersOrderedByLastFirstName(boolean ascending) {
    Members orderByLastFirstName = null;
    try {
      CompositeComparator compositePropertyComparator = new CompositeComparator(
          new PropertyComparator("lastName"), new PropertyComparator(
              "firstName"));
      OrderCriteria criteria = OrderCriteria.defineOrder(
          compositePropertyComparator, ascending);
      orderByLastFirstName = (Members) getEntities(criteria);
    } catch (OrderException e) {
View Full Code Here

Examples of org.dmlite.util.order.PropertyComparator

  public Interests getInterestsOrderedByUser(boolean ascending) {
    Interests orderByUser = null;
    try {
      CompositeComparator compositePropertyComparator = new CompositeComparator(
          new PropertyComparator("lastName"), new PropertyComparator(
              "firstName"));
      NeighborComparator neighborComparator = new NeighborComparator(
          "user", compositePropertyComparator);
      OrderCriteria criteria = OrderCriteria.defineOrder(
          neighborComparator, ascending);
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

        else if (matcherEditor != null)
            eventList = new FilterList(eventList, matcherEditor);

        String sortProperty = getColumnPropertyNames()[0];
        SortedList sortedList = new SortedList(eventList,
                new PropertyComparator(sortProperty, true, true));
        eventList = sortedList;

        // Install this new event list configuration (sorting and filtering)
        installEventList(eventList);
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

    public List<User> searchUsers(final UsersSearchCriteria searchCriteria, final int firstResult, final int maxResults, final String sortProperty, final boolean ascending){
        final String searchTerm = searchCriteria != null? searchCriteria.getSearchTerm() : null;
        final List<User> users = userManager.search(searchTerm);
        if(StringUtils.isNotEmpty(sortProperty)) {
            log.debug(String.format("Sorting usersList by property='%s', ascending='%s'", sortProperty, ascending));
            Collections.sort(users, new PropertyComparator(sortProperty, true, ascending));
        }
        final int fromIndex = Math.min(firstResult, users.size());
        final int toIndex = Math.min(fromIndex + maxResults, users.size());
        log.debug(String.format("searchUsers(%d,%d) %d-%d [%d]", firstResult, maxResults, fromIndex, toIndex, users.size()));
        return users.subList(fromIndex, toIndex);
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

    @SuppressWarnings( "unchecked" )
    private List<Person> createSortedPersonList( Collection<Person> people )
    {
        final List<Person> list = new ArrayList<Person>(people);
        Collections.sort(list, new PropertyComparator("ssn", true, true));
        return list;
    }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

      // Construct the event list of all our data and layer on the sorting
      EventList rawList = GlazedLists.eventList(Arrays.asList(data));
      int initialSortColumn = getInitialSortColumn();
      if (initialSortColumn >= 0) {
        String sortProperty = getColumnPropertyNames()[initialSortColumn];
        baseList = new SortedList(rawList, new PropertyComparator(sortProperty, false, true));
      }
      else {
        baseList = new SortedList(rawList);
      }
    }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

        context.put(SELECTABLE_ITEMS_HOLDER_KEY, selectableItemsHolder);

        if( renderedProperty != null ) {
            context.put(RENDERER_KEY, new BeanPropertyValueListRenderer(renderedProperty));
            context.put(COMPARATOR_KEY, new PropertyComparator(renderedProperty, true, true));
        }

        return context;
    }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

    public Binding createBoundComboBox(String formProperty, Object selectableItems, String renderedProperty) {
        Map context = createContext(ComboBoxBinder.SELECTABLE_ITEMS_KEY, selectableItems);
        context.put(ComboBoxBinder.RENDERER_KEY, new BeanPropertyValueListRenderer(renderedProperty));
        context.put(ComboBoxBinder.EDITOR_KEY, new BeanPropertyEditorClosure(renderedProperty));
        context.put(ComboBoxBinder.COMPARATOR_KEY, new PropertyComparator(renderedProperty, true, true));
        return createBinding(JComboBox.class, formProperty, context);
    }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

            context.put(ListBinder.SELECTION_MODE_KEY, forceSelectMode);
        }
        context.put(ListBinder.SELECTABLE_ITEMS_KEY, selectableItems);
        if (renderedProperty != null) {
            context.put(ListBinder.RENDERER_KEY, new BeanPropertyValueListRenderer(renderedProperty));
            context.put(ListBinder.COMPARATOR_KEY, new PropertyComparator(renderedProperty, true, true));
        }
        return createBinding(JList.class, selectionFormProperty, context);
    }
View Full Code Here

Examples of org.springframework.beans.support.PropertyComparator

     * table.
     *
     * @param propertyName Name of the property on which to sort.
     */
    public void setSortProperty(String propertyName) {
        setSortComparator( new PropertyComparator( propertyName, true, true ) );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.