当前位置: 首页>>代码示例>>Java>>正文


Java EventList.addListEventListener方法代码示例

本文整理汇总了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>();
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:37,代码来源:FilterControl.java

示例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);
}
 
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:13,代码来源:GlyphPropertyEventList.java

示例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);

}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:11,代码来源:ObservableEventList.java

示例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);
		}
	});
}
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:29,代码来源:FilterTreeView.java

示例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();
	}
}
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:34,代码来源:FilterTreeView.java

示例6: BatchEventList

import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
public BatchEventList(EventList<S> source) 
{
	super(source);
	source.addListEventListener(this);
}
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:6,代码来源:BatchEventList.java

示例7: EventsTreeModel

import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
public EventsTreeModel(final EventList<LoadProfileEntity> loadProfileEnities) {
	this.loadProfileEnities = loadProfileEnities;
	loadProfileEnities.addListEventListener(this);
}
 
开发者ID:mgm-tp,项目名称:perfload-loadprofiles,代码行数:5,代码来源:EventsTreeModel.java


注:本文中的ca.odell.glazedlists.EventList.addListEventListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。