本文整理汇总了Java中ca.odell.glazedlists.EventList.addListEventListener方法的典型用法代码示例。如果您正苦于以下问题:Java EventList.addListEventListener方法的具体用法?Java EventList.addListEventListener怎么用?Java EventList.addListEventListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca.odell.glazedlists.EventList
的用法示例。
在下文中一共展示了EventList.addListEventListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FilterControl
import ca.odell.glazedlists.EventList; //导入方法依赖的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>();
}
示例2: GlyphPropertyEventList
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
/**
* Instantiates a new GlyphPropertyEventList.
*
* @param source the source glyph list
* @param propertySelector the property selector
*/
public GlyphPropertyEventList(EventList<GlyphDefinition> source,
PropertySelector propertySelector) {
super(source);
this.propertySelector = propertySelector;
source.addListEventListener(this);
}
示例3: ObservableEventList
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
/**
* Creates a {@link ObservableEventList} on the specified source event list.
*/
public ObservableEventList(EventList source) {
super( source );
// listen for changes to the source list
source.addListEventListener(this);
}
示例4: installListeners
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
public void installListeners(EventList<StoredSmtpMessage> filterList, final EventList<StoredSmtpMessage> baseList)
{
filterList.addListEventListener(new ListEventListener<StoredSmtpMessage>() {
public void listChanged(ListEvent<StoredSmtpMessage> listChanges)
{
baseList.getReadWriteLock().readLock().lock();
try
{
if (!listChanges.isReordering() && lastCallCount != baseList.size())
updateMessageCounts(baseList);
} finally
{
baseList.getReadWriteLock().readLock().unlock();
}
}
});
baseList.addListEventListener(new ListEventListener<StoredSmtpMessage>() {
public void listChanged(ListEvent<StoredSmtpMessage> evt)
{
boolean notEmpty = !baseList.isEmpty();
clearQueueToolItem.setEnabled(notEmpty);
exportAsMailItem.setEnabled(notEmpty);
exportAsMailBoxItem.setEnabled(notEmpty);
}
});
}
示例5: buildFilterList
import ca.odell.glazedlists.EventList; //导入方法依赖的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();
}
}
示例6: BatchEventList
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
public BatchEventList(EventList<S> source)
{
super(source);
source.addListEventListener(this);
}
示例7: EventsTreeModel
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
public EventsTreeModel(final EventList<LoadProfileEntity> loadProfileEnities) {
this.loadProfileEnities = loadProfileEnities;
loadProfileEnities.addListEventListener(this);
}