org.eclipse.xtext.xtext.generator.model.project.IBundleProjectConfig Java Examples
The following examples show how to use
org.eclipse.xtext.xtext.generator.model.project.IBundleProjectConfig.
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: XtextAntlrGeneratorComparisonFragment.java From xtext-extras with Eclipse Public License 2.0 | 4 votes |
@Override public void generate() { Naming _naming = this.getNaming(); boolean _tripleEquals = (_naming == null); if (_tripleEquals) { this.setNaming(this.createNaming()); } if ((this.options == null)) { AntlrOptions _antlrOptions = new AntlrOptions(); this.options = _antlrOptions; } final AntlrGrammarComparator.IErrorHandler errorHandler = this.createErrorHandler(); RuntimeException exception = null; IRuntimeProjectConfig _runtime = this.getProjectConfig().getRuntime(); IXtextGeneratorFileSystemAccess _srcGen = null; if (_runtime!=null) { _srcGen=_runtime.getSrcGen(); } boolean _tripleNotEquals = (_srcGen != null); if (_tripleNotEquals) { exception = this.loadAndCompareGrammars(this.getProjectConfig().getRuntime().getSrcGen(), Generator.SRC_GEN, errorHandler); } boolean _and = false; if (!(((!this.failOnError) || (exception == null)) && (!this.skipContentAssistGrammarComparison))) { _and = false; } else { IBundleProjectConfig _genericIde = this.getProjectConfig().getGenericIde(); IXtextGeneratorFileSystemAccess _srcGen_1 = null; if (_genericIde!=null) { _srcGen_1=_genericIde.getSrcGen(); } boolean _tripleNotEquals_1 = (_srcGen_1 != null); _and = _tripleNotEquals_1; } if (_and) { exception = this.loadAndCompareGrammars(this.getProjectConfig().getGenericIde().getSrcGen(), Generator.SRC_GEN_IDE, errorHandler); } XtextAntlrGeneratorComparisonFragment.deleteDir(this.getTmpFolder()); if ((this.failOnError && (exception != null))) { throw exception; } }
Example #2
Source File: XbaseGeneratorFragment2.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
protected boolean contributeEditorStub() { boolean _xblockexpression = false; { IBundleProjectConfig _eclipsePlugin = this.getProjectConfig().getEclipsePlugin(); IXtextGeneratorFileSystemAccess _srcGen = null; if (_eclipsePlugin!=null) { _srcGen=_eclipsePlugin.getSrcGen(); } boolean _tripleNotEquals = (_srcGen != null); if (_tripleNotEquals) { final GeneratedJavaFileAccess file = this.fileAccessFactory.createGeneratedJavaFile(this._xtextGeneratorNaming.getEclipsePluginEditor(this.getGrammar())); StringConcatenationClient _client = new StringConcatenationClient() { @Override protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { _builder.append("/**"); _builder.newLine(); _builder.append(" "); _builder.append("* This class was generated. Customizations should only happen in a newly"); _builder.newLine(); _builder.append(" "); _builder.append("* introduced subclass."); _builder.newLine(); _builder.append(" "); _builder.append("*/"); _builder.newLine(); _builder.append("public class "); String _simpleName = XbaseGeneratorFragment2.this._xtextGeneratorNaming.getEclipsePluginEditor(XbaseGeneratorFragment2.this.getGrammar()).getSimpleName(); _builder.append(_simpleName); _builder.append(" extends "); TypeReference _eclipsePluginXbaseEditor = XbaseGeneratorFragment2.this._xtextGeneratorNaming.getEclipsePluginXbaseEditor(XbaseGeneratorFragment2.this.getGrammar()); _builder.append(_eclipsePluginXbaseEditor); _builder.append(" {"); _builder.newLineIfNotEmpty(); _builder.append("}"); _builder.newLine(); } }; file.setContent(_client); file.writeTo(this.getProjectConfig().getEclipsePlugin().getSrcGen()); } boolean _xifexpression = false; ManifestAccess _manifest = this.getProjectConfig().getEclipsePlugin().getManifest(); boolean _tripleNotEquals_1 = (_manifest != null); if (_tripleNotEquals_1) { Set<String> _exportedPackages = this.getProjectConfig().getEclipsePlugin().getManifest().getExportedPackages(); String _packageName = this._xtextGeneratorNaming.getEclipsePluginEditor(this.getGrammar()).getPackageName(); _xifexpression = _exportedPackages.add(_packageName); } _xblockexpression = _xifexpression; } return _xblockexpression; }
Example #3
Source File: SimpleProjectWizardFragment2.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override public void generate() { if ((!this.generate)) { return; } IBundleProjectConfig _eclipsePlugin = this.getProjectConfig().getEclipsePlugin(); ManifestAccess _manifest = null; if (_eclipsePlugin!=null) { _manifest=_eclipsePlugin.getManifest(); } boolean _tripleNotEquals = (_manifest != null); if (_tripleNotEquals) { Set<String> _requiredBundles = this.getProjectConfig().getEclipsePlugin().getManifest().getRequiredBundles(); Iterables.<String>addAll(_requiredBundles, Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("org.eclipse.ui", "org.eclipse.core.runtime", "org.eclipse.core.resources", "org.eclipse.ui.ide"))); } GuiceModuleAccess.BindingFactory _bindingFactory = new GuiceModuleAccess.BindingFactory(); TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ui.wizard.IProjectCreator"); String _projectCreatorClassName = this.getProjectCreatorClassName(); TypeReference _typeReference_1 = new TypeReference(_projectCreatorClassName); _bindingFactory.addTypeToType(_typeReference, _typeReference_1).contributeTo(this.getLanguage().getEclipsePluginGenModule()); IBundleProjectConfig _eclipsePlugin_1 = this.getProjectConfig().getEclipsePlugin(); PluginXmlAccess _pluginXml = null; if (_eclipsePlugin_1!=null) { _pluginXml=_eclipsePlugin_1.getPluginXml(); } boolean _tripleNotEquals_1 = (_pluginXml != null); if (_tripleNotEquals_1) { List<CharSequence> _entries = this.getProjectConfig().getEclipsePlugin().getPluginXml().getEntries(); StringConcatenation _builder = new StringConcatenation(); _builder.append("<extension"); _builder.newLine(); _builder.append("\t"); _builder.append("point=\"org.eclipse.ui.newWizards\">"); _builder.newLine(); _builder.append("\t"); _builder.append("<wizard"); _builder.newLine(); _builder.append("\t\t"); _builder.append("category=\"org.eclipse.xtext.projectwiz\""); _builder.newLine(); _builder.append("\t\t"); _builder.append("class=\""); TypeReference _eclipsePluginExecutableExtensionFactory = this._xtextGeneratorNaming.getEclipsePluginExecutableExtensionFactory(this.getGrammar()); _builder.append(_eclipsePluginExecutableExtensionFactory, "\t\t"); _builder.append(":"); String _projectWizardClassName = this.getProjectWizardClassName(); _builder.append(_projectWizardClassName, "\t\t"); _builder.append("\""); _builder.newLineIfNotEmpty(); _builder.append("\t\t"); _builder.append("id=\""); String _projectWizardClassName_1 = this.getProjectWizardClassName(); _builder.append(_projectWizardClassName_1, "\t\t"); _builder.append("\""); _builder.newLineIfNotEmpty(); _builder.append("\t\t"); _builder.append("name=\""); String _simpleName = GrammarUtil.getSimpleName(this.getGrammar()); _builder.append(_simpleName, "\t\t"); _builder.append(" Project\""); _builder.newLineIfNotEmpty(); _builder.append("\t\t\t"); _builder.append("project=\"true\">"); _builder.newLine(); _builder.append("\t"); _builder.append("</wizard>"); _builder.newLine(); _builder.append("</extension>"); _builder.newLine(); _entries.add(_builder.toString()); } this.generateProjectInfo(); this.generateWizardNewProjectCreationPage(); this.generateNewProjectWizardInitialContents(); this.generateProjectCreator(); this.generateNewProjectWizard(); }
Example #4
Source File: QuickfixProviderFragment2.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
@Override public void generate() { GuiceModuleAccess.BindingFactory _bindingFactory = new GuiceModuleAccess.BindingFactory(); TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ui.editor.quickfix.IssueResolutionProvider"); _bindingFactory.addTypeToType(_typeReference, this.getQuickfixProviderClass(this.getGrammar())).contributeTo(this.getLanguage().getEclipsePluginGenModule()); boolean _isGenerateStub = this.isGenerateStub(); if (_isGenerateStub) { IBundleProjectConfig _eclipsePlugin = this.getProjectConfig().getEclipsePlugin(); IXtextGeneratorFileSystemAccess _src = null; if (_eclipsePlugin!=null) { _src=_eclipsePlugin.getSrc(); } boolean _tripleNotEquals = (_src != null); if (_tripleNotEquals) { boolean _isGenerateXtendStub = this.isGenerateXtendStub(); if (_isGenerateXtendStub) { this.generateXtendQuickfixProvider(); } else { this.generateJavaQuickfixProvider(); } } ManifestAccess _manifest = this.getProjectConfig().getEclipsePlugin().getManifest(); boolean _tripleNotEquals_1 = (_manifest != null); if (_tripleNotEquals_1) { Set<String> _exportedPackages = this.getProjectConfig().getEclipsePlugin().getManifest().getExportedPackages(); String _packageName = this.getQuickfixProviderClass(this.getGrammar()).getPackageName(); _exportedPackages.add(_packageName); } PluginXmlAccess _pluginXml = this.getProjectConfig().getEclipsePlugin().getPluginXml(); boolean _tripleNotEquals_2 = (_pluginXml != null); if (_tripleNotEquals_2) { this.addRegistrationToPluginXml(); } } else { IBundleProjectConfig _eclipsePlugin_1 = this.getProjectConfig().getEclipsePlugin(); IXtextGeneratorFileSystemAccess _srcGen = null; if (_eclipsePlugin_1!=null) { _srcGen=_eclipsePlugin_1.getSrcGen(); } boolean _tripleNotEquals_3 = (_srcGen != null); if (_tripleNotEquals_3) { this.generateGenQuickfixProvider(); } ManifestAccess _manifest_1 = this.getProjectConfig().getEclipsePlugin().getManifest(); boolean _tripleNotEquals_4 = (_manifest_1 != null); if (_tripleNotEquals_4) { Set<String> _exportedPackages_1 = this.getProjectConfig().getEclipsePlugin().getManifest().getExportedPackages(); String _packageName_1 = this.getQuickfixProviderClass(this.getGrammar()).getPackageName(); _exportedPackages_1.add(_packageName_1); } } }