org.eclipse.xtext.builder.preferences.BuilderPreferenceAccess Java Examples

The following examples show how to use org.eclipse.xtext.builder.preferences.BuilderPreferenceAccess. 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: BuilderParticipantTest.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testNoOutputFolderCreation() throws Exception {
	OutputConfigurationProvider outputConfigurationProvider = new OutputConfigurationProvider() {
		@Override
		public Set<OutputConfiguration> getOutputConfigurations() {
			final Set<OutputConfiguration> result = super.getOutputConfigurations();
			OutputConfiguration configuration = result.iterator().next();
			configuration.setCreateOutputDirectory(false);
			return result;
		}
	};
	BuilderPreferenceAccess.Initializer initializer = new BuilderPreferenceAccess.Initializer();
	initializer.setOutputConfigurationProvider(outputConfigurationProvider);
	initializer.initialize(preferenceStoreAccess);

	IJavaProject project = createJavaProject("foo");
	addNature(project.getProject(), XtextProjectHelper.NATURE_ID);
	IFolder folder = project.getProject().getFolder("src");
	IFile file = folder.getFile("Foo" + F_EXT);
	file.create(new StringInputStream("object Foo"), true, monitor());
	build();
	final IFile generatedFile = project.getProject().getFile("./src-gen/Foo.txt");
	assertFalse(generatedFile.exists());
}
 
Example #2
Source File: AbstractBuilderTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #3
Source File: AbstractSARLUiModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #4
Source File: AbstractGamlUiModule.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #5
Source File: CheckUiModule.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
@Override
@SuppressWarnings("PMD.AvoidDollarSigns") // that's how it's defined in Xtext
public Class<? extends BuilderPreferenceAccess.Initializer> bindBuilderPreferenceAccess$Initializer() {
  return CheckBuilderPreferenceAccess.Initializer.class;
}
 
Example #6
Source File: AbstractHelloWorldUiModule.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #7
Source File: AbstractXtendUiModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #8
Source File: BuilderParticipant.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @nooverride This method is not intended to be re-implemented or extended by clients.
 * @noreference This method is not intended to be referenced by clients.
 */
@Inject
public void setBuilderPreferenceAccess(BuilderPreferenceAccess builderPreferenceAccess) {
	this.builderPreferenceAccess = builderPreferenceAccess;
}
 
Example #9
Source File: AbstractXImportSectionTestLangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #10
Source File: AbstractBug462047LangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #11
Source File: AbstractPureXbaseUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #12
Source File: DefaultXbaseUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends BuilderPreferenceAccess.Initializer> bindBuilderPreferenceAccess$Initializer() {
	return XbaseBuilderPreferenceAccess.Initializer.class;
}
 
Example #13
Source File: AbstractBuilderParticipantTest.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected String getOutputForSourceFolderKey(String sourceFolder) {
	return BuilderPreferenceAccess.getOutputForSourceFolderKey(new OutputConfiguration(
			IFileSystemAccess.DEFAULT_OUTPUT), sourceFolder);
}
 
Example #14
Source File: BuilderParticipantTest.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@After
public void resetPrefs() {
	BuilderPreferenceAccess.Initializer initializer = new BuilderPreferenceAccess.Initializer();
	initializer.setOutputConfigurationProvider(new OutputConfigurationProvider());
	initializer.initialize(preferenceStoreAccess);
}
 
Example #15
Source File: BuilderParticipantTest.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Test
public void testNoCleanUpNoDerived() throws Exception {
	OutputConfigurationProvider outputConfigurationProvider = new OutputConfigurationProvider() {
		@Override
		public Set<OutputConfiguration> getOutputConfigurations() {
			final Set<OutputConfiguration> result = super.getOutputConfigurations();
			OutputConfiguration configuration = result.iterator().next();
			configuration.setCanClearOutputDirectory(false);
			configuration.setCleanUpDerivedResources(false);
			configuration.setSetDerivedProperty(false);
			return result;
		}
	};
	BuilderPreferenceAccess.Initializer initializer = new BuilderPreferenceAccess.Initializer();
	initializer.setOutputConfigurationProvider(outputConfigurationProvider);
	initializer.initialize(preferenceStoreAccess);

	IJavaProject project = createJavaProject("foo");
	addNature(project.getProject(), XtextProjectHelper.NATURE_ID);
	IFolder folder = project.getProject().getFolder("src");
	IFile file = folder.getFile("Foo" + F_EXT);
	file.create(new StringInputStream("object Foo"), true, monitor());
	build();
	IFile generatedFileFoo = project.getProject().getFile("./src-gen/Foo.txt");
	assertTrue(generatedFileFoo.exists());
	assertFalse(generatedFileFoo.isDerived());
	assertTrue(generatedFileFoo.findMarkers(DerivedResourceMarkers.MARKER_ID, false, IResource.DEPTH_ZERO).length == 1);
	assertEquals("object Foo", readFile(generatedFileFoo).trim());
	file.setContents(new StringInputStream("object Bar"), true, true, monitor());
	build();
	assertTrue(generatedFileFoo.exists());
	IFile generatedFileBar = project.getProject().getFile("./src-gen/Bar.txt");
	assertTrue(generatedFileBar.exists());
	assertFalse(generatedFileBar.isDerived());
	assertTrue(generatedFileBar.findMarkers(DerivedResourceMarkers.MARKER_ID, false, IResource.DEPTH_ZERO).length == 1);
	assertEquals("object Bar", readFile(generatedFileBar).trim());
	file.delete(true, monitor());
	build();
	assertTrue(generatedFileBar.exists());
	disableAutobuild(()->{
		cleanBuild();
		assertTrue(generatedFileBar.exists());	
	});
}
 
Example #16
Source File: AbstractN4JSUiModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #17
Source File: AbstractRuleEngineUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #18
Source File: AbstractStatemachineUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #19
Source File: AbstractDomainmodelUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #20
Source File: AbstractEcore2XtextTestUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #21
Source File: AbstractSingleCodetemplateUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #22
Source File: AbstractCodetemplatesUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #23
Source File: AbstractXmlUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #24
Source File: AbstractNestedRefsTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #25
Source File: AbstractNoJdtTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #26
Source File: AbstractXtextGrammarTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #27
Source File: AbstractFileAwareTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #28
Source File: AbstractMyDslUiModule.java    From M2Doc with Eclipse Public License 1.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #29
Source File: AbstractBromiumUiModule.java    From bromium with MIT License 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}
 
Example #30
Source File: AbstractRegularExpressionUiModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public void configureBuilderPreferenceStoreInitializer(Binder binder) {
	binder.bind(IPreferenceStoreInitializer.class)
		.annotatedWith(Names.named("builderPreferenceInitializer"))
		.to(BuilderPreferenceAccess.Initializer.class);
}