• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HighlightsLayerFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.netbeans.spi.editor.highlighting.HighlightsLayerFactory的典型用法代码示例。如果您正苦于以下问题:Java HighlightsLayerFactory类的具体用法?Java HighlightsLayerFactory怎么用?Java HighlightsLayerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HighlightsLayerFactory类属于org.netbeans.spi.editor.highlighting包,在下文中一共展示了HighlightsLayerFactory类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(HighlightsLayerFactory.Context context) {
    ArrayList<HighlightsLayer> layers = new ArrayList<>();
    layers.add(HighlightsLayer.create(
            TextSearchHighlighting.LAYER_TYPE_ID,
            ZOrder.SHOW_OFF_RACK.forPosition(200),
            true,
            new TextSearchHighlighting(context.getComponent())));

    layers.add(HighlightsLayer.create(
            BLOCK_SEARCH_LAYER,
            ZOrder.SHOW_OFF_RACK.forPosition(100),
            true,
            new SearchBlockHighlighting(BLOCK_SEARCH_LAYER, context.getComponent())));

    layers.add(HighlightsLayer.create(
            INC_SEARCH_LAYER,
            ZOrder.SHOW_OFF_RACK.forPosition(300),
            true,
            new SearchBlockHighlighting(INC_SEARCH_LAYER, context.getComponent())));

    return layers.toArray(new HighlightsLayer[layers.size()]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:TextSearchHighlighting.java


示例2: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
public HighlightsLayer[] createLayers(HighlightsLayerFactory.Context context) {
    return new HighlightsLayer [] { HighlightsLayer.create(
        Highlighting.class.getName(), 
        ZOrder.SYNTAX_RACK, //NOI18N
        true, 
        new Highlighting(context.getDocument())
    )};
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:Factory.java


示例3: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
public HighlightsLayer[] createLayers(HighlightsLayerFactory.Context context) {
    ArrayList<HighlightsLayer> layers = new ArrayList<HighlightsLayer>();
    
    layers.add(HighlightsLayer.create(
        ReadOnlyFilesHighlighting.LAYER_TYPE_ID,
        ZOrder.BOTTOM_RACK.forPosition(-1000),
        true,
        new ReadOnlyFilesHighlighting(context.getDocument()))
    );

    layers.add(HighlightsLayer.create(
        CaretBasedBlockHighlighting.CaretRowHighlighting.LAYER_TYPE_ID,
        ZOrder.CARET_RACK,
        true,
        new CaretBasedBlockHighlighting.CaretRowHighlighting(context.getComponent()))
    );

    layers.add(HighlightsLayer.create(
        INC_SEARCH_LAYER, 
        ZOrder.SHOW_OFF_RACK.forPosition(300),
        true,
        new BlockHighlighting(INC_SEARCH_LAYER, context.getComponent()))
    );

    layers.add(HighlightsLayer.create(
        CaretBasedBlockHighlighting.TextSelectionHighlighting.LAYER_TYPE_ID,
        ZOrder.SHOW_OFF_RACK.forPosition(500), 
        true, 
        new CaretBasedBlockHighlighting.TextSelectionHighlighting(context.getComponent()))
    );

    // If there is a lexer for the document create lexer-based syntax highlighting
    if (TokenHierarchy.get(context.getDocument()) != null) {
        layers.add(HighlightsLayer.create(
            SyntaxHighlighting.LAYER_TYPE_ID,
            ZOrder.SYNTAX_RACK,
            true,
            new SyntaxHighlighting(context.getDocument()))
        );
    }
    
    layers.add(HighlightsLayer.create(
        WhitespaceHighlighting.LAYER_TYPE_ID,
        ZOrder.CARET_RACK.forPosition(-100), // Below CaretRowHighlighting
        true, // fixed size
        new WhitespaceHighlighting(context.getComponent()))
    );
    
    layers.add(HighlightsLayer.create(
        CaretOverwriteModeHighlighting.LAYER_TYPE_ID,
        ZOrder.TOP_RACK.forPosition(100),
        true, // fixed size
        new CaretOverwriteModeHighlighting(context.getComponent()))
    );

    return layers.toArray(new HighlightsLayer [layers.size()]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:58,代码来源:Factory.java


示例4: rebuildAll

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
private synchronized void rebuildAll() {
    // Get the new set of mime path
    MimePath [] mimePaths = getAllDocumentMimePath();

    Document lastKnownDocument = lastKnownDocumentRef == null ? null : lastKnownDocumentRef.get();

    // Recalculate factories and all containers if needed
    if (!Utilities.compareObjects(lastKnownDocument, pane.getDocument()) ||
        !Arrays.equals(lastKnownMimePaths, mimePaths)
    ) {
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("rebuildAll: lastKnownDocument = " + simpleToString(lastKnownDocument) + //NOI18N
                    ", document = " + simpleToString(pane.getDocument()) + //NOI18N
                    ", lastKnownMimePaths = " + mimePathsToString(lastKnownMimePaths) + //NOI18N
                    ", mimePaths = " + mimePathsToString(mimePaths) + "\n"); //NOI18N
        }
        
        // Unregister listeners
        if (factories != null && weakFactoriesTracker != null) {
            factories.removeLookupListener(weakFactoriesTracker);
            weakFactoriesTracker = null;
        }
        if (settings != null && weakSettingsTracker != null) {
            settings.removeLookupListener(weakSettingsTracker);
            weakSettingsTracker = null;
        }

        if (mimePaths != null) {
            ArrayList<Lookup> lookups = new ArrayList<Lookup>();
            for(MimePath mimePath : mimePaths) {
                lookups.add(MimeLookup.getLookup(mimePath));
            }

            ProxyLookup lookup = new ProxyLookup(lookups.toArray(new Lookup[lookups.size()]));
            factories = lookup.lookup(new Lookup.Template<HighlightsLayerFactory>(HighlightsLayerFactory.class));
            settings = lookup.lookup(new Lookup.Template<FontColorSettings>(FontColorSettings.class));
        } else {
            factories = null;
            settings = null;
        }
        
        // Start listening again
        if (factories != null) {
            weakFactoriesTracker = WeakListeners.create(LookupListener.class, factoriesTracker, factories);
            factories.addLookupListener(weakFactoriesTracker);
            factories.allItems(); // otherwise we won't get any events at all
        }
        if (settings != null) {
            weakSettingsTracker = WeakListeners.create(LookupListener.class, settingsTracker, settings);
            settings.addLookupListener(weakSettingsTracker);
            settings.allItems(); // otherwise we won't get any events at all
        }

        lastKnownDocument = pane.getDocument();
        lastKnownMimePaths = mimePaths;
        
        rebuildAllLayers();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:60,代码来源:HighlightingManager.java


示例5: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
public HighlightsLayer[] createLayers(HighlightsLayerFactory.Context context) {
    return new HighlightsLayer [] { HighlightsLayer.create(id, zOrder, fixed, container) };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:HighlightingManagerTest.java


示例6: registerSemanticHighlighting

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
private static void registerSemanticHighlighting(LayerBuilder b, String mimeType) {
        instanceFile(b, "Editors/" + mimeType, null, HighlightsLayerFactoryImpl.class, null, HighlightsLayerFactory.class).write(); //NOI18N
//
//        // Highlighting Factories
//        item = createFile(doc, mimeFolder, "org-netbeans-modules-csl-editor-semantic-HighlightsLayerFactoryImpl.instance"); // NOI18N
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:LanguageRegistrationProcessor.java


示例7: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
public HighlightsLayer[] createLayers(HighlightsLayerFactory.Context context) {
    ArrayList<HighlightsLayer> layers = new ArrayList<HighlightsLayer>();
    
    final Document d = context.getDocument();
    final JTextComponent c = context.getComponent();
    final String mimeType = getMimeType(c, d);
    
    layers.add(HighlightsLayer.create(
        GuardedBlocksHighlighting.LAYER_TYPE_ID, 
        ZOrder.BOTTOM_RACK, 
        true,  // fixedSize
        new GuardedBlocksHighlighting(d, mimeType)
    ));
    
    layers.add(HighlightsLayer.create(
        ComposedTextHighlighting.LAYER_TYPE_ID, 
        ZOrder.TOP_RACK, 
        true,  // fixedSize
        new ComposedTextHighlighting(c, d, mimeType)
    ));

    layers.add(HighlightsLayer.create(
        AnnotationsHighlighting.LAYER_TYPE_ID,
        ZOrder.DEFAULT_RACK,
        true,  // fixedSize
        new AnnotationsHighlighting(d)
    ));


    if (!new TokenHierarchyActiveRunnable(context.getDocument()).isActive()) {
        // There is no lexer yet, we will use this layer for backwards compatibility
        layers.add(HighlightsLayer.create(
            NonLexerSyntaxHighlighting.LAYER_TYPE_ID, 
            ZOrder.SYNTAX_RACK, 
            true,  // fixedSize
            new NonLexerSyntaxHighlighting(d, mimeType)
        ));
    }
    
    return layers.toArray(new HighlightsLayer[layers.size()]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:42,代码来源:HLFactory.java


示例8: createHighlighter

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
@Override
protected AbstractSemanticHighlighter<?> createHighlighter(HighlightsLayerFactory.Context context) {
    return new MarkOccurrencesHighlighter(context.getComponent());
}
 
开发者ID:tunnelvisionlabs,项目名称:goworks,代码行数:5,代码来源:MarkOccurrencesHighlighter.java


示例9: createHighlihgtsLayerFactory

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
/**
 * This method should be referenced in xml layer files. To display the method
 * chooser ui correctly, it is required to register an instance of
 * {@link HighlightsLayerFactory} using the following pattern.
 * <pre class="examplecode">
&lt;folder name=&quot;Editors&quot;&gt;
    &lt;folder name=&quot;text&quot;&gt;
        &lt;folder name=&quot;x-java&quot;&gt;
            &lt;file name=&quot;org.netbeans.spi.editor.highlighting.HighlightsLayerFactory.instance&quot;&gt;
                &lt;attr name=&quot;instanceCreate&quot; methodvalue=&quot;org.netbeans.spi.debugger.ui.MethodChooser.createHighlihgtsLayerFactory&quot;/&gt;
            &lt;/file&gt;
        &lt;/folder&gt;
    &lt;/folder&gt;
&lt;/folder&gt;</pre>
 * <code>"x-java"</code> should be replaced by the targeted mime type
 *
 * @return highligts layer factory that handles method chooser ui visualization
 */
public static HighlightsLayerFactory createHighlihgtsLayerFactory() {
    return new MethodChooserHighlightsLayerFactory();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:MethodChooser.java


示例10: createFactoryContext

import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; //导入依赖的package包/类
public abstract HighlightsLayerFactory.Context createFactoryContext(Document document, JTextComponent component); 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:2,代码来源:HighlightingSpiPackageAccessor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WFSTCompletionLookup类代码示例发布时间:2022-05-23
下一篇:
Java FilteredBasis类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap