All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.publicobject.issuesbrowser.swing.ModificationDateMatcherEditor Maven / Gradle / Ivy

The newest version!
package com.publicobject.issuesbrowser.swing;

import ca.odell.glazedlists.Filterator;
import ca.odell.glazedlists.matchers.MatcherEditor;
import ca.odell.glazedlists.nachocalendar.NachoDateRangeMatcherEditor;
import com.publicobject.issuesbrowser.Issue;

import java.util.Date;
import java.util.List;

/**
 * This FilterComponent allows the user to specify a range of dates which
 * filters the Issues by their delta date. Only Issues modified within the
 * specified range are considered a match.
 *
 * @author James Lemieux
 */
public class ModificationDateMatcherEditor extends NachoDateRangeMatcherEditor implements FilterComponent {
    /** A Filterator which extracts the delta date from Issue objects. */
    private static final Filterator ISSUE_DELTA_DATE_FILTERATOR = new IssueDeltaDateFilterator();

    public ModificationDateMatcherEditor() {
        super(ModificationDateMatcherEditor.ISSUE_DELTA_DATE_FILTERATOR);
    }

    @Override
    public String toString() {
        return "Modification Date";
    }

    public MatcherEditor getMatcherEditor() {
        return this;
    }

    /**
     * This Filterator extracts the delta date from each Issue object.
     */
    private static final class IssueDeltaDateFilterator implements Filterator {
        public void getFilterValues(List baseList, Issue element) {
            baseList.add(element.getDeltaTimestamp());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy