org.eclipse.xtext.builder.EclipseOutputConfigurationProvider Java Examples

The following examples show how to use org.eclipse.xtext.builder.EclipseOutputConfigurationProvider. 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: DebugSourceInstallingCompilationParticipant.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
protected OutputConfiguration findOutputConfiguration(SourceRelativeURI dslSourceFile, IFile generatedJavaFile) {
	IResourceServiceProvider serviceProvider = serviceProviderRegistry.getResourceServiceProvider(dslSourceFile.getURI());
	if (serviceProvider == null)
		return null;
	EclipseOutputConfigurationProvider cfgProvider = serviceProvider.get(EclipseOutputConfigurationProvider.class);
	IProject project = generatedJavaFile.getProject();
	Set<OutputConfiguration> configurations = cfgProvider.getOutputConfigurations(project);
	if (!configurations.isEmpty()) {
		if (configurations.size() == 1)
			return configurations.iterator().next();
		for (OutputConfiguration out : configurations) {
			for (String source : out.getSourceFolders()) {
				IContainer container = ResourceUtil.getContainer(project, out.getOutputDirectory(source));
				if (container != null && container.getFullPath().isPrefixOf(generatedJavaFile.getFullPath()))
					return out;
			}
		}
	}
	log.error("Could not find output configuration for file " + generatedJavaFile.getFullPath());
	return null;
}
 
Example #2
Source File: SARLPreferences.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Replies the Xtext output configurations related to the given project.
 *
 * @param project the project.
 * @return the Xtext output configurations.
 */
public static Set<OutputConfiguration> getXtextConfigurationsFor(IProject project) {
	final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL);
	final EclipseOutputConfigurationProvider configurationProvider =
			injector.getInstance(EclipseOutputConfigurationProvider.class);
	return configurationProvider.getOutputConfigurations(project);
}
 
Example #3
Source File: BuilderPreferencePage.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
private void scheduleCleanerJobIfNecessary(IPreferencePageContainer preferencePageContainer) {
	Map<String, ValueDifference<String>> changes = builderConfigurationBlock.getPreferenceChanges();
	for (String key : changes.keySet()) {
		if (key.matches("^" + EclipseOutputConfigurationProvider.OUTPUT_PREFERENCE_TAG + "\\.\\w+\\."
				+ EclipseOutputConfigurationProvider.OUTPUT_DIRECTORY + "$")) {
			ValueDifference<String> difference = changes.get(key);
			scheduleCleanerJob(preferencePageContainer, difference.rightValue());
		}
	}
}
 
Example #4
Source File: KeepLocalHistoryTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
public String getKey(final String preferenceName) {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append(EclipseOutputConfigurationProvider.OUTPUT_PREFERENCE_TAG);
  _builder.append(PreferenceConstants.SEPARATOR);
  _builder.append(IFileSystemAccess.DEFAULT_OUTPUT);
  _builder.append(PreferenceConstants.SEPARATOR);
  _builder.append(preferenceName);
  return _builder.toString();
}
 
Example #5
Source File: AbstractContentAssistFragmentTestLangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #6
Source File: AbstractRuleEngineUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #7
Source File: AbstractArithmeticsUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #8
Source File: AbstractBuilderTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #9
Source File: BuilderTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
       return EclipseOutputConfigurationProvider.class;	
   }
 
Example #10
Source File: AbstractXbaseUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #11
Source File: AbstractXbaseWithAnnotationsUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #12
Source File: AbstractPureXbaseUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #13
Source File: AbstractBug462047LangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #14
Source File: AbstractXImportSectionTestLangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #15
Source File: AbstractHelloWorldUiModule.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #16
Source File: AbstractStatemachineUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #17
Source File: AbstractSARLUiModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #18
Source File: KeepLocalHistoryTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public void setKeepLocalHistory(final boolean keepLocalHistory) {
  this.setValue(EclipseOutputConfigurationProvider.OUTPUT_KEEP_LOCAL_HISTORY, keepLocalHistory);
}
 
Example #19
Source File: KeepLocalHistoryTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public void setOverride(final boolean override) {
  this.setValue(EclipseOutputConfigurationProvider.OUTPUT_OVERRIDE, override);
}
 
Example #20
Source File: KeepLocalHistoryTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public void setCleanupDerived(final boolean cleanupDerived) {
  this.setValue(EclipseOutputConfigurationProvider.OUTPUT_CLEANUP_DERIVED, cleanupDerived);
}
 
Example #21
Source File: KeepLocalHistoryTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public void setCleanDirectory(final boolean cleanDirectory) {
  this.setValue(EclipseOutputConfigurationProvider.OUTPUT_CLEAN_DIRECTORY, cleanDirectory);
}
 
Example #22
Source File: AbstractGamlUiModule.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #23
Source File: AbstractXtendUiModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #24
Source File: XtendUiModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #25
Source File: AbstractXmlUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #26
Source File: N4JSBuilderPreferencePage.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This method has been copied from org.eclipse.xtext.builder.preferences.BuilderPreferencePage.
 */
@Inject
public void setConfigurationProvider(EclipseOutputConfigurationProvider configurationProvider) {
	this.configurationProvider = configurationProvider;
	rebuildCount = getRebuildCount();
}
 
Example #27
Source File: AbstractRegularExpressionUiModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #28
Source File: AbstractBromiumUiModule.java    From bromium with MIT License 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #29
Source File: AbstractMyDslUiModule.java    From M2Doc with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}
 
Example #30
Source File: AbstractFileAwareTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IContextualOutputConfigurationProvider> bindIContextualOutputConfigurationProvider() {
	return EclipseOutputConfigurationProvider.class;
}