Package ca.odell.glazedlists

Examples of ca.odell.glazedlists.EventList


        public void listChanged(ListEvent<String> listChanges) {

            List<String> addLinks = new ArrayList<String>();
            List<String> removeLinks = new ArrayList<String>();

            EventList changeList = listChanges.getSourceList();
            while (listChanges.next()) {
                int sourceIndex = listChanges.getIndex();
                int changeType = listChanges.getType();

                switch (changeType) {
View Full Code Here


        public void listChanged(ListEvent<String> listChanges) {

            List<String> addLocations = new ArrayList<>();
            List<String> removeLocations = new ArrayList<>();

            EventList changeList = listChanges.getSourceList();
            while (listChanges.next()) {
                int sourceIndex = listChanges.getIndex();
                int changeType = listChanges.getType();

                switch (changeType) {
View Full Code Here

      Object[] data = getInitialData();
      if (logger.isDebugEnabled()) {
        logger.debug("Table data: got " + data.length + " entries");
      }
      // 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));
      }
View Full Code Here

    objectPluralName = getMessage(modelId + ".objectName.plural");
  }

  protected JComponent createControl() {
    // Contstruct the table model and table to display the data
    EventList finalEventList = getFinalEventList();
    model = createTableModel(finalEventList);

    JTable table = getComponentFactory().createTable(model);
    table.setSelectionModel(new EventSelectionModel(finalEventList));
    table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
View Full Code Here

            // Construct and install our filtering list. This filter will allow the user
            // to simply type data into the txtFilter (JTextField). With the configuration
            // setup below, the text entered by the user will be matched against the values
            // in the lastName and address.address1 properties of the contacts in the table.
            // The GlazedLists filtered lists is used to accomplish this.
            EventList baseList = contactTable.getBaseEventList();
            TextFilterator filterator = GlazedLists.textFilterator(new String[]{"lastName", "address.address1"});
            FilterList filterList = new FilterList(baseList, new TextComponentMatcherEditor(filterField, filterator));

            // Install the fully constructed (layered) list into the table
            contactTable.setFinalEventList(filterList);
View Full Code Here

        return selectField.getControl();
    }

    protected ApplicationDialog createSelectionDialog() {
        EventList eventList = createEventList(selectableItemsHolder);
        final ValueModel2EventListBridge itemRefresher = new ValueModel2EventListBridge(selectableItemsHolder,
                eventList, true);

        ListSelectionDialog selectionDialog = null;
        if (filtered) {
View Full Code Here

        return selectionDialog;
    }

    private EventList createEventList(ValueModel selectableItemsHolder) {
        EventList eventList = GlazedLists.eventList(Collections.emptyList());

        if (comparator != null) {
            eventList = new SortedList(eventList, comparator);
        }
View Full Code Here

*
* @author Peter De Bruycker
*/
public class ValueModel2EventListBridgeTests extends TestCase {
    public void testValueHolderMustContainCollection() {
        EventList eventList = new BasicEventList();

        ValueModel valueModel = new ValueHolder("test");

        try {
            new ValueModel2EventListBridge(valueModel, eventList);
View Full Code Here

    public void testAutomaticSynchronization() {
        List list1 = Arrays.asList(new String[] { "item 1", "item2", "item3" });
        List list2 = Arrays.asList(new String[] { "item 4", "item5", "item6" });

        EventList eventList = new BasicEventList();
        ValueModel valueModel = new ValueHolder(list1);

        ValueModel2EventListBridge bridge = new ValueModel2EventListBridge(valueModel, eventList);
        assertEquals("auto sync: data copied in constructor", list1, eventList);
View Full Code Here

    public void testManualSynchronization() {
        List list1 = Arrays.asList(new String[] { "item 1", "item2", "item3" });
        List list2 = Arrays.asList(new String[] { "item 4", "item5", "item6" });

        EventList eventList = new BasicEventList();
        ValueModel valueModel = new ValueHolder(list1);

        ValueModel2EventListBridge bridge = new ValueModel2EventListBridge(valueModel, eventList, true);
        assertTrue("manual sync: data not copied in constructor", eventList.isEmpty());

        bridge.synchronize();
        assertEquals("sync copies data", list1, eventList);

        valueModel.setValue(list2);
View Full Code Here

TOP

Related Classes of ca.odell.glazedlists.EventList

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.