Package ca.odell.glazedlists

Examples of ca.odell.glazedlists.SortedList$ElementComparator


            eventList = new FilterList(eventList, matcher);
        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


        else {
            for (String key : keySet)
                entryList.add(database.getEntryById(key));
        }

        entries = new SortedList(entryList, new FieldComparatorStack(comparators));
    }
View Full Code Here

        else {
            for (String key : keySet)
                entryList.add(bibtex.getEntryById(key));
        }
       
        entries = new SortedList(entryList, new FieldComparatorStack(comparators));

    }
View Full Code Here

        comparators.add(new FieldComparator(sec, secD));
        comparators.add(new FieldComparator(ter, terD));
        comparators.add(new FieldComparator(BibtexFields.KEY_FIELD));
        // Use glazed lists to get a sorted view of the entries:
        BasicEventList entryList = new BasicEventList();
        SortedList sorter = new SortedList(entryList, new FieldComparatorStack<BibtexEntry>(comparators));

        if ((bes != null) && (bes.length > 0))
        for (int i=0; i<bes.length; i++) {
            sorter.add(bes[i]);
        }

            FieldFormatter ff = new LatexFieldFormatter();

            for (Iterator<BibtexEntry> i = sorter.iterator(); i.hasNext();)
            {
                be = (i.next());

        // Check if we must write the type definition for this
        // entry, as well. Our criterion is that all non-standard
View Full Code Here

            comparatorStack = new FieldComparatorStack<BibtexEntry>(comparators);
        }
        // Use glazed lists to get a sorted view of the entries:
        BasicEventList entryList = new BasicEventList();
        SortedList sorter = new SortedList(entryList, comparatorStack);

        if (keySet == null)
            keySet = database.getKeySet();

        if (keySet != null) {
            Iterator<String> i = keySet.iterator();

            for (; i.hasNext();) {
                sorter.add(database.getEntryById((i.next())));
            }
        }
        return sorter;
    }
View Full Code Here

            public int compare(Download o1, Download o2) {
                return o1.getUrl().getPath().toString().compareTo(o2.getUrl().getPath().toString());
            }
        };
        downloads = new ObservableElementList<Download>(
                GlazedLists.threadSafeList(new SortedList(new BasicEventList<Download>(), comp)),
                GlazedLists.beanConnector(Download.class));
        DAOFactory.setDB(DAOFactory.JAVADB);

        this.tasks = new ObservableElementList<TaskData>(
                GlazedLists.threadSafeList(new BasicEventList<TaskData>()),
View Full Code Here

            public int compare(PropertyEntry o1, PropertyEntry o2) {
                return o1.getKey().compareTo(o2.getKey());
            }
        };
        this.propertyList = new ObservableElementList<PropertyEntry>(
                GlazedLists.threadSafeList(new SortedList(new BasicEventList<PropertyEntry>(), comp)),
                GlazedLists.beanConnector(PropertyEntry.class));
        for (String s : Download.propertyNames) {
            PropertyEntry e = new PropertyEntry(s, getPropValue(s));
            d.addPropertyChangeListener(e);
            propertyList.add(e);
        }
        propertyModel = new EventTableModel<PropertyEntry>(propertyList, new String[]{PropertyEntry.PROP_KEY, PropertyEntry.PROP_VALUE}, new String[]{PropertyEntry.PROP_KEY, PropertyEntry.PROP_VALUE}, new boolean[]{false, false});

        this.extraList = new ObservableElementList<PropertyEntry>(
                GlazedLists.threadSafeList(new SortedList(new BasicEventList<PropertyEntry>(), comp)),
                GlazedLists.beanConnector(PropertyEntry.class));
        for (String s : d.getExtraProperties().keySet()) {
            PropertyEntry e = new PropertyEntry(s, d.getExtraProperties().get(s));
            d.addPropertyChangeListener(e);
            extraList.add(e);
View Full Code Here

    private ColumnPopupMenu columnMenu;
    private DownloadTableFormat downloadFormat;
    private TableComparatorChooser tableSorter;

    public MainWindow(MainWindowModel mainWindowModel, TaskManagerModel taskModel) {
        SortedList<Download> downloads = new SortedList(mainWindowModel.getDownloads());
        this.mainWindowModel = mainWindowModel;
        this.taskModel = taskModel;
        taskModel.addPropertyChangeListener(this);
        this.mainWindowModel.addPropertyChnageListener(this);
       
View Full Code Here

      // 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);
      }
    }
    return baseList;
  }
View Full Code Here

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

        // Install the sorter if configured
        SortedList sortedList = null;
        if( comparator != null || useSortedList()) {
            eventList = sortedList = new SortedList(eventList, comparator);
        }

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

TOP

Related Classes of ca.odell.glazedlists.SortedList$ElementComparator

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.