Search in sources :

Example 1 with ManifestAccess

use of org.eclipse.xtext.xtext.generator.model.ManifestAccess in project xtext-core by eclipse.

the class Junit4Fragment2 method generate.

@Override
public void generate() {
    ManifestAccess _manifest = this.getProjectConfig().getRuntimeTest().getManifest();
    boolean _tripleNotEquals = (_manifest != null);
    if (_tripleNotEquals) {
        ManifestAccess _manifest_1 = this.getProjectConfig().getRuntimeTest().getManifest();
        final Procedure1<ManifestAccess> _function = (ManifestAccess it) -> {
            String _testingPackage = this.getTestingPackage();
            String _xbaseTestingPackage = this.getXbaseTestingPackage();
            String _xbaseLibVersionLowerBound = this.getProjectConfig().getRuntime().getXbaseLibVersionLowerBound();
            String _plus = ("org.eclipse.xtext.xbase.lib;bundle-version=\"" + _xbaseLibVersionLowerBound);
            String _plus_1 = (_plus + "\"");
            CollectionExtensions.<String>addAll(it.getRequiredBundles(), _testingPackage, _xbaseTestingPackage, _plus_1);
            String _runtimeTestBasePackage = this._xtextGeneratorNaming.getRuntimeTestBasePackage(this.getGrammar());
            String _plus_2 = (_runtimeTestBasePackage + ";x-internal=true");
            it.getExportedPackages().add(_plus_2);
        };
        ObjectExtensions.<ManifestAccess>operator_doubleArrow(_manifest_1, _function);
    }
    ManifestAccess _manifest_2 = this.getProjectConfig().getEclipsePluginTest().getManifest();
    boolean _tripleNotEquals_1 = (_manifest_2 != null);
    if (_tripleNotEquals_1) {
        ManifestAccess _manifest_3 = this.getProjectConfig().getEclipsePluginTest().getManifest();
        final Procedure1<ManifestAccess> _function_1 = (ManifestAccess it) -> {
            CollectionExtensions.<String>addAll(it.getRequiredBundles(), this.getTestingPackage(), this.getXbaseTestingPackage(), this.getUiTestingPackage(), this.getXbaseUiTestingPackage(), "org.eclipse.core.runtime", "org.eclipse.ui.workbench;resolution:=optional");
            String _eclipsePluginTestBasePackage = this._xtextGeneratorNaming.getEclipsePluginTestBasePackage(this.getGrammar());
            String _plus = (_eclipsePluginTestBasePackage + ";x-internal=true");
            it.getExportedPackages().add(_plus);
        };
        ObjectExtensions.<ManifestAccess>operator_doubleArrow(_manifest_3, _function_1);
    }
    ManifestAccess _manifest_4 = this.getProjectConfig().getEclipsePlugin().getManifest();
    boolean _tripleNotEquals_2 = (_manifest_4 != null);
    if (_tripleNotEquals_2) {
        this.getProjectConfig().getEclipsePlugin().getManifest().getExportedPackages().add(this._xtextGeneratorNaming.getEclipsePluginActivator().getPackageName());
    }
    ManifestAccess _manifest_5 = this.getProjectConfig().getRuntimeTest().getManifest();
    ManifestAccess _manifest_6 = this.getProjectConfig().getEclipsePluginTest().getManifest();
    final Consumer<ManifestAccess> _function_2 = (ManifestAccess it) -> {
        CollectionExtensions.<String>addAll(it.getImportedPackages(), "org.junit;version=\"4.5.0\"", "org.junit.runner;version=\"4.5.0\"", "org.junit.runner.manipulation;version=\"4.5.0\"", "org.junit.runner.notification;version=\"4.5.0\"", "org.junit.runners;version=\"4.5.0\"", "org.junit.runners.model;version=\"4.5.0\"", "org.hamcrest.core");
    };
    IterableExtensions.<ManifestAccess>filterNull(Collections.<ManifestAccess>unmodifiableList(CollectionLiterals.<ManifestAccess>newArrayList(_manifest_5, _manifest_6))).forEach(_function_2);
    this.generateInjectorProvider().writeTo(this.getProjectConfig().getRuntimeTest().getSrcGen());
    boolean _isGenerateStub = this.isGenerateStub();
    if (_isGenerateStub) {
        this.generateExampleRuntimeTest().writeTo(this.getProjectConfig().getRuntimeTest().getSrc());
    }
    IXtextGeneratorFileSystemAccess _srcGen = this.getProjectConfig().getEclipsePlugin().getSrcGen();
    boolean _tripleNotEquals_3 = (_srcGen != null);
    if (_tripleNotEquals_3) {
        this.generateUiInjectorProvider().writeTo(this.getProjectConfig().getEclipsePluginTest().getSrcGen());
    }
}
Also used : ManifestAccess(org.eclipse.xtext.xtext.generator.model.ManifestAccess) IXtextGeneratorFileSystemAccess(org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess)

Example 2 with ManifestAccess

use of org.eclipse.xtext.xtext.generator.model.ManifestAccess in project xtext-core by eclipse.

the class OutlineTreeProviderFragment2 method generate.

@Override
public void generate() {
    ManifestAccess _manifest = this.getProjectConfig().getEclipsePlugin().getManifest();
    boolean _tripleNotEquals = (_manifest != null);
    if (_tripleNotEquals) {
        Set<String> _requiredBundles = this.getProjectConfig().getEclipsePlugin().getManifest().getRequiredBundles();
        _requiredBundles.add("org.eclipse.xtext.ui");
    }
    boolean _isGenerateStub = this.isGenerateStub();
    boolean _not = (!_isGenerateStub);
    if (_not) {
        return;
    }
    IXtextGeneratorFileSystemAccess _src = this.getProjectConfig().getEclipsePlugin().getSrc();
    boolean _tripleNotEquals_1 = (_src != null);
    if (_tripleNotEquals_1) {
        boolean _isGenerateXtendStub = this.isGenerateXtendStub();
        if (_isGenerateXtendStub) {
            this.generateXtendOutlineTreeProvider();
        } else {
            this.generateJavaOutlineTreeProvider();
        }
    }
    GuiceModuleAccess.BindingFactory _bindingFactory = new GuiceModuleAccess.BindingFactory();
    TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider");
    GuiceModuleAccess.BindingFactory _addTypeToType = _bindingFactory.addTypeToType(_typeReference, this.getOutlineTreeProviderClass(this.getGrammar()));
    TypeReference _typeReference_1 = new TypeReference("org.eclipse.xtext.ui.editor.outline.impl.IOutlineTreeStructureProvider");
    _addTypeToType.addTypeToType(_typeReference_1, this.getOutlineTreeProviderClass(this.getGrammar())).contributeTo(this.getLanguage().getEclipsePluginGenModule());
}
Also used : GuiceModuleAccess(org.eclipse.xtext.xtext.generator.model.GuiceModuleAccess) ManifestAccess(org.eclipse.xtext.xtext.generator.model.ManifestAccess) IXtextGeneratorFileSystemAccess(org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess) TypeReference(org.eclipse.xtext.xtext.generator.model.TypeReference)

Example 3 with ManifestAccess

use of org.eclipse.xtext.xtext.generator.model.ManifestAccess in project xtext-core by eclipse.

the class SimpleProjectWizardFragment2 method generate.

@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();
}
Also used : GuiceModuleAccess(org.eclipse.xtext.xtext.generator.model.GuiceModuleAccess) IBundleProjectConfig(org.eclipse.xtext.xtext.generator.model.project.IBundleProjectConfig) PluginXmlAccess(org.eclipse.xtext.xtext.generator.model.PluginXmlAccess) ManifestAccess(org.eclipse.xtext.xtext.generator.model.ManifestAccess) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TypeReference(org.eclipse.xtext.xtext.generator.model.TypeReference)

Example 4 with ManifestAccess

use of org.eclipse.xtext.xtext.generator.model.ManifestAccess in project xtext-core by eclipse.

the class TemplateProjectWizardFragment method generate.

@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.core.runtime", "org.eclipse.core.resources", "org.eclipse.ui", "org.eclipse.ui.ide", "org.eclipse.ui.forms")));
        if (this.pluginProject) {
            Set<String> _requiredBundles_1 = this.getProjectConfig().getEclipsePlugin().getManifest().getRequiredBundles();
            Iterables.<String>addAll(_requiredBundles_1, Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("org.eclipse.jdt.core", "org.eclipse.pde.core")));
        }
        Set<String> _exportedPackages = this.getProjectConfig().getEclipsePlugin().getManifest().getExportedPackages();
        String _eclipsePluginBasePackage = this._xtextGeneratorNaming.getEclipsePluginBasePackage(this.getGrammar());
        String _plus = (_eclipsePluginBasePackage + ".wizard");
        Iterables.<String>addAll(_exportedPackages, Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList(_plus)));
    }
    GuiceModuleAccess.BindingFactory _bindingFactory = new GuiceModuleAccess.BindingFactory();
    TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ui.wizard.IProjectCreator");
    TypeReference _typeReference_1 = new TypeReference("org.eclipse.xtext.ui.wizard.template.DefaultTemplateProjectCreator");
    _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("<category id=\"");
        String _eclipsePluginBasePackage_1 = this._xtextGeneratorNaming.getEclipsePluginBasePackage(this.getGrammar());
        _builder.append(_eclipsePluginBasePackage_1, "\t");
        _builder.append(".category\" name=\"");
        String _simpleName = GrammarUtil.getSimpleName(this.getGrammar());
        _builder.append(_simpleName, "\t");
        _builder.append("\">");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("</category>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<wizard");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("category=\"");
        String _eclipsePluginBasePackage_2 = this._xtextGeneratorNaming.getEclipsePluginBasePackage(this.getGrammar());
        _builder.append(_eclipsePluginBasePackage_2, "\t\t");
        _builder.append(".category\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("class=\"");
        TypeReference _eclipsePluginExecutableExtensionFactory = this._xtextGeneratorNaming.getEclipsePluginExecutableExtensionFactory(this.getGrammar());
        _builder.append(_eclipsePluginExecutableExtensionFactory, "\t\t");
        _builder.append(":org.eclipse.xtext.ui.wizard.template.TemplateNewProjectWizard\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("id=\"");
        String _projectWizardClassName = this.getProjectWizardClassName();
        _builder.append(_projectWizardClassName, "\t\t");
        _builder.append("\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("name=\"");
        String _simpleName_1 = GrammarUtil.getSimpleName(this.getGrammar());
        _builder.append(_simpleName_1, "\t\t");
        _builder.append(" Project\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("icon=\"icons/new_");
        String _simpleName_2 = GrammarUtil.getSimpleName(this.getGrammar());
        _builder.append(_simpleName_2, "\t\t");
        _builder.append("_proj.gif\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("project=\"true\">");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("</wizard>");
        _builder.newLine();
        _builder.append("</extension>");
        _builder.newLine();
        _builder.append("<extension");
        _builder.newLine();
        _builder.append("      ");
        _builder.append("point=\"org.eclipse.xtext.ui.projectTemplate\">");
        _builder.newLine();
        _builder.append("   ");
        _builder.append("<projectTemplateProvider");
        _builder.newLine();
        _builder.append("         ");
        _builder.append("class=\"");
        String _projectTemplateProviderClassName = this.getProjectTemplateProviderClassName();
        _builder.append(_projectTemplateProviderClassName, "         ");
        _builder.append("\"");
        _builder.newLineIfNotEmpty();
        _builder.append("         ");
        _builder.append("grammarName=\"");
        String _name = this.getGrammar().getName();
        _builder.append(_name, "         ");
        _builder.append("\">");
        _builder.newLineIfNotEmpty();
        _builder.append("   ");
        _builder.append("</projectTemplateProvider>");
        _builder.newLine();
        _builder.append("</extension>");
        _builder.newLine();
        _entries.add(_builder.toString());
    }
    this.generateProjectTemplateProvider();
    this.generateDefaultIcons();
}
Also used : GuiceModuleAccess(org.eclipse.xtext.xtext.generator.model.GuiceModuleAccess) IBundleProjectConfig(org.eclipse.xtext.xtext.generator.model.project.IBundleProjectConfig) PluginXmlAccess(org.eclipse.xtext.xtext.generator.model.PluginXmlAccess) ManifestAccess(org.eclipse.xtext.xtext.generator.model.ManifestAccess) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TypeReference(org.eclipse.xtext.xtext.generator.model.TypeReference)

Example 5 with ManifestAccess

use of org.eclipse.xtext.xtext.generator.model.ManifestAccess in project xtext-core by eclipse.

the class RefactorElementNameFragment2 method generate.

@Override
public void generate() {
    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();
        _requiredBundles.add("org.eclipse.xtext.ui");
    }
    final GuiceModuleAccess.BindingFactory uiBindings = new GuiceModuleAccess.BindingFactory();
    String _join = IterableExtensions.join(TypeReference.typeRef("org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer").getSimpleNames(), ".");
    StringConcatenationClient _client = new StringConcatenationClient() {

        @Override
        protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
            _builder.append("binder.bind(");
            TypeReference _typeRef = TypeReference.typeRef("org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer");
            _builder.append(_typeRef);
            _builder.append(".class)");
            _builder.newLineIfNotEmpty();
            _builder.append("\t");
            _builder.append(".annotatedWith(");
            _builder.append(Names.class, "\t");
            _builder.append(".named(\"RefactoringPreferences\"))");
            _builder.newLineIfNotEmpty();
            _builder.append("\t");
            _builder.append(".to(");
            TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ui.refactoring.ui", "RefactoringPreferences.Initializer");
            _builder.append(_typeReference, "\t");
            _builder.append(".class);");
            _builder.newLineIfNotEmpty();
        }
    };
    uiBindings.addConfiguredBinding(_join, _client);
    boolean _isUseChangeSerializer = this.isUseChangeSerializer(this.getGrammar());
    if (_isUseChangeSerializer) {
        TypeReference _typeRef = TypeReference.typeRef("org.eclipse.xtext.ide.refactoring.IRenameStrategy2");
        TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ide.refactoring", "IRenameStrategy2.DefaultImpl");
        uiBindings.addTypeToType(_typeRef, _typeReference).addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.impl.AbstractRenameProcessor"), TypeReference.typeRef("org.eclipse.xtext.ui.refactoring2.rename.RenameElementProcessor2")).addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.ILinkedPositionGroupCalculator"), TypeReference.typeRef("org.eclipse.xtext.ui.refactoring2.rename.DefaultLinkedPositionGroupCalculator2"));
    } else {
        uiBindings.addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.IRenameStrategy"), TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.impl.DefaultRenameStrategy")).addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.IReferenceUpdater"), TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.impl.DefaultReferenceUpdater"));
    }
    boolean _isUseJdtRefactoring = this.isUseJdtRefactoring(this.getGrammar());
    if (_isUseJdtRefactoring) {
        GuiceModuleAccess.BindingFactory _addTypeToType = uiBindings.addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.ui.IRenameContextFactory"), TypeReference.typeRef("org.eclipse.xtext.common.types.ui.refactoring.JdtRefactoringContextFactory")).addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.IRenameRefactoringProvider"), TypeReference.typeRef("org.eclipse.xtext.common.types.ui.refactoring.JvmRenameRefactoringProvider"));
        TypeReference _typeReference_1 = new TypeReference("org.eclipse.xtext.ui.refactoring.ui", "IRenameSupport.Factory");
        TypeReference _typeReference_2 = new TypeReference("org.eclipse.xtext.common.types.ui.refactoring", "JdtRenameSupport.Factory");
        GuiceModuleAccess.BindingFactory _addTypeToType_1 = _addTypeToType.addTypeToType(_typeReference_1, _typeReference_2);
        TypeReference _typeReference_3 = new TypeReference("org.eclipse.xtext.ui.refactoring", "IRenameStrategy.Provider");
        TypeReference _typeReference_4 = new TypeReference("org.eclipse.xtext.common.types.ui.refactoring.participant", "JvmMemberRenameStrategy.Provider");
        GuiceModuleAccess.BindingFactory _addTypeToType_2 = _addTypeToType_1.addTypeToType(_typeReference_3, _typeReference_4);
        StringConcatenationClient _client_1 = new StringConcatenationClient() {

            @Override
            protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
                _builder.append("binder.bind(");
                TypeReference _typeReference = new TypeReference("org.eclipse.xtext.ui.refactoring", "IRenameStrategy.Provider");
                _builder.append(_typeReference);
                _builder.append(".class).annotatedWith(");
                TypeReference _typeReference_1 = new TypeReference("org.eclipse.xtext.common.types.ui.refactoring.participant", "JvmMemberRenameStrategy.Provider.Delegate");
                _builder.append(_typeReference_1);
                _builder.append(".class).to(");
                TypeReference _typeRef = TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.impl.DefaultRenameStrategyProvider");
                _builder.append(_typeRef);
                _builder.append(".class);");
                _builder.newLineIfNotEmpty();
            }
        };
        _addTypeToType_2.addConfiguredBinding("JvmMemberRenameStrategy.Provider.Delegate", _client_1);
    } else {
        GuiceModuleAccess.BindingFactory _addTypeToType_3 = uiBindings.addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.IRenameRefactoringProvider"), TypeReference.typeRef("org.eclipse.xtext.ui.refactoring.impl.DefaultRenameRefactoringProvider"));
        TypeReference _typeReference_5 = new TypeReference("org.eclipse.xtext.ui.refactoring.ui", "IRenameSupport.Factory");
        TypeReference _typeReference_6 = new TypeReference("org.eclipse.xtext.ui.refactoring.ui", "DefaultRenameSupport.Factory");
        _addTypeToType_3.addTypeToType(_typeReference_5, _typeReference_6);
    }
    uiBindings.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("<!-- Rename Refactoring -->");
        _builder.newLine();
        _builder.append("<extension point=\"org.eclipse.ui.handlers\">");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<handler ");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("class=\"");
        TypeReference _eclipsePluginExecutableExtensionFactory = this._xtextGeneratorNaming.getEclipsePluginExecutableExtensionFactory(this.getGrammar());
        _builder.append(_eclipsePluginExecutableExtensionFactory, "\t\t");
        _builder.append(":org.eclipse.xtext.ui.refactoring.ui.DefaultRenameElementHandler\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("commandId=\"org.eclipse.xtext.ui.refactoring.RenameElement\">");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<activeWhen>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<reference");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("definitionId=\"");
        String _name = this.getGrammar().getName();
        _builder.append(_name, "\t\t\t\t");
        _builder.append(".Editor.opened\">");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t\t");
        _builder.append("</reference>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</activeWhen>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("</handler>");
        _builder.newLine();
        _builder.append("</extension>");
        _builder.newLine();
        _builder.append("<extension point=\"org.eclipse.ui.menus\">");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<menuContribution");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("locationURI=\"popup:#TextEditorContext?after=group.edit\">");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<command commandId=\"org.eclipse.xtext.ui.refactoring.RenameElement\"");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("style=\"push\">");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<visibleWhen checkEnabled=\"false\">");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<reference");
        _builder.newLine();
        _builder.append("\t\t\t\t\t");
        _builder.append("definitionId=\"");
        String _name_1 = this.getGrammar().getName();
        _builder.append(_name_1, "\t\t\t\t\t");
        _builder.append(".Editor.opened\">");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t\t\t");
        _builder.append("</reference>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("</visibleWhen>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</command>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("</menuContribution>");
        _builder.newLine();
        _builder.append("</extension>");
        _builder.newLine();
        _builder.append("<extension point=\"org.eclipse.ui.preferencePages\">");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<page");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("category=\"");
        String _name_2 = this.getGrammar().getName();
        _builder.append(_name_2, "\t\t");
        _builder.append("\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("class=\"");
        TypeReference _eclipsePluginExecutableExtensionFactory_1 = this._xtextGeneratorNaming.getEclipsePluginExecutableExtensionFactory(this.getGrammar());
        _builder.append(_eclipsePluginExecutableExtensionFactory_1, "\t\t");
        _builder.append(":org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferencePage\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("id=\"");
        String _name_3 = this.getGrammar().getName();
        _builder.append(_name_3, "\t\t");
        _builder.append(".refactoring\"");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t");
        _builder.append("name=\"Refactoring\">");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<keywordReference id=\"");
        String _runtimeBasePackage = this._xtextGeneratorNaming.getRuntimeBasePackage(this.getGrammar());
        String _plus = (_runtimeBasePackage + ".ui.keyword_");
        String _simpleName = GrammarUtil.getSimpleName(this.getGrammar());
        String _plus_1 = (_plus + _simpleName);
        _builder.append(_plus_1, "\t\t");
        _builder.append("\"/>");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("</page>");
        _builder.newLine();
        _builder.append("</extension>");
        _builder.newLine();
        _entries.add(_builder.toString());
    }
    boolean _isEnabled = this.getProjectConfig().getGenericIde().isEnabled();
    if (_isEnabled) {
        final GuiceModuleAccess.BindingFactory ideBindings = new GuiceModuleAccess.BindingFactory();
        ideBindings.addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ide.server.rename.IRenameService"), TypeReference.typeRef("org.eclipse.xtext.ide.server.rename.RenameService"));
        TypeReference _typeRef_1 = TypeReference.typeRef("org.eclipse.xtext.ide.refactoring.IRenameStrategy2");
        TypeReference _typeReference_7 = new TypeReference("org.eclipse.xtext.ide.refactoring", "IRenameStrategy2.DefaultImpl");
        ideBindings.addTypeToType(_typeRef_1, _typeReference_7);
        ideBindings.contributeTo(this.getLanguage().getIdeGenModule());
    }
}
Also used : GuiceModuleAccess(org.eclipse.xtext.xtext.generator.model.GuiceModuleAccess) IBundleProjectConfig(org.eclipse.xtext.xtext.generator.model.project.IBundleProjectConfig) PluginXmlAccess(org.eclipse.xtext.xtext.generator.model.PluginXmlAccess) StringConcatenationClient(org.eclipse.xtend2.lib.StringConcatenationClient) ManifestAccess(org.eclipse.xtext.xtext.generator.model.ManifestAccess) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) TypeReference(org.eclipse.xtext.xtext.generator.model.TypeReference)

Aggregations

ManifestAccess (org.eclipse.xtext.xtext.generator.model.ManifestAccess)27 GuiceModuleAccess (org.eclipse.xtext.xtext.generator.model.GuiceModuleAccess)18 TypeReference (org.eclipse.xtext.xtext.generator.model.TypeReference)17 StringConcatenationClient (org.eclipse.xtend2.lib.StringConcatenationClient)12 PluginXmlAccess (org.eclipse.xtext.xtext.generator.model.PluginXmlAccess)12 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)7 IBundleProjectConfig (org.eclipse.xtext.xtext.generator.model.project.IBundleProjectConfig)6 IXtextGeneratorFileSystemAccess (org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess)5 Set (java.util.Set)3 Extension (org.eclipse.xtext.xbase.lib.Extension)3 ContentAssistGrammarNaming (org.eclipse.xtext.xtext.generator.parser.antlr.ContentAssistGrammarNaming)3 Names (com.google.inject.name.Names)1 List (java.util.List)1 GenPackage (org.eclipse.emf.codegen.ecore.genmodel.GenPackage)1 EPackage (org.eclipse.emf.ecore.EPackage)1 AbstractIDValueConverter (org.eclipse.xtext.conversion.impl.AbstractIDValueConverter)1 IgnoreCaseIDValueConverter (org.eclipse.xtext.conversion.impl.IgnoreCaseIDValueConverter)1 IFormatter2 (org.eclipse.xtext.formatting2.IFormatter2)1 IParser (org.eclipse.xtext.parser.IParser)1 AntlrTokenDefProvider (org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider)1