org.eclipse.xtext.Constants Java Examples

The following examples show how to use org.eclipse.xtext.Constants. 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 Project: xtext-core   Author: eclipse   File: ValidatorTester.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Inject
public ValidatorTester(T validator, EValidatorRegistrar registrar, @Named(Constants.LANGUAGE_NAME) final String languageName) {
	this.validator = validator;
	EValidator.Registry originalRegistry = registrar.getRegistry();
	EValidatorRegistryImpl newRegistry = new EValidatorRegistryImpl();
	registrar.setRegistry(newRegistry);
	this.validator.register(registrar);
	diagnostician = new Diagnostician(newRegistry) {
		@Override
		public java.util.Map<Object,Object> createDefaultContext() {
			java.util.Map<Object,Object> map = super.createDefaultContext();
			map.put(AbstractInjectableValidator.CURRENT_LANGUAGE_NAME, languageName);
			return map;
		}
	};
	registrar.setRegistry(originalRegistry);
	validatorCalled = false;
}
 
Example #2
Source Project: xtext-eclipse   Author: eclipse   File: ValidatorTester.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Inject
public ValidatorTester(T validator, EValidatorRegistrar registrar, @Named(Constants.LANGUAGE_NAME) final String languageName) {
	this.validator = validator;
	EValidator.Registry originalRegistry = registrar.getRegistry();
	EValidatorRegistryImpl newRegistry = new EValidatorRegistryImpl();
	registrar.setRegistry(newRegistry);
	this.validator.register(registrar);
	diagnostician = new Diagnostician(newRegistry) {
		@Override
		public java.util.Map<Object,Object> createDefaultContext() {
			java.util.Map<Object,Object> map = super.createDefaultContext();
			map.put(AbstractInjectableValidator.CURRENT_LANGUAGE_NAME, languageName);
			return map;
		}
	};
	registrar.setRegistry(originalRegistry);
	validatorCalled = false;
}
 
Example #3
Source Project: sarl   Author: sarl   File: SarlDocumentationParser.java    License: Apache License 2.0 5 votes vote down vote up
/** Change the name of the language.
 *
 * @param outputLanguage the language name, or {@code null} for ignoring the language name.
 */
@Inject
public void setOutputLanguage(@Named(Constants.LANGUAGE_NAME) String outputLanguage) {
	if (!Strings.isNullOrEmpty(outputLanguage)) {
		final String[] parts = outputLanguage.split("\\.+"); //$NON-NLS-1$
		if (parts.length > 0) {
			final String simpleName = parts[parts.length - 1];
			if (!Strings.isNullOrEmpty(simpleName)) {
				this.languageName = simpleName;
				return;
			}
		}
	}
	this.languageName = null;
}
 
Example #4
Source Project: xtext-eclipse   Author: eclipse   File: XtextEditorPropertyTester.java    License: Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
	if (Constants.LANGUAGE_NAME.equals(property)) {
		XtextEditor xtextEditor = Adapters.adapt(receiver, XtextEditor.class);
		if (xtextEditor != null) {
			return xtextEditor.getLanguageName().equals(expectedValue);
		}
	}
	return false;
}
 
Example #5
Source Project: xtext-core   Author: eclipse   File: AbstractFormatterTestLanguageRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.formatting2.internal.FormatterTestLanguage");
}
 
Example #6
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("indentationawaretestlanguage");
}
 
Example #7
Source Project: xtext-core   Author: eclipse   File: AbstractKeywordsTestLanguageRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.parser.keywords.KeywordsTestLanguage");
}
 
Example #8
Source Project: n4js   Author: eclipse   File: AbstractTypesRuntimeModule.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("n4ts");
}
 
Example #9
Source Project: xtext-core   Author: eclipse   File: AbstractSubTestLanguageRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.generator.ecore.SubTestLanguage");
}
 
Example #10
Source Project: xtext-core   Author: eclipse   File: AbstractBug385636RuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.resource.Bug385636");
}
 
Example #11
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("bug360834testlanguage");
}
 
Example #12
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("referringtestlanguage");
}
 
Example #13
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("typesRefactoring2");
}
 
Example #14
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.ui.tests.refactoring.RefactoringTestLanguage");
}
 
Example #15
Source Project: bonita-studio   Author: bonitasoft   File: AbstractConditionModelRuntimeModule.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("cmodel");
}
 
Example #16
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("crossreferenceproposaltestlanguage");
}
 
Example #17
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("encodinguitestlanguage");
}
 
Example #18
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("lazylinkingtestlanguage");
}
 
Example #19
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("pstl");
}
 
Example #20
Source Project: xtext-extras   Author: eclipse   File: AbstractPureXbaseRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("xbase");
}
 
Example #21
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.parser.parameters.ParametersTestLanguage");
}
 
Example #22
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("indentationAwareUiTestLang");
}
 
Example #23
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.xbase.annotations.XbaseWithAnnotations");
}
 
Example #24
Source Project: xtext-core   Author: eclipse   File: AbstractConcreteTestLanguageRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("concretetestlanguage");
}
 
Example #25
Source Project: xtext-core   Author: eclipse   File: AbstractBug299237TestLanguageRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.parser.antlr.Bug299237TestLanguage");
}
 
Example #26
Source Project: xtext-extras   Author: eclipse   File: AbstractXtypeRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("___xtype");
}
 
Example #27
Source Project: xtext-core   Author: eclipse   File: AbstractBug443221TestLanguageRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.parser.antlr.Bug443221TestLanguage");
}
 
Example #28
public void configureFileExtensions(Binder binder) {
	if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
		binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("livecontainerbuilderintegerationtestlanguage");
}
 
Example #29
Source Project: xtext-core   Author: eclipse   File: AbstractFowlerDslTestLanguageRuntimeModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.testlanguages.FowlerDslTestLanguage");
}
 
Example #30
public void configureLanguageName(Binder binder) {
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.testlanguages.ReferenceGrammarTestLanguage");
}