Java 类org.eclipse.xtext.ui.editor.folding.IFoldingRegionProvider 实例源码

项目:dsl-devkit    文件:AbstractFoldingTest.java   
/**
 * Verifies that FoldedPositions are valid.
 * If the assertion fails that is probably due to an ITextRegion.EMPTY_REGION being provided for the object's significant text region.
 */
@Test
@BugTest("ACF-2605")
public void testFoldedPositions() {
  Collection<FoldedPosition> foldingRegions = getXtextTestUtil().get(IFoldingRegionProvider.class).getFoldingRegions(getDocument());
  for (DefaultFoldedPosition foldedPosition : Iterables.filter(foldingRegions, DefaultFoldedPosition.class)) {
    try {
      Assert.assertFalse("Illegal significant region for FoldedPosition " + foldedPosition, foldedPosition.computeCaptionOffset(getDocument()) < 0);
      /* If the above assertion fails that is probably due to an ITextRegion.EMPTY_REGION being provided for the object's significant text region. */
    } catch (BadLocationException e) {
      fail("Bad location for FoldedPosition: " + e.getMessage());
    }
  }
}
项目:antlr4ide    文件:Antlr4UiModule.java   
@Override
public void configure(final Binder binder) {
  super.configure(binder);

  binder.requestStaticInjection(AntlrConsoleFactory.class);
  binder.requestStaticInjection(AntlrHighlightingConfiguration.class);
  binder.bind(GrammarResource.class).to(DefaultGrammarResource.class);

  binder.bind(ToolOptionsProvider.class).to(DefaultToolOptionsProvider.class);

  binder.bind(Antlr4FoldingPreferenceStoreInitializer.class);
  binder.bind(BuildPreferenceStoreInitializer.class);
  binder.bind(IFoldingStructureProvider.class).to(Antlr4FoldingStructureProvider.class);
  binder.bind(IFoldingRegionProvider.class).to(Antlr4FoldingRegionProvider.class);

  binder.bind(String.class)
      .annotatedWith(Names.named(AbstractMultiLineCommentProvider.START_TAG))
      .toInstance("/\\*\\*");

  binder.bind(IActionContributor.class).annotatedWith(Names.named("Show Whitespace"))
      .to(ShowWhitespaceCharactersActionContributor.class);

  binder.bind(TodoListProcessor.class);
  binder.bind(RefreshProjectProcessor.class);

  binder.bind(IPath.class).annotatedWith(Names.named("stateLocation")).toInstance(stateLocation);
  ConsoleImpl.getLogger().addAppender(new DefaultConsole());
}
项目:z80editor    文件:Z80UiModule.java   
public Class<? extends IFoldingRegionProvider> bindFoldingRegionProvider() {
    return z80FoldingRegionProvider.class;
}
项目:gama    文件:GamlUiModule.java   
public Class<? extends IFoldingRegionProvider> bindFoldingRegionProvider() {
    return GamaFoldingRegionProvider.class;
}