public void toggleSortOrder(int column, Comparator comparator) { Sorter currentSorter = getSorter(); if ((currentSorter != null) && (currentSorter.getColumnIndex() == column)) { // JW: think about logic - need to update comparator? currentSorter.toggle(); } else { setSorter(createDefaultSorter(new SortKey(SortOrder.ASCENDING, column, comparator))); } }
/** * Creates and returns a Highlighter which highlights * with alternate background. The first is Color.WHITE, the second * with the color depending on LF. * * @return a Highlighter striping every second row background. */ public static Highlighter createAlternateStriping() { ColorHighlighter first = new ColorHighlighter(HighlightPredicate.EVEN, Color.WHITE, null); ColorHighlighter hl = new UIColorHighlighter(HighlightPredicate.ODD); return new CompoundHighlighter(first, hl); }
public void setFilters(FilterPipeline pipeline) { FilterPipeline old = this.pipeline; if (old != null) { old.removePipelineListener(pipelineListener); } this.pipeline = pipeline; if (pipeline != null) { pipeline.addPipelineListener(getPipelineListener()); } mapTowardsView(); }
/** * Creates and returns a Highlighter which highlights * with alternate background. the first Color.WHITE, the second * with the color depending on LF. * * @param rowsPerGroup the number of rows in a group * @return a Highlighter striping every second row group background. */ public static Highlighter createAlternateStriping(int rowsPerGroup) { HighlightPredicate predicate = new RowGroupHighlightPredicate(rowsPerGroup); ColorHighlighter first = new ColorHighlighter(new NotHighlightPredicate(predicate), Color.WHITE, null); ColorHighlighter hl = new UIColorHighlighter(predicate); return new CompoundHighlighter(first, hl); }
public Component highlight(final Component component, final ComponentAdapter adapter) { if (_evaluatedColumnsPredicate.isHighlighted(component, adapter)) { return _colorHighlighter.highlight(component, adapter); } return component; }
public void setFilters(FilterPipeline pipeline) { FilterPipeline old = this.pipeline; if (old != null) { old.removePipelineListener(pipelineListener); } this.pipeline = pipeline; if (pipeline != null) { pipeline.addPipelineListener(getPipelineListener()); } restoreSelection(); }
/** * @param filter * @return returns the unfiltered data adapter size or 0 if unassigned. */ int getInputSize(Filter filter) { Filter previous = previous(filter); if (previous != null) { return previous.getSize(); } // fixed issue #64-swingx - removed precondition... (was: isAssigned()) return getInputSize(); }
public SortOrder getSortOrder(int column) { Sorter sorter = getSorter(); if ((sorter == null) || (sorter.getColumnIndex() != column)) { return SortOrder.UNSORTED; } return sorter.getSortOrder(); }
/** * creates a Sorter initialized with sortKey * @param sortKey the properties to use * @return <code>Sorter</code> initialized with the specified <code>sortKey</code> */ protected Sorter createDefaultSorter(SortKey sortKey) { Sorter sorter = createDefaultSorter(); sorter.setSortKey(sortKey); return sorter; }
public boolean isCellEditable(int row, int column) { // JW: this impl relies on the fact that there's always the // identity filter installed // should use adapter if assigned and no filter Filter last = last(); return (last == null) ? false : last.isCellEditable(row, column); }
public String getColumnName() { if (adapter == null) { return "Column " + column; // in model coordinates :-( } else { return adapter.getColumnName(getColumnIndex()); } }
/** * Returns the number of records of this filter's input ("model"). * * @return the number of records of this filter's input ("model"). */ protected int getInputSize() { return pipeline == null ? adapter == null ? 0 : adapter.getRowCount() : pipeline.getInputSize(this); }
public void setValueAt(Object aValue, int row, int column) { // JW: this impl relies on the fact that there's always the // identity filter installed // should use adapter if assigned and no filter Filter last = last(); if (last != null) { last.setValueAt(aValue, row, column); } }
@Override protected void refresh(boolean reset) { refreshCollator(); super.refresh(reset); } /**
/** * returns the unfiltered data adapter size or 0 if unassigned. * * @return the unfiltered data adapter size or 0 if unassigned */ public int getInputSize() { return isAssigned() ? adapter.getRowCount() : 0; }
/** * Creates and returns a Highlighter which highlights * with alternate background. The first is Color.WHITE, the second * with the color depending on LF. * * @return a Highlighter striping every second row background. */ public static Highlighter createAlternateStriping() { ColorHighlighter first = new ColorHighlighter(HighlightPredicate.EVEN, Color.WHITE, null); ColorHighlighter hl = new UIColorHighlighter(HighlightPredicate.ODD); return new CompoundHighlighter(first, hl); }
/** * Creates and returns a Highlighter which highlights * with alternate background. the first Color.WHITE, the second * with the color depending on LF. * * @param rowsPerGroup the number of rows in a group * @return a Highlighter striping every second row group background. */ public static Highlighter createAlternateStriping(int rowsPerGroup) { HighlightPredicate predicate = new RowGroupHighlightPredicate(rowsPerGroup); ColorHighlighter first = new ColorHighlighter(new NotHighlightPredicate(predicate), Color.WHITE, null); ColorHighlighter hl = new UIColorHighlighter(predicate); return new CompoundHighlighter(first, hl); }
/** * Creates and returns a Highlighter which highlights * with alternate background. The first is Color.WHITE, the second * with the color depending on LF. * * @return a Highlighter striping every second row background. */ public static Highlighter createAlternateStriping() { ColorHighlighter first = new ColorHighlighter(HighlightPredicate.EVEN, Color.WHITE, null); ColorHighlighter hl = new UIColorHighlighter(HighlightPredicate.ODD); return new CompoundHighlighter(first, hl); }
/** * Creates and returns a Highlighter which highlights * with alternate background. The first is Color.WHITE, the second * with the color depending on LF. * * @return a Highlighter striping every second row background. */ public static Highlighter createAlternateStriping() { ColorHighlighter first = new ColorHighlighter(HighlightPredicate.EVEN, Color.WHITE, null); ColorHighlighter hl = new UIColorHighlighter(HighlightPredicate.ODD); return new CompoundHighlighter(first, hl); }
/** * Creates and returns a Highlighter which highlights * with alternate background. The first is Color.WHITE, the second * with the color depending on LF. * * @return a Highlighter striping every second row background. */ public static Highlighter createAlternateStriping() { ColorHighlighter first = new ColorHighlighter(HighlightPredicate.EVEN, Color.WHITE, null); ColorHighlighter hl = new UIColorHighlighter(HighlightPredicate.ODD); return new CompoundHighlighter(first, hl); }