本文整理汇总了Java中org.netbeans.spi.editor.highlighting.ZOrder类的典型用法代码示例。如果您正苦于以下问题:Java ZOrder类的具体用法?Java ZOrder怎么用?Java ZOrder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ZOrder类属于org.netbeans.spi.editor.highlighting包,在下文中一共展示了ZOrder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:HighlightingManagerTest.java
示例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);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:HighlightingManagerTest.java
示例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()]);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:TextSearchHighlighting.java
示例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),
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:HighlightsLayerFactoryImpl.java
示例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()))
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:DebuggingHighlightsLayerFactory.java
示例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"));
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:HighlightingManagerTest.java
示例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;
// }
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:GLFHighlightsLayerFactory.java
示例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())),
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:HighlightsLayerFactoryImpl.java
示例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())
)
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:BracesMatchHighlighting.java
示例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()))
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:HighlightsLayerFactoryImpl.java
示例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()))
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:HighlightsLayerFactoryImpl.java
示例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)
)
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:GuardedBlockSuppressLayer.java
示例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()))};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:EmbeddedSectionsHighlighting.java
示例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())),
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:HighlightsLayerFactoryImpl.java
示例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()))
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:JavaViewHierarchyRandomTest.java
示例16: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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
示例17: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
public HighlightsLayer[] createLayers(Context context) {
DiffContentPanel master = (DiffContentPanel) 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.getHighlightsContainer());
return layers;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:DiffHighlightsLayerFactory.java
示例18: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的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
示例19: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
public @Override HighlightsLayer[] createLayers(final Context context) {
AttributeSet _attrs = MimeLookup.getLookup("text/x-jsp").lookup(FontColorSettings.class).getTokenFontColors("expression-language"); // NOI18N
final AttributeSet attrs;
if (_attrs == null) {
// Fallback from web.core.syntax/src/org/netbeans/modules/web/core/syntax/resources/fontsColors.xml:
SimpleAttributeSet _sattrs = new SimpleAttributeSet();
_sattrs.addAttribute(StyleConstants.Background, new Color(0xe3f2e1));
attrs = _sattrs;
} else {
attrs = _attrs;
}
return new HighlightsLayer[] {HighlightsLayer.create("ant", ZOrder.SYNTAX_RACK.forPosition(10), true,
new AntHighlightsContainer((AbstractDocument) context.getDocument(), attrs))}; // NOI18N
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:AntHighlightsLayerFactory.java
示例20: createLayers
import org.netbeans.spi.editor.highlighting.ZOrder; //导入依赖的package包/类
@Override
public HighlightsLayer[] createLayers(Context context) {
return new HighlightsLayer[] {
HighlightsLayer.create(MethodChooser.class.getName(),
ZOrder.SYNTAX_RACK.forPosition(10000), false, MethodChooser.getHighlightsBag(context.getDocument()))
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:MethodChooser.java
注:本文中的org.netbeans.spi.editor.highlighting.ZOrder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论