本文整理汇总了Java中ca.odell.glazedlists.event.ListEventListener类的典型用法代码示例。如果您正苦于以下问题:Java ListEventListener类的具体用法?Java ListEventListener怎么用?Java ListEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListEventListener类属于ca.odell.glazedlists.event包,在下文中一共展示了ListEventListener类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VizListComponent
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的package包/类
/**
* A protected constructor inherited from TransformedList.
*
* @param source
* The source list used by the TransformedList.
*/
protected VizListComponent(EventList<T> source) {
super(source);
// Create the logger
logger = LoggerFactory.getLogger(getClass());
// Store the source list locally too so that JAXB gets it
jaxbSourceList = (BasicEventList<T>) source;
// Set it all up
idList = new BasicEventList<String>();
idList.add("1");
idList.add("ICE Object");
idList.add("ICE Object");
// Setup the listener map
listenerMap = new HashMap<IVizUpdateableListener, ListEventListener<Object>>();
}
示例2: setAdditionalListeners
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的package包/类
/**
* Sets the additional listeners.
*/
private void setAdditionalListeners() {
selectionModel
.addListSelectionListener(new GlyphSelectionChangeHandler(tabPanel
.getInfoLabel(), sortedList, filterList,
selectionDependentActions));
glyphList
.addListEventListener(new ListEventListener<GlyphDefinition>() {
@Override
public void listChanged(ListEvent<GlyphDefinition> e) {
boolean enableActions = !listInSync;
for (Action a : syncDependentActions) {
a.setEnabled(enableActions);
}
}
});
}
示例3: FilterControl
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的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>();
}
示例4: unregister
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的package包/类
/**
* @see IUpdateable#unregister(IUpdateableListener listener)
*/
@Override
public void unregister(IVizUpdateableListener listener) {
// Pull the listener from the map
ListEventListener<Object> glazedListener = listenerMap.get(listener);
// Unregister it from the lists
source.removeListEventListener(glazedListener);
idList.removeListEventListener(glazedListener);
// Remove the listener from the map
listenerMap.remove(listener);
}
示例5: addListEventListener
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的package包/类
/**
* Registers the specified listener to receive change updates for this list.
* <p>
* ListComponent also registers the listener to the underlying source list.
* Effectively, this method can be used to register glazed list listeners.
* </p>
*/
@Override
public void addListEventListener(
ListEventListener<? super T> listChangeListener) {
super.addListEventListener(listChangeListener);
// Add the listener to the TransformedList's source EventList.
super.source.addListEventListener(listChangeListener);
}
示例6: removeListEventListener
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的package包/类
/**
* Removes the specified listener from receiving change updates for this
* list.
* <p>
* ListComponent also removes the listener from the underlying source list.
* Effectively, this method can be used to unregister glazed list listeners.
* </p>
*/
@Override
public void removeListEventListener(
ListEventListener<? super T> listChangeListener) {
super.removeListEventListener(listChangeListener);
// Remove the listener from the TransformedList's source EventList.
super.source.removeListEventListener(listChangeListener);
}
示例7: createCountLabel
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的package包/类
private JLabel createCountLabel()
{
final JLabel label = new JLabel("");
setTextForListSummaryLabel(label);
shownList.addListEventListener(new ListEventListener<Object>()
{
public void listChanged(ListEvent<Object> evt)
{
if (!evt.isReordering())
{
setTextForListSummaryLabel(label);
}
}
});
theTable.getSelectionModel().addListSelectionListener(new ListSelectionListener()
{
public void valueChanged(ListSelectionEvent e)
{
if (!e.getValueIsAdjusting())
{
setTextForListSummaryLabel(label);
}
}
});
return label;
}
示例8: installListeners
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的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);
}
});
}
示例9: buildFilterList
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的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();
}
}
示例10: addSelectionListener
import ca.odell.glazedlists.event.ListEventListener; //导入依赖的package包/类
public void addSelectionListener(ListEventListener<BibEntry> listener) {
getSelected().addListEventListener(listener);
}