/** * Instantitates a predicate with the given compare class. * * @param compareValue the fixed class to compare the * adapter's column class against, must not be null * * @throws NullPointerException if the class is null. * */ public ColumnTypeHighlightPredicate(Class<?> compareValue) { this.clazz = Contract.asNotNull(compareValue, "compare class must not be null"); }
/** * Creates a new forwarding manager that forwards all calls to the delegate. * * @param delegate * the manager backing this {@code ForwardingRepaintManager} * @throws NullPointerException * if {@code delegate} is {@code null} */ public ForwardingRepaintManager(RepaintManager delegate) { this.delegate = Contract.asNotNull(delegate, "delegate is null"); }
/** * Instantitates a predicate with the given compare class. * * @param compareValue the fixed class to compare the * adapter's column class against, must not be null * * @throws NullPointerException if the class is null. * */ public ColumnTypeHighlightPredicate(Class<?> compareValue) { this.clazz = Contract.asNotNull(compareValue, "compare class must not be null"); }
/** * {@inheritDoc} */ @Override public boolean isSelected(final Date date) { Contract.asNotNull(date, "date must not be null"); return selectedDates.contains(date); }
/** * Instantiates a predicate which ands all given predicates. * @param predicate zero or more not null predicates to and * @throws NullPointerException if the predicate is null */ public AndHighlightPredicate(HighlightPredicate... predicate) { this.predicate = Arrays.asList(Contract.asNotNull(predicate, "predicate must not be null")); }
/** * Instantiates a predicate which ANDs all contained predicates. * @param list a collection with zero or more not null predicates to AND * @throws NullPointerException if the collection is null */ public AndHighlightPredicate(Collection<HighlightPredicate> list) { this.predicate = new ArrayList<HighlightPredicate>(Contract.asNotNull(list, "predicate list must not be null")); }
/** * {@inheritDoc} <p> */ @Override public void setSortOrderCycle(SortOrder... cycle) { Contract.asNotNull(cycle, "Elements of SortOrderCycle must not be null"); // JW: not safe enough? sortCycle = Arrays.asList(cycle); }
/** * Instantiates a predicate which ORs all given predicates. * @param predicate zero or more not null predicates to OR * @throws NullPointerException if the predicate is null */ public OrHighlightPredicate(HighlightPredicate... predicate) { this.predicate = Arrays.asList(Contract.asNotNull(predicate, "predicate must not be null")); }
RegexFilter(Pattern regex, int[] columns) { super(columns); if (regex == null) { // JW: Exception type changed to comply with swingx convention Contract.asNotNull(regex, "Pattern must be non-null"); // throw new IllegalArgumentException("Pattern must be non-null"); } matcher = regex.matcher(""); }
/** * Instantiates a predicate which ands all given predicates. * @param predicate zero or more not null predicates to and * @throws NullPointerException if the predicate is null */ public AndHighlightPredicate(HighlightPredicate... predicate) { this.predicate = Arrays.asList(Contract.asNotNull(predicate, "predicate must not be null")); }
/** * Instantiates a predicate which ORs all given predicates. * @param predicate zero or more not null predicates to OR * @throws NullPointerException if the predicate is null */ public OrHighlightPredicate(HighlightPredicate... predicate) { this.predicate = Arrays.asList(Contract.asNotNull(predicate, "predicate must not be null")); }
/** * Instantiates a predicate which ORs all contained predicates. * @param list a collection with zero or more not null predicates to OR * @throws NullPointerException if the collection is null */ public OrHighlightPredicate(Collection<HighlightPredicate> list) { this.predicate = new ArrayList<HighlightPredicate>(Contract.asNotNull(list, "predicate list must not be null")); }
/** * {@inheritDoc} */ @Override public boolean isSelected(final Date date) { Contract.asNotNull(date, "date must not be null"); return selectedDates.contains(date); }
/** * {@inheritDoc} <p> * * Implemented to return the start of the day which contains the date. */ @Override public Date getNormalizedDate(Date date) { Contract.asNotNull(date, "date must not be null"); return startOfDay(date); }
/** * {@inheritDoc} */ @Override public boolean isSelected(Date date) { Contract.asNotNull(date, "date must not be null"); if (isSelectionEmpty()) return false; return isSameDay(selectedDates.first(), date); }
/** * {@inheritDoc} */ public boolean isSelected(Date date) { Contract.asNotNull(date, "date must not be null"); if (isSelectionEmpty()) return false; return isSameDay(selectedDates.first(), date); }
private void addHighlighterSilently(Highlighter highlighter, boolean prepend) { Contract.asNotNull(highlighter, "Highlighter must not be null"); if (prepend) { highlighters.add(0, highlighter); } else { highlighters.add(highlighters.size(), highlighter); } updateUI(highlighter); highlighter.addChangeListener(getHighlighterChangeListener()); }
/** * {@inheritDoc} */ @Override public void removeSelectionInterval(Date startDate, Date endDate) { Contract.asNotNull(startDate, "date must not be null"); if (isSelectionEmpty()) return; if (isSelectionInInterval(startDate, endDate)) { selectedDates.clear(); fireValueChanged(EventType.DATES_REMOVED); } }
/** * {@inheritDoc} */ public void removeSelectionInterval(Date startDate, Date endDate) { Contract.asNotNull(startDate, "date must not be null"); if (isSelectionEmpty()) return; if (isSelectionInInterval(startDate, endDate)) { selectedDates.clear(); fireValueChanged(EventType.DATES_REMOVED); } }