本文整理汇总了Java中org.netbeans.spi.editor.highlighting.HighlightsLayer类的典型用法代码示例。如果您正苦于以下问题:Java HighlightsLayer类的具体用法?Java HighlightsLayer怎么用?Java HighlightsLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HighlightsLayer类属于org.netbeans.spi.editor.highlighting包,在下文中一共展示了HighlightsLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
}
示例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;
}
示例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;
}
示例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()]);
}
示例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) };
}
示例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),
};
}
示例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()))
};
}
示例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);
}
示例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;
}
示例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;
}
示例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;
// }
}
示例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())),
};
}
示例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())
)
};
}
示例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()))
};
}
示例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()))
};
}