org.eclipse.xtext.documentation.IEObjectDocumentationProvider Java Examples

The following examples show how to use org.eclipse.xtext.documentation.IEObjectDocumentationProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DocumentationBuilderFragment.java    From sarl with Apache License 2.0 6 votes vote down vote up
@Override
public void generateRuntimeBindings(BindingFactory factory) {
	super.generateRuntimeBindings(factory);

	factory.addfinalTypeToType(getIDocumentationFormatter(), getDocumentationFormatterImpl());
	factory.addfinalTypeToTypeSingleton(getIEcoreDocumentationBuilder(), getEcoreDocumentationBuilderImpl());

	bindTypeReferences(factory,
			new TypeReference(IEObjectDocumentationProvider.class),
			getDocumentationProviderImpl(),
			getDocumentationProviderImplCustom());
	bindTypeReferences(factory,
			new TypeReference(IEObjectDocumentationProviderExtension.class),
			getDocumentationProviderImpl(),
			getDocumentationProviderImplCustom());
	bindTypeReferences(factory,
			new TypeReference(ISyntacticSequencer.class),
			getEcoreDocumentationSyntacticSequencer(),
			getEcoreDocumentationSyntacticSequencerCustom());
}
 
Example #2
Source File: DefaultEObjectHoverProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public ISetup getTestLanguageSetup(final IEObjectDocumentationProvider ieObjectDocumentationProvider) {
	return new KeywordsUiTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(Modules2.mixin(
					new TestLanguageRuntimeModule(),
					new TestModule(TestsActivator.getInstance(),ieObjectDocumentationProvider),
					new SharedStateModule()));
		}
	};
}
 
Example #3
Source File: DefaultEObjectHoverProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testElementHasNoDocumentation () throws Exception {
	with(getTestLanguageSetup(new IEObjectDocumentationProvider() {			
		@Override
		public String getDocumentation(EObject o) {
			return null;
		}
	}));
	File f = (File) getModel ("stuff test");
	DefaultEObjectHoverProvider cut = get(DefaultEObjectHoverProvider.class);
	assertTrue(getHtml(f.getStuff().get(0), cut).contains("Stuff <b>test</b>"));
}
 
Example #4
Source File: DefaultEObjectHoverProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testElementHasDocumentation () throws Exception {
	with(getTestLanguageSetup(new IEObjectDocumentationProvider() {			
		@Override
		public String getDocumentation(EObject o) {
			return "Test";
		}
	}));
	File f = (File) getModel ("stuff test");
	DefaultEObjectHoverProvider cut = get(DefaultEObjectHoverProvider.class);
	assertTrue(getHtml(f.getStuff().get(0), cut).contains("Stuff <b>test</b><p>Test</p>"));
}
 
Example #5
Source File: DocumentedImplCustom.java    From dsl-devkit with Eclipse Public License 1.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public String getDescription() {
  if (!this.eIsProxy() && this.eResource() != null) {
    IResourceServiceProvider serviceProvider = IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(this.eResource().getURI());
    if (serviceProvider != null) {
      IEObjectDocumentationProvider documentationProvider = serviceProvider.get(IEObjectDocumentationProvider.class);
      String documentation = documentationProvider.getDocumentation(this);
      if (!Strings.isEmpty(documentation)) { // NOPMD
        return documentation;
      }
    }
  }
  return null;
}
 
Example #6
Source File: N4JSRuntimeModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Bind custom IEObjectDocumentationProvider.
 */
public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProvider() {
	return N4JSDocumentationProvider.class;
}
 
Example #7
Source File: TypeUsageCollector.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
private void setDocumentationProvider(IEObjectDocumentationProvider documentationProvider) {
	if(documentationProvider instanceof IEObjectDocumentationProviderExtension) 
		this.documentationProvider = (IEObjectDocumentationProviderExtension) documentationProvider;
}
 
Example #8
Source File: DefaultEObjectHoverProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public TestModule(AbstractUIPlugin plugin, final IEObjectDocumentationProvider provider) {
	super(plugin);
	this.provider = provider;
}
 
Example #9
Source File: DefaultEObjectHoverProviderTest.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public IEObjectDocumentationProvider bindIEObjectDocumentationProvider() {
	return provider;		
}
 
Example #10
Source File: XtendRuntimeModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProvider() {
	return XtendDocumentationProvider.class;
}
 
Example #11
Source File: CompilationUnitImpl.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Pure
public IEObjectDocumentationProvider getDocumentationProvider() {
  return this.documentationProvider;
}
 
Example #12
Source File: CheckRuntimeModule.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @return a JavaDoc-like documentation provider
 */
public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProvider() {
  return CheckEObjectDocumentationProvider.class;
}
 
Example #13
Source File: SGenTestRuntimeModule.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProvider() {
	return SGenUserHelpDocumentationProvider.class;
}
 
Example #14
Source File: GamlUiModule.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProviderr() {
	return GamlDocumentationProvider.class;
}
 
Example #15
Source File: YangUiModule.java    From yang-design-studio with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProviderr() {
    return yangDocumentationProvider.class;
}
 
Example #16
Source File: AbstractSARLRuntimeModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProvider() {
	return SarlDocumentationProvider.class;
}