本文整理汇总了Java中org.netbeans.lib.editor.util.ListenerList类的典型用法代码示例。如果您正苦于以下问题:Java ListenerList类的具体用法?Java ListenerList怎么用?Java ListenerList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ListenerList类属于org.netbeans.lib.editor.util包,在下文中一共展示了ListenerList类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeDataListener
import org.netbeans.lib.editor.util.ListenerList; //导入依赖的package包/类
@Override
public <T> void removeDataListener(ParserDataDefinition<T> definition, ParserDataListener<? super T> listener) {
Parameters.notNull("definition", definition);
Parameters.notNull("listener", listener);
synchronized (dataListeners) {
ListenerList<ParserDataListener<?>> listeners = dataListeners.get(definition);
if (listeners == null) {
return;
}
listeners.remove(listener);
if (listeners.getListenerCount() == 0) {
dataListeners.remove(definition);
}
}
}
示例2: FCSInfo
import org.netbeans.lib.editor.util.ListenerList; //导入依赖的package包/类
/**
* @param innerLanguage
* @param mimePath note it may start with mimeTypeForOptions
*/
public FCSInfo(String mimePath, Language<T> innerLanguage) {
this.innerLanguage = innerLanguage;
this.mimePath = mimePath;
this.listeners = new ListenerList<ChangeListener>();
Lookup lookup = MimeLookup.getLookup(MimePath.parse(mimePath));
result = lookup.lookupResult(FontColorSettings.class);
// Do not listen on font color settings changes in tests
// since "random" lookup events translate into highlight change events
// that are monitored by tests and so the tests may then fail
if (TEST_FALLBACK_COLORING == null) {
result.addLookupListener(WeakListeners.create(LookupListener.class, this, result));
}
updateFCS();
}
示例3: EditorCaret
import org.netbeans.lib.editor.util.ListenerList; //导入依赖的package包/类
public EditorCaret() {
caretItems = new GapList<>();
sortedCaretItems = new GapList<>();
CaretItem singleCaret = new CaretItem(this, null, Position.Bias.Forward, null, Position.Bias.Forward);
caretItems.add(singleCaret);
sortedCaretItems.add(singleCaret);
listenerList = new ListenerList<>();
changeListenerList = new ListenerList<>();
listenerImpl = new ListenerImpl();
}
示例4: addDataListener
import org.netbeans.lib.editor.util.ListenerList; //导入依赖的package包/类
@Override
public <T> void addDataListener(ParserDataDefinition<T> definition, ParserDataListener<? super T> listener) {
Parameters.notNull("definition", definition);
Parameters.notNull("listener", listener);
synchronized (dataListeners) {
ListenerList<ParserDataListener<?>> listeners = dataListeners.get(definition);
if (listeners == null) {
listeners = new ListenerList<>();
dataListeners.put(definition, listeners);
}
listeners.add(listener);
}
}
示例5: ViewHierarchyImpl
import org.netbeans.lib.editor.util.ListenerList; //导入依赖的package包/类
private ViewHierarchyImpl(JTextComponent textComponent) {
this.textComponent = textComponent;
this.listenerList = new ListenerList<ViewHierarchyListener>();
this.viewHierarchy = ViewApiPackageAccessor.get().createViewHierarchy(this);
}