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

Java HighlightsLayer类代码示例

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

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



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

示例1: dumpLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
private static void dumpLayers(StringBuilder sb, String prefix, List<? extends HighlightsLayer> layers) {
    sb.append(prefix).append(" layers:\n"); //NOI18N
    int digitCount = ArrayUtilities.digitCount(layers.size());
    for (int i = 0; i < layers.size(); i++) {
        HighlightsLayer layer = layers.get(i);
        HighlightsLayerAccessor layerAccessor = 
            HighlightingSpiPackageAccessor.get().getHighlightsLayerAccessor(layer);

        sb.append("  ");
        ArrayUtilities.appendBracketedIndex(sb, i, digitCount);
        sb.append(layerAccessor.getLayerTypeId());
        sb.append('['); //NOI18N
        sb.append(layerAccessor.getZOrder().toString()); //NOI18N
        sb.append(layerAccessor.isFixedSize() ? ",Fixed" : ",NonFixed");
        sb.append(']'); //NOI18N
        sb.append('@'); //NOI18N
        sb.append(Integer.toHexString(System.identityHashCode(layer)));
        sb.append("\n"); //NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:HighlightingManager.java


示例2: filterLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
@Override
public List<? extends HighlightsLayer> filterLayers(List<? extends HighlightsLayer> layers) {
    List<? extends HighlightsLayer> includedLayers;
    
    if (includes.isEmpty()) {
        includedLayers = layers;
    } else {
        includedLayers = filter(layers, includes, true);
    }
    
    List<? extends HighlightsLayer> filteredLayers;
    if (excludes.isEmpty()) {
        filteredLayers = includedLayers;
    } else {
        filteredLayers = filter(includedLayers, excludes, false);
    }
    
    return filteredLayers;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:HighlightingManager.java


示例3: filterLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
public List<? extends HighlightsLayer> filterLayers(List<? extends HighlightsLayer> layers) {
    ArrayList<HighlightsLayer> filteredLayers = new ArrayList<HighlightsLayer>();
    
    for(int i = layers.size() - 1; i >= 0; i--) {
        HighlightsLayer layer = layers.get(i);
        HighlightsLayerAccessor layerAccessor = 
            HighlightingSpiPackageAccessor.get().getHighlightsLayerAccessor(layer);
        
        if (!layerAccessor.isFixedSize()) {
            break;
        }
        
        filteredLayers.add(0, layer);
    }
    
    return filteredLayers;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:HighlightingManagerTest.java


示例4: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的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


示例5: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(Context context) {
    Document document = context.getDocument();
    if (!(document instanceof StyledDocument)) {
        return new HighlightsLayer[0];
    }

    AbstractSemanticHighlighter<?> highlighter = (AbstractSemanticHighlighter<?>)document.getProperty(highlighterClass);
    if (highlighter == null) {
        highlighter = createHighlighter(context);
        highlighter.initialize();
        document.putProperty(highlighterClass, highlighter);
    }

    highlighter.addComponent(context.getComponent());
    return new HighlightsLayer[] { HighlightsLayer.create(highlighterClass.getName(), getPosition(), true, highlighter) };
}
 
开发者ID:tunnelvisionlabs,项目名称:goworks,代码行数:18,代码来源:AbstractSemanticHighlighter.java


示例6: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
public HighlightsLayer[] createLayers(Context context) {
    OffsetsBag bag = AnnotationHolder.getBag(context.getDocument());
    
    return new HighlightsLayer[] {
        HighlightsLayer.create(AnnotationHolder.class.getName(), ZOrder.SHOW_OFF_RACK.forPosition(420), true, bag),
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:HighlightsLayerFactoryImpl.java


示例7: createLayers

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


示例8: filteredHighlights

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
synchronized HighlightsContainer filteredHighlights(HighlightsLayerFilter filter) {
    // Get the containers
    List<? extends HighlightsLayer> layers = (filter == null)
            ? sortedLayers
            : filter.filterLayers(sortedLayers);
    ArrayList<HighlightsContainer> containers = new ArrayList<HighlightsContainer>(layers.size());
    for (HighlightsLayer layer : layers) {
        HighlightsLayerAccessor layerAccessor =
                HighlightingSpiPackageAccessor.get().getHighlightsLayerAccessor(layer);

        containers.add(layerAccessor.getContainer());
    }
    return new DirectMergeContainer(containers.toArray(new HighlightsContainer[containers.size()]), true);
        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:HighlightingManager.java


示例9: findLayer

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
synchronized HighlightsLayer findLayer(HighlightsContainer container) {
    for (HighlightsLayer layer : sortedLayers) {
        if (HighlightingSpiPackageAccessor.get().getHighlightsLayerAccessor(layer).getContainer() == container) {
            return layer;
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:HighlightingManager.java


示例10: filter

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
private static List<? extends HighlightsLayer> filter(
    List<? extends HighlightsLayer> layers,
    List<Pattern> patterns,
    boolean includeMatches // true means include matching layers, false means include non-matching layers
) {
    List<HighlightsLayer> filtered = new ArrayList<HighlightsLayer>();
    
    for(HighlightsLayer layer : layers) {
        HighlightsLayerAccessor layerAccessor = 
            HighlightingSpiPackageAccessor.get().getHighlightsLayerAccessor(layer);
        
        boolean matchesExcludes = false;
        for(Pattern pattern : patterns) {
            boolean matches = pattern.matcher(layerAccessor.getLayerTypeId()).matches();
            
            if (matches && includeMatches) {
                filtered.add(layer);
            }
                             
            matchesExcludes = matches ? true : matchesExcludes;
        }
        
        if (!patterns.isEmpty() && !matchesExcludes && !includeMatches) {
            filtered.add(layer);
        }
    }
    
    return filtered;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:HighlightingManager.java


示例11: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
public HighlightsLayer[] createLayers (Context context) {
        Document document = context.getDocument ();
//        try {
//            if (LanguagesManager.getDefault ().getLanguage (mimeType).getParser () == null)
//                return null;
            return new HighlightsLayer[] {
                HighlightsLayer.create (
                    "GLF Semantic Coloring", 
                    ZOrder.SYNTAX_RACK.forPosition (10), 
                    false, 
                    new SemanticHighlightsLayer (document)
                ),
                HighlightsLayer.create (
                    "GLF Languages Coloring", 
                    ZOrder.SYNTAX_RACK.forPosition (11), 
                    false, 
                    new LanguagesHighlightsLayer (document)
                ),
                HighlightsLayer.create (
                    "GLF Token Highlighting", 
                    ZOrder.SHOW_OFF_RACK.forPosition (0), 
                    false, 
                    new TokenHighlightsLayer (document)
                )
            };
//        } catch (LanguageDefinitionNotFoundException ex) {
//            return null;
//        }
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:GLFHighlightsLayerFactory.java


示例12: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
public HighlightsLayer[] createLayers(Context context) {
        //LexerBasedHighlightLayer semantic = LexerBasedHighlightLayer.getLayer(SemanticHighlighter.class, context.getDocument());
        GsfSemanticLayer semantic = GsfSemanticLayer.getLayer(SemanticHighlighter.class, context.getDocument());
        GsfSemanticLayer occurrences = (GsfSemanticLayer)MarkOccurrencesHighlighter.getHighlightsBag(context.getDocument());
        semantic.clearColoringCache();
        
        return new HighlightsLayer[] {
            HighlightsLayer.create(SemanticHighlighter.class.getName() + "-1", ZOrder.SYNTAX_RACK.forPosition(1000), false, semantic),
//            HighlightsLayer.create(SemanticHighlighter.class.getName() + "-2", ZOrder.SYNTAX_RACK.forPosition(1500), false, SemanticHighlighter.getImportHighlightsBag(context.getDocument())),
            //the mark occurrences layer should be "above" current row and "below" the search layers:
            HighlightsLayer.create(MarkOccurrencesHighlighter.class.getName(), ZOrder.CARET_RACK.forPosition(50), false, occurrences),
            //"above" mark occurrences, "below" search layers:
            HighlightsLayer.create(InstantRenamePerformer.class.getName(), ZOrder.CARET_RACK.forPosition(75), false, InstantRenamePerformer.getHighlightsBag(context.getDocument())),
        };
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:HighlightsLayerFactoryImpl.java


示例13: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
public HighlightsLayer[] createLayers(Context context) {
    return new HighlightsLayer [] {
        HighlightsLayer.create(
            "org-netbeans-modules-editor-bracesmatching-BracesMatchHighlighting", //NOI18N
            ZOrder.SHOW_OFF_RACK.forPosition(400), 
            true, 
            new BracesMatchHighlighting(context.getComponent(), context.getDocument())
        )
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:BracesMatchHighlighting.java


示例14: createLayers

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


示例15: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
public HighlightsLayer[] createLayers(Context context) {
    if (!DEBUG_MODE) {
        return new HighlightsLayer[0];
    }
    
    return new HighlightsLayer[] {
        HighlightsLayer.create(HighlightsLayerFactoryImpl.class.getName(), ZOrder.DEFAULT_RACK, true, TreeNavigatorProviderImpl.getBag(context.getDocument()))
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:HighlightsLayerFactoryImpl.java


示例16: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(Context context) {
    final Document d = context.getDocument();
    final JTextComponent c = context.getComponent();
    
    return new HighlightsLayer[] {
        HighlightsLayer.create(
            GuardedBlockSuppressLayer.LAYER_ID, 
            ZOrder.BOTTOM_RACK.forPosition(10), 
            true,  // fixedSize
            new GuardedBlockSuppressLayer(c)
        )
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:GuardedBlockSuppressLayer.java


示例17: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(Context context) {
    return new HighlightsLayer[]{HighlightsLayer.create(
                "rhtml-embedded-ruby-scriplets-highlighting-layer", //NOI18N
                ZOrder.BOTTOM_RACK.forPosition(100),
                true,
                new EmbeddedSectionsHighlighting(context.getDocument()))};
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:EmbeddedSectionsHighlighting.java


示例18: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
public HighlightsLayer[] createLayers(Context context) {
    LexerBasedHighlightLayer semantic = LexerBasedHighlightLayer.getLayer(SemanticHighlighter.class, context.getDocument());
    
    semantic.clearColoringCache();
    
    return new HighlightsLayer[] {
        HighlightsLayer.create(SemanticHighlighter.class.getName() + "-1", ZOrder.SYNTAX_RACK.forPosition(1000), false,semantic),
        HighlightsLayer.create(SemanticHighlighter.class.getName() + "-2", ZOrder.SYNTAX_RACK.forPosition(1500), false, SemanticHighlighter.getImportHighlightsBag(context.getDocument())),
        //the mark occurrences layer should be "above" current row and "below" the search layers:
        HighlightsLayer.create(MarkOccurrencesHighlighter.class.getName(), ZOrder.SHOW_OFF_RACK.forPosition(20), true, MarkOccurrencesHighlighter.getHighlightsBag(context.getDocument())),
        //"above" mark occurrences, "below" search layers:
        HighlightsLayer.create(InstantRenamePerformer.class.getName(), ZOrder.SHOW_OFF_RACK.forPosition(25), true, InstantRenamePerformer.getHighlightsBag(context.getDocument())),
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:HighlightsLayerFactoryImpl.java


示例19: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(Context context) {
    return new HighlightsLayer[] { HighlightsLayer.create(
            "BeyondDocEndHighlightsLayer",
            ZOrder.DEFAULT_RACK,
            false,
            new BeyondDocEndHighlightsLayer(context.getDocument()))
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:JavaViewHierarchyRandomTest.java


示例20: createLayers

import org.netbeans.spi.editor.highlighting.HighlightsLayer; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(Context context) {
    MergePane master = (MergePane) context.getComponent().getClientProperty(HIGHLITING_LAYER_ID);
    if (master == null) return null;
    
    HighlightsLayer [] layers = new HighlightsLayer[1];
    layers[0] = HighlightsLayer.create(HIGHLITING_LAYER_ID, ZOrder.DEFAULT_RACK, true, master);
    return layers;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:MergeHighlightsLayerFactory.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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