diff options
author | 2021-08-03 18:42:39 +0900 | |
---|---|---|
committer | 2021-08-06 19:32:38 +0900 | |
commit | be4f78978faba3d3ceb88df02a7f93a2e09ff1e0 (patch) | |
tree | 1f3f1a96251ac4f655c8a96fc33d5d4ee779cd06 /rba.tool.editor.ui/src-gen/rba/tool/editor/ui/wizard/RBAModelProjectCreator.java | |
parent | 71ca7c6cab863767ef30c8bd05b2bbfda8731cb5 (diff) |
Initial commit
Bug-AGL: SPEC-4033
Signed-off-by: Kenji Hosokawa <khosokawa@jp.adit-jv.com>
Diffstat (limited to 'rba.tool.editor.ui/src-gen/rba/tool/editor/ui/wizard/RBAModelProjectCreator.java')
-rw-r--r-- | rba.tool.editor.ui/src-gen/rba/tool/editor/ui/wizard/RBAModelProjectCreator.java | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/rba.tool.editor.ui/src-gen/rba/tool/editor/ui/wizard/RBAModelProjectCreator.java b/rba.tool.editor.ui/src-gen/rba/tool/editor/ui/wizard/RBAModelProjectCreator.java new file mode 100644 index 0000000..78b2ec9 --- /dev/null +++ b/rba.tool.editor.ui/src-gen/rba/tool/editor/ui/wizard/RBAModelProjectCreator.java @@ -0,0 +1,93 @@ +/*
+ * generated by Xtext 2.13.0
+ */
+package rba.tool.editor.ui.wizard;
+
+import org.eclipse.xtext.ui.wizard.AbstractProjectCreator;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2;
+import org.eclipse.xtext.generator.IFileSystemAccess;
+import org.eclipse.xtext.generator.IFileSystemAccess2;
+import org.eclipse.xtext.generator.IOutputConfigurationProvider;
+import org.eclipse.xtext.generator.OutputConfiguration;
+import org.eclipse.xtext.ui.util.ProjectFactory;
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class RBAModelProjectCreator extends AbstractProjectCreator {
+ protected static final String DSL_PROJECT_NAME = "rba.tool.editor";
+
+ @Inject
+ private RBAModelNewProjectWizardInitialContents initialContents;
+
+ @Inject
+ private Provider<EclipseResourceFileSystemAccess2> fileSystemAccessProvider;
+
+ @Inject
+ private IOutputConfigurationProvider outputConfigurationProvider;
+
+ @Inject
+ private Provider<ProjectFactory> projectFactoryProvider;
+
+ @Override
+ protected ProjectFactory createProjectFactory() {
+ return projectFactoryProvider.get();
+ }
+
+ @Override
+ protected RBAModelProjectInfo getProjectInfo() {
+ return (RBAModelProjectInfo) super.getProjectInfo();
+ }
+
+ @Override
+ protected String getModelFolderName() {
+ return "src";
+ }
+
+ @Override
+ protected List<String> getAllFolders() {
+ Set<OutputConfiguration> outputConfigurations = outputConfigurationProvider.getOutputConfigurations();
+ String outputFolder = "src-gen";
+ for (OutputConfiguration outputConfiguration : outputConfigurations) {
+ if (IFileSystemAccess.DEFAULT_OUTPUT.equals(outputConfiguration.getName())) {
+ outputFolder = outputConfiguration.getOutputDirectory();
+ break;
+ }
+ }
+ return ImmutableList.of(getModelFolderName(), outputFolder);
+ }
+
+ @Override
+ protected void enhanceProject(final IProject project, final IProgressMonitor monitor) throws CoreException {
+ IFileSystemAccess2 access = getFileSystemAccess(project, monitor);
+ initialContents.generateInitialContents(access);
+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ }
+
+ protected IFileSystemAccess2 getFileSystemAccess(final IProject project, final IProgressMonitor monitor) {
+ EclipseResourceFileSystemAccess2 access = fileSystemAccessProvider.get();
+ access.setContext(project);
+ access.setMonitor(monitor);
+ OutputConfiguration defaultOutput = new OutputConfiguration(IFileSystemAccess.DEFAULT_OUTPUT);
+ defaultOutput.setDescription("Output Folder");
+ defaultOutput.setOutputDirectory("./");
+ defaultOutput.setOverrideExistingResources(true);
+ defaultOutput.setCreateOutputDirectory(true);
+ defaultOutput.setCleanUpDerivedResources(false);
+ defaultOutput.setSetDerivedProperty(false);
+ defaultOutput.setKeepLocalHistory(false);
+ HashMap<String, OutputConfiguration> outputConfigurations = new HashMap<String, OutputConfiguration>();
+ outputConfigurations.put(IFileSystemAccess.DEFAULT_OUTPUT, defaultOutput);
+ access.setOutputConfigurations(outputConfigurations);
+ return access;
+ }
+}
|