本文整理汇总了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">
<folder name="Editors">
<folder name="text">
<folder name="x-java">
<file name="org.netbeans.spi.editor.highlighting.HighlightsLayerFactory.instance">
<attr name="instanceCreate" methodvalue="org.netbeans.spi.debugger.ui.MethodChooser.createHighlihgtsLayerFactory"/>
</file>
</folder>
</folder>
</folder></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;未经允许,请勿转载。 |
请发表评论