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


Java ListenerList类代码示例

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

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:SyntaxHighlighting.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:EditorCaret.java

示例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);
    }
}
 
开发者ID:tunnelvisionlabs,项目名称:goworks,代码行数:16,代码来源:ParserTaskManagerImpl.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:ViewHierarchyImpl.java


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