本文整理汇总了Java中ca.odell.glazedlists.FilterList类的典型用法代码示例。如果您正苦于以下问题:Java FilterList类的具体用法?Java FilterList怎么用?Java FilterList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FilterList类属于ca.odell.glazedlists包,在下文中一共展示了FilterList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MainTableDataModel
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public MainTableDataModel(BibDatabaseContext context) {
List<BibEntry> entries = context.getDatabase().getEntries();
EventList<BibEntry> initialEventList = new BasicEventList<>();
initialEventList.addAll(entries);
listSynchronizer = new ListSynchronizer(initialEventList);
// This SortedList has a Comparator controlled by the TableComparatorChooser
// we are going to install, which responds to user sorting selections:
sortedForUserDefinedTableColumnSorting = new SortedList<>(initialEventList, null);
// This SortedList applies afterwards, and floats marked entries:
sortedForMarkingSearchGrouping = new SortedList<>(sortedForUserDefinedTableColumnSorting, null);
FilterList<BibEntry> groupFilterList = new FilterList<>(sortedForMarkingSearchGrouping, EverythingMatcher.INSTANCE);
filterGroupToggle = new StartStopListFilterAction(groupFilterList, GroupMatcher.INSTANCE,
EverythingMatcher.INSTANCE);
FilterList<BibEntry> searchFilterList = new FilterList<>(groupFilterList, EverythingMatcher.INSTANCE);
filterSearchToggle = new StartStopListFilterAction(searchFilterList, SearchMatcher.INSTANCE,
EverythingMatcher.INSTANCE);
finalList = searchFilterList;
}
示例2: FilterControl
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
protected FilterControl(final JFrame jFrame, final String name, final EventList<E> eventList, final EventList<E> exportEventList, final FilterList<E> filterList, final Map<String, List<Filter>> filters, final Map<String, List<Filter>> defaultFilters) {
this.name = name;
this.eventList = eventList;
this.exportEventList = exportEventList;
this.filterList = filterList;
eventList.addListEventListener(new ListEventListener<E>() {
@Override @SuppressWarnings("deprecation")
public void listChanged(ListEvent<E> listChanges) {
try {
eventList.getReadWriteLock().readLock().lock();
List<E> delete = new ArrayList<E>();
List<E> update = new ArrayList<E>();
while(listChanges.next()) {
switch (listChanges.getType()) {
case ListEvent.DELETE:
addSafe(delete, listChanges.getOldValue());
break;
case ListEvent.UPDATE:
addSafe(eventList, update, listChanges.getIndex());
break;
}
}
cacheDelete(delete);
cacheUpdate(update);
} finally {
eventList.getReadWriteLock().readLock().unlock();
}
}
});
this.filters = filters;
this.defaultFilters = defaultFilters;
ListenerClass listener = new ListenerClass();
filterList.addListEventListener(listener);
gui = new FilterGui<E>(jFrame, this);
cache = new HashMap<E, String>();
}
示例3: StartStopListFilterAction
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
private StartStopListFilterAction(FilterList<BibEntry> list, Matcher<BibEntry> active, Matcher<BibEntry> inactive) {
this.list = list;
this.active = active;
this.inactive = inactive;
list.setMatcher(inactive);
}
示例4: GlyphSelectionChangeHandler
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
/**
* Instantiates a new GlyphSelectionChangeHandler.
* @param infoLabel The panel containing the glyph info in grid view
* @param sortedList The sorted glyph list
* @param filterList The filtered glyph list
* @param actions The actions affected by selection changes
*/
public GlyphSelectionChangeHandler(JLabel infoLabel,
SortedList<GlyphDefinition> sortedList,
FilterList<GlyphDefinition> filterList, Set<Action> actions) {
this.infoLabel = infoLabel;
this.sortedList = sortedList;
this.filterList = filterList;
this.actions = actions;
}
示例5: RemoveAction
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
/**
* Instantiates a new RemoveAction.
*
* @param panel The container tab panel
* @param listener the property change listener to be added to this action
* @param glyphList the glyph list model
* @param filterList the filter list model
* @param list the list component
*/
public RemoveAction(TabPanel panel, PropertyChangeListener listener,
EventList<GlyphDefinition> glyphList,
FilterList<GlyphDefinition> filterList, GlyphGrid list) {
super(CLASS_NAME, "/images/oxygen/Remove16.png", "ctrl D");
this.addPropertyChangeListener(listener);
this.glyphList = glyphList;
this.filterList = filterList;
this.list = list;
bindAcceleratorToComponent(this, panel);
}
示例6: buildFilterList
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public FilterList<StoredSmtpMessage> buildFilterList(final EventList<StoredSmtpMessage> eventList)
{
eventList.addListEventListener(new ListEventListener<StoredSmtpMessage>() {
public void listChanged(ListEvent<StoredSmtpMessage> listChanges)
{
if (listChanges.isReordering())
return;
tree.setRedraw(false);
while (listChanges.next())
{
if (listChanges.getType() == ListEvent.INSERT || listChanges.getType() == ListEvent.UPDATE)
{
String host = eventList.get(listChanges.getIndex()).getMessageHost();
addNodeIfNewHost(host);
}
}
root.setExpanded(true);
tree.setRedraw(true);
}
});
eventList.getReadWriteLock().readLock().lock();
try
{
editor = new HostMatcherEditor(tree);
return new FilterList<StoredSmtpMessage>(eventList, editor);
} finally
{
eventList.getReadWriteLock().readLock().unlock();
}
}
示例7: BodyLayerStack
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public BodyLayerStack(List<T> values,
IColumnPropertyAccessor<T> columnPropertyAccessor,
ColumnGroupModel... columnGroupModel) {
// wrapping of the list to show into GlazedLists
// see http://publicobject.com/glazedlists/ for further information
EventList<T> eventList = GlazedLists.eventList(values);
TransformedList<T, T> rowObjectsGlazedList = GlazedLists.threadSafeList(eventList);
// use the SortedList constructor with 'null' for the Comparator
// because the Comparator will be set by configuration
this.sortedList = new SortedList<T>(rowObjectsGlazedList, null);
// wrap the SortedList with the FilterList
this.filterList = new FilterList<T>(getSortedList());
this.bodyDataProvider =
new ListDataProvider<T>(this.filterList, columnPropertyAccessor);
DataLayer bodyDataLayer = new DataLayer(this.bodyDataProvider);
// layer for event handling of GlazedLists and PropertyChanges
GlazedListsEventLayer<T> glazedListsEventLayer =
new GlazedListsEventLayer<T>(bodyDataLayer, this.filterList);
this.columnReorderLayer = new ColumnReorderLayer(glazedListsEventLayer);
this.columnGroupReorderLayer =
new ColumnGroupReorderLayer(this.columnReorderLayer, columnGroupModel[columnGroupModel.length - 1]);
this.columnHideShowLayer = new ColumnHideShowLayer(this.columnGroupReorderLayer);
this.columnGroupExpandCollapseLayer =
new ColumnGroupExpandCollapseLayer(this.columnHideShowLayer, columnGroupModel);
this.selectionLayer = new SelectionLayer(this.columnGroupExpandCollapseLayer);
this.viewportLayer = new ViewportLayer(this.selectionLayer);
final FreezeLayer freezeLayer = new FreezeLayer(this.selectionLayer);
final CompositeFreezeLayer compositeFreezeLayer =
new CompositeFreezeLayer(freezeLayer, this.viewportLayer, this.selectionLayer);
setUnderlyingLayer(compositeFreezeLayer);
}
示例8: getFilterList
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public FilterList<E> getFilterList() {
return filterList;
}
示例9: TransactionsFilterControl
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public TransactionsFilterControl(EnumTableFormatAdaptor<TransactionTableFormat, MyTransaction> tableFormat, JFrame jFrame, EventList<MyTransaction> eventList, EventList<MyTransaction> exportEventList, FilterList<MyTransaction> filterList, Map<String, List<Filter>> filters, Map<String, List<Filter>> defaultFilters) {
super(jFrame, NAME, eventList, exportEventList, filterList, filters, defaultFilters);
this.tableFormat = tableFormat;
}
示例10: ContractsFilterControl
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public ContractsFilterControl(EnumTableFormatAdaptor<ContractsTableFormat, MyContractItem> tableFormat, JFrame jFrame, EventList<MyContractItem> eventList, EventList<MyContractItem> exportEventList, FilterList<MyContractItem> filterList, Map<String, List<Filter>> filters) {
super(jFrame, NAME, eventList, exportEventList, filterList, filters);
this.tableFormat = tableFormat;
}
示例11: AssetFilterControl
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public AssetFilterControl(JFrame jFrame, EventList<TreeAsset> eventList, EventList<TreeAsset> exportEventList, FilterList<TreeAsset> filterList, Map<String, List<Filter>> filters) {
super(jFrame, NAME, eventList, exportEventList, filterList, filters);
}
示例12: ReprocessedFilterControl
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public ReprocessedFilterControl(EnumTableFormatAdaptor<ReprocessedTableFormat, ReprocessedInterface> tableFormat, JFrame jFrame, EventList<ReprocessedInterface> eventList, EventList<ReprocessedInterface> exportEventList, FilterList<ReprocessedInterface> filterList, Map<String, List<Filter>> filters) {
super(jFrame, NAME, eventList, exportEventList, filterList, filters);
this.tableFormat = tableFormat;
}
示例13: MarketOrdersTab
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public MarketOrdersTab(final Program program) {
super(program, TabsOrders.get().market(), Images.TOOL_MARKET_ORDERS.getIcon(), true);
ListenerClass listener = new ListenerClass();
//Table Format
tableFormat = new EnumTableFormatAdaptor<MarketTableFormat, MyMarketOrder>(MarketTableFormat.class);
//Backend
eventList = program.getProfileData().getMarketOrdersEventList();
//Sorting (per column)
eventList.getReadWriteLock().readLock().lock();
SortedList<MyMarketOrder> sortedList = new SortedList<MyMarketOrder>(eventList);
eventList.getReadWriteLock().readLock().unlock();
//Filter
eventList.getReadWriteLock().readLock().lock();
filterList = new FilterList<MyMarketOrder>(sortedList);
eventList.getReadWriteLock().readLock().unlock();
filterList.addListEventListener(listener);
//Table Model
tableModel = EventModels.createTableModel(filterList, tableFormat);
//Table
jTable = new JMarketOrdersTable(program, tableModel);
jTable.setCellSelectionEnabled(true);
PaddingTableCellRenderer.install(jTable, 1);
//Sorting
TableComparatorChooser.install(jTable, sortedList, TableComparatorChooser.MULTIPLE_COLUMN_MOUSE, tableFormat);
//Selection Model
selectionModel = EventModels.createSelectionModel(filterList);
selectionModel.setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION_DEFENSIVE);
jTable.setSelectionModel(selectionModel);
//Listeners
installTable(jTable, NAME);
//Scroll Panels
JScrollPane jTableScroll = new JScrollPane(jTable);
//Table Filter
Map<String, List<Filter>> defaultFilters = new HashMap<String, List<Filter>>();
List<Filter> filter;
filter = new ArrayList<Filter>();
filter.add(new Filter(LogicType.AND, MarketTableFormat.ORDER_TYPE, CompareType.EQUALS, TabsOrders.get().buy()));
filter.add(new Filter(LogicType.AND, MarketTableFormat.STATUS, CompareType.EQUALS, TabsOrders.get().statusActive()));
defaultFilters.put(TabsOrders.get().activeBuyOrders(), filter);
filter = new ArrayList<Filter>();
filter.add(new Filter(LogicType.AND, MarketTableFormat.ORDER_TYPE, CompareType.EQUALS, TabsOrders.get().sell()));
filter.add(new Filter(LogicType.AND, MarketTableFormat.STATUS, CompareType.EQUALS, TabsOrders.get().statusActive()));
defaultFilters.put(TabsOrders.get().activeSellOrders(), filter);
filterControl = new MarketOrdersFilterControl(
tableFormat,
program.getMainWindow().getFrame(),
eventList,
sortedList,
filterList,
Settings.get().getTableFilters(NAME),
defaultFilters
);
//Menu
installMenu(program, new OrdersTableMenu(), jTable, MyMarketOrder.class);
jSellOrdersTotal = StatusPanel.createLabel(TabsOrders.get().totalSellOrders(), Images.ORDERS_SELL.getIcon());
this.addStatusbarLabel(jSellOrdersTotal);
jBuyOrdersTotal = StatusPanel.createLabel(TabsOrders.get().totalBuyOrders(), Images.ORDERS_BUY.getIcon());
this.addStatusbarLabel(jBuyOrdersTotal);
jEscrowTotal = StatusPanel.createLabel(TabsOrders.get().totalEscrow(), Images.ORDERS_ESCROW.getIcon());
this.addStatusbarLabel(jEscrowTotal);
jToCoverTotal = StatusPanel.createLabel(TabsOrders.get().totalToCover(), Images.ORDERS_TO_COVER.getIcon());
this.addStatusbarLabel(jToCoverTotal);
layout.setHorizontalGroup(
layout.createParallelGroup()
.addComponent(filterControl.getPanel())
.addComponent(jTableScroll, 0, 0, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createSequentialGroup()
.addComponent(filterControl.getPanel())
.addComponent(jTableScroll, 0, 0, Short.MAX_VALUE)
);
}
示例14: MarketOrdersFilterControl
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
public MarketOrdersFilterControl(EnumTableFormatAdaptor<MarketTableFormat, MyMarketOrder> tableFormat, JFrame jFrame, EventList<MyMarketOrder> eventList, EventList<MyMarketOrder> exportEventList, FilterList<MyMarketOrder> filterList, Map<String, List<Filter>> filters, Map<String, List<Filter>> defaultFilters) {
super(jFrame, NAME, eventList, exportEventList, filterList, filters, defaultFilters);
this.tableFormat = tableFormat;
}
示例15: setLocationType
import ca.odell.glazedlists.FilterList; //导入依赖的package包/类
private void setLocationType(LocationType locationType) {
this.locationType = locationType;
if (locationType == LocationType.STATION) {
jLocationType.setIcon(Images.LOC_STATION.getIcon());
jLocationType.setToolTipText(TabsStockpile.get().station());
jPanel.setBorder(BorderFactory.createTitledBorder(TabsStockpile.get().station()));
try {
stations.getReadWriteLock().readLock().lock();
filterList = new FilterList<MyLocation>(stations);
} finally {
stations.getReadWriteLock().readLock().unlock();
}
jStation.setSelected(true);
} else if (locationType == LocationType.SYSTEM) {
jLocationType.setIcon(Images.LOC_SYSTEM.getIcon());
jLocationType.setToolTipText(TabsStockpile.get().system());
jPanel.setBorder(BorderFactory.createTitledBorder(TabsStockpile.get().system()));
try {
systems.getReadWriteLock().readLock().lock();
filterList = new FilterList<MyLocation>(systems);
} finally {
systems.getReadWriteLock().readLock().unlock();
}
jSystem.setSelected(true);
} else if (locationType == LocationType.REGION) {
jLocationType.setIcon(Images.LOC_REGION.getIcon());
jLocationType.setToolTipText(TabsStockpile.get().region());
jPanel.setBorder(BorderFactory.createTitledBorder(TabsStockpile.get().region()));
try {
regions.getReadWriteLock().readLock().lock();
filterList = new FilterList<MyLocation>(regions);
} finally {
regions.getReadWriteLock().readLock().unlock();
}
jRegion.setSelected(true);
} else {
jLocationType.setIcon(Images.LOC_LOCATIONS.getIcon());
jLocationType.setToolTipText(TabsStockpile.get().universe());
jPanel.setBorder(BorderFactory.createTitledBorder(TabsStockpile.get().universe()));
EventList<MyLocation> eventList = new EventListManager<MyLocation>().create();
try {
eventList.getReadWriteLock().readLock().lock();
filterList = new FilterList<MyLocation>(eventList);
} finally {
eventList.getReadWriteLock().readLock().unlock();
}
jUniverse.setSelected(true);
}
if (autoComplete != null) { //Remove old
jLocation.removeItemListener(listener);
autoComplete.uninstall();
autoComplete = null;
}
if (locationType != LocationType.UNIVERSE) {
jLocation.setEnabled(true);
autoComplete = AutoCompleteSupport.install(jLocation, EventModels.createSwingThreadProxyList(filterList), new LocationsFilterator());
autoComplete.setStrict(true);
autoComplete.setCorrectsCase(true);
jLocation.addItemListener(listener); //Must be added after AutoCompleteSupport
} else {
jLocation.setEnabled(false);
jLocation.getModel().setSelectedItem(TabsStockpile.get().universe());
}
}