本文整理汇总了Java中org.netbeans.spi.editor.highlighting.ZOrder类的典型用法代码示例。如果您正苦于以下问题:Java ZOrder类的具体用法?Java ZOrder怎么用?Java ZOrder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ZOrder类属于org.netbeans.spi.editor.highlighting包,在下文中一共展示了ZOrder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testExcludeTwoLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
public void testExcludeTwoLayers() {
OffsetsBag bag = new OffsetsBag(new PlainDocument());
MemoryMimeDataProvider.reset(null);
MemoryMimeDataProvider.addInstances(
"text/plain", new SingletonLayerFactory("layer", ZOrder.DEFAULT_RACK, true, bag));
JEditorPane pane = new JEditorPane();
String [] removed = new String[] {"^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\..*$", "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\.TextSelectionHighlighting$"};
pane.putClientProperty("HighlightsLayerExcludes", removed);
pane.setContentType("text/plain");
assertEquals("The pane has got wrong mime type", "text/plain", pane.getContentType());
HighlightingManager hm = HighlightingManager.getInstance(pane);
HighlightsContainer hc = hm.getHighlights(HighlightsLayerFilter.IDENTITY);
assertNotNull("Can't get fixed HighlightsContainer", hc);
assertFalse("There should be no fixed highlights", hc.getHighlights(0, Integer.MAX_VALUE).moveNext());
}
示例2: testReleaseLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
public void testReleaseLayers() {
final String mimeType = "text/plain";
TestReleaseHighlightsContainer releasableContainer = new TestReleaseHighlightsContainer();
SingletonLayerFactory releasableLayer = new SingletonLayerFactory(
"releasableLayer", ZOrder.DEFAULT_RACK.forPosition(1), true, releasableContainer);
MemoryMimeDataProvider.reset(null);
MemoryMimeDataProvider.addInstances(mimeType, releasableLayer);
JEditorPane pane = new JEditorPane(mimeType, "Hello");
HighlightingManager hm = HighlightingManager.getInstance(pane); // Ensure layers get created
hm.getHighlights(HighlightsLayerFilter.IDENTITY);
pane.setEditorKit(new SimpleKit(mimeType));
// Do not check against concrete release count since there are e.g. mime lookup rebuild notifications
// that lead to HM.rebuildAllLayers() which increases the releaseCount too.
assertTrue("Highlights container releasing not performed after pane.setEditorKit()", releasableContainer.releaseCount > 0);
}
示例3: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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()]);
}
示例4: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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),
};
}
示例5: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
public HighlightsLayer[] createLayers(Context context) {
return new HighlightsLayer[] {
HighlightsLayer.create(DebuggingHighlightsLayerFactory.class.getName(),
ZOrder.SYNTAX_RACK,
true,
getBag(context.getDocument()))
};
}
示例6: testSimpleLayer
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
public void testSimpleLayer() {
OffsetsBag bag = new OffsetsBag(new PlainDocument());
MemoryMimeDataProvider.reset(null);
MemoryMimeDataProvider.addInstances(
"text/plain", new SingletonLayerFactory("layer", ZOrder.DEFAULT_RACK, true, bag));
JEditorPane pane = new JEditorPane();
pane.putClientProperty("HighlightsLayerExcludes", "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\..*$");
pane.setContentType("text/plain");
assertEquals("The pane has got wrong mime type", "text/plain", pane.getContentType());
HighlightingManager hm = HighlightingManager.getInstance(pane);
HighlightsContainer hc = hm.getHighlights(HighlightsLayerFilter.IDENTITY);
assertNotNull("Can't get fixed HighlightsContainer", hc);
assertFalse("There should be no fixed highlights", hc.getHighlights(0, Integer.MAX_VALUE).moveNext());
SimpleAttributeSet attributes = new SimpleAttributeSet();
attributes.addAttribute("attrib-A", "value");
bag.addHighlight(10, 20, attributes);
HighlightsSequence highlights = hc.getHighlights(0, Integer.MAX_VALUE);
assertTrue("Highlight has not been added", moveNextSkipNullAttrs(highlights));
assertEquals("Wrong start offset", 10, highlights.getStartOffset());
assertEquals("Wrong end offset", 20, highlights.getEndOffset());
assertEquals("Can't find attribute", "value", highlights.getAttributes().getAttribute("attrib-A"));
}
示例7: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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;
// }
}
示例8: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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())),
};
}
示例9: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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())
)
};
}
示例10: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(Context context) {
return new HighlightsLayer[] {
HighlightsLayer.create(DebuggerAnnotation.class.getName(),
ZOrder.TOP_RACK, true, DebuggerAnnotation.getHighlightsBag(context.getDocument()))
};
}
示例11: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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()))
};
}
示例12: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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)
)
};
}
示例13: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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()))};
}
示例14: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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())),
};
}
示例15: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(Context context) {
return new HighlightsLayer[] { HighlightsLayer.create(
"BeyondDocEndHighlightsLayer",
ZOrder.DEFAULT_RACK,
false,
new BeyondDocEndHighlightsLayer(context.getDocument()))
};
}