com.publicobject.issuesbrowser.swing.ModificationDateMatcherEditor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glazedlists_java15 Show documentation
Show all versions of glazedlists_java15 Show documentation
Event-driven lists for dynamically filtered and sorted tables
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());
}
}
}