Java Code Examples for org.eclipse.xtext.xtext.wizard.BuildSystem

The following examples show how to use org.eclipse.xtext.xtext.wizard.BuildSystem. These examples are extracted from open source projects. 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
protected void setDefaults() {
	createUiProject.setSelection(true);
	createIdeProject.setSelection(true);
	createTestProject.setSelection(true);
	createWebProject.setSelection(false);
	createSDKProject.setSelection(false);
	createP2Project.setSelection(false);

	select(preferredBuildSystem, BuildSystem.NONE);
	select(createLanguageServer, LanguageServer.NONE);
	select(sourceLayout, SourceLayout.PLAIN);
}
 
Example 2
public BuildSystem getPreferredBuildSystem() {
	return BuildSystem.values()[preferredBuildSystem.getSelectionIndex()];
}
 
Example 3
public LanguageServer getLanguageServer() {
	if (getPreferredBuildSystem() == BuildSystem.NONE) {
		return LanguageServer.NONE;
	}
	return LanguageServer.values()[createLanguageServer.getSelectionIndex()];
}
 
Example 4
@Override
protected IProjectInfo getProjectInfo() {
	XtextProjectInfo projectInfo = createProjectInfo();
	LanguageDescriptor language = projectInfo.getLanguage();
	language.setFileExtensions(FileExtensions.fromString(mainPage.getFileExtensions()));
	language.setName(mainPage.getLanguageName());
	projectInfo.setBaseName(mainPage.getProjectName());
	projectInfo.setWorkingSets(Arrays.asList(mainPage.getSelectedWorkingSets()));
	projectInfo.setRootLocation(mainPage.getLocationPath().toString());
	Charset encoding = null;
	try {
		encoding = Charset.forName(ResourcesPlugin.getWorkspace().getRoot().getDefaultCharset());
	}
	catch (final CoreException e) {
		encoding = Charset.defaultCharset();
	}
	projectInfo.setEncoding(encoding);
	String lineDelimiter = InstanceScope.INSTANCE.getNode("org.eclipse.core.runtime").get("line.separator", Strings.newLine());
	projectInfo.setLineDelimiter(lineDelimiter);
	projectInfo.setWorkbench(getWorkbench());
	JavaVersion selectedBree = mainPage.getJavaVersion();
	// Use old default for wizard as fall back, when something goes wrong
	if (selectedBree != null) {
		projectInfo.setJavaVersion(selectedBree);
	}

	BuildSystem buildSystem = advancedPage.getPreferredBuildSystem();
	projectInfo.setPreferredBuildSystem(buildSystem);
	projectInfo.setSourceLayout(advancedPage.getSourceLayout());
	
	projectInfo.getUiProject().setEnabled(advancedPage.isCreateUiProject());
	if (buildSystem != BuildSystem.NONE) {
		projectInfo.setProjectLayout(ProjectLayout.HIERARCHICAL);
	}
	projectInfo.getIdeProject().setEnabled(advancedPage.isCreateIdeProject());
	projectInfo.getWebProject().setEnabled(advancedPage.isCreateWebProject());
	projectInfo.getSdkProject().setEnabled(advancedPage.isCreateSdkProject());
	projectInfo.getP2Project().setEnabled(advancedPage.isCreateP2Project());
	projectInfo.setLanguageServer(advancedPage.getLanguageServer());
	projectInfo.setJunitVersion(advancedPage.getSelectedJUnitVersion());
	
	if (advancedPage.isCreateTestProject()) {
		for (ProjectDescriptor project : projectInfo.getEnabledProjects()) {
			if (project instanceof TestedProjectDescriptor) {
				((TestedProjectDescriptor) project).getTestProject().setEnabled(true);
			}
		}
	}
	return projectInfo;
}
 
Example 5
Source Project: xtext-core   Source File: OptionHandlers.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public BuildSystemOptionHandler(CmdLineParser parser, OptionDef option, Setter<? super BuildSystem> setter) {
	super(parser, option, setter);
}
 
Example 6
Source Project: xtext-core   Source File: OptionHandlers.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected BuildSystem parse(String argument) throws NumberFormatException, CmdLineException {
	return BuildSystem.valueOf(argument);
}
 
Example 7
Source Project: xtext-core   Source File: IdeProjectDescriptor.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public boolean isEclipsePluginProject() {
  return (Objects.equal(this.getConfig().getPreferredBuildSystem(), BuildSystem.NONE) || this.getConfig().getUiProject().isEnabled());
}
 
Example 8
Source Project: xtext-core   Source File: WebProjectDescriptor.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public boolean isPartOfGradleBuild() {
  BuildSystem _preferredBuildSystem = this.getConfig().getPreferredBuildSystem();
  return Objects.equal(_preferredBuildSystem, BuildSystem.GRADLE);
}
 
Example 9
Source Project: xtext-core   Source File: WebProjectDescriptor.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public boolean isPartOfMavenBuild() {
  BuildSystem _preferredBuildSystem = this.getConfig().getPreferredBuildSystem();
  return Objects.equal(_preferredBuildSystem, BuildSystem.MAVEN);
}
 
Example 10
Source Project: xtext-core   Source File: WizardConfiguration.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public boolean needsMavenBuild() {
  return (Objects.equal(this.preferredBuildSystem, BuildSystem.MAVEN) || (Objects.equal(this.preferredBuildSystem, BuildSystem.GRADLE) && this.uiProject.isEnabled()));
}
 
Example 11
Source Project: xtext-core   Source File: WizardConfiguration.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public boolean needsGradleBuild() {
  return Objects.equal(this.preferredBuildSystem, BuildSystem.GRADLE);
}
 
Example 12
Source Project: xtext-core   Source File: WizardConfiguration.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Pure
public BuildSystem getPreferredBuildSystem() {
  return this.preferredBuildSystem;
}
 
Example 13
Source Project: xtext-core   Source File: WizardConfiguration.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public void setPreferredBuildSystem(final BuildSystem preferredBuildSystem) {
  this.preferredBuildSystem = preferredBuildSystem;
}
 
Example 14
@Override
public boolean isEclipsePluginProject() {
  return (Objects.equal(this.getConfig().getPreferredBuildSystem(), BuildSystem.NONE) || this.getConfig().getUiProject().isEnabled());
}