aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-04-23 14:06:55 (EDT)
committersefftinge2009-04-23 14:06:55 (EDT)
commit97039567dac43645600237fcf71cb156c37d8005 (patch)
tree80ce41cfce2295ad26f99085e7f78ad4097bbb71
parentfa4be2798894adf7d630112c5783fc8df41c4a18 (diff)
downloadorg.eclipse.xtext-97039567dac43645600237fcf71cb156c37d8005.zip
org.eclipse.xtext-97039567dac43645600237fcf71cb156c37d8005.tar.gz
org.eclipse.xtext-97039567dac43645600237fcf71cb156c37d8005.tar.bz2
Refactored Content Assist: Abstractions and generated code reviewed, Handling of Selections and replace regions improved, exemplary implementation of LinkedEditing, added support for ContextInformation
-rw-r--r--devtools/org.eclipse.xtext.reference.ui/META-INF/MANIFEST.MF3
-rw-r--r--devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarProposalProvider.java239
-rw-r--r--devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarUiModule.java2
-rw-r--r--devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/GenReferenceGrammarProposalProvider.java256
-rw-r--r--devtools/org.eclipse.xtext.reference.ui/src/org/eclipse/xtext/reference/ReferenceGrammarProposalProvider.java2
-rw-r--r--devtools/org.eclipse.xtext.reference/plugin.properties8
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel.ui/META-INF/MANIFEST.MF1
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelProposalProvider.java298
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelUiModule.java2
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/GenDomainmodelProposalProvider.java321
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel.ui/src/org/eclipse/xtext/example/DomainmodelProposalProvider.java2
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/plugin.properties8
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF3
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslProposalProvider.java919
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java2
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/GenEcoreDslProposalProvider.java961
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java28
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslTemplateProposalProvider.java43
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUiModule.java11
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml20
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl/plugin.properties8
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl.ui/META-INF/MANIFEST.MF1
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslProposalProvider.java165
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslUiModule.java2
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/GenFowlerDslProposalProvider.java180
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslActivator.java7
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslProposalProvider.java23
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslTemplateProposalProvider.java38
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslUiModule.java6
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/plugin.properties8
-rw-r--r--plugins/org.eclipse.xtext.ui.common/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IContentAssistContext.java50
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IProposalProvider.java106
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/ITemplateContentAssistProcessor.java32
-rwxr-xr-xplugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentProposalProvider.java146
-rwxr-xr-xplugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractJavaBasedContentProposalProvider.java232
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractJavaProposalProvider.java272
-rwxr-xr-xplugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTemplateProposalProvider.java110
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ConfigurableCompletionProposal.java349
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistContext.java98
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistContextFactory.java38
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/CrossReferenceTemplateVariableResolver.java83
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java147
-rwxr-xr-xplugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistContextFactory.java162
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessor.java316
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistantFactory.java70
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultFollowElementCalculator.java151
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultTemplateContentAssistProcessor.java96
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultTemplateProposalProvider.java170
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/JavaReflectiveMethodInvoker.java129
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ProposalFilterSorterUtil.java67
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextCompletionProposal.java86
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContext.java14
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContextType.java94
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/DefaultUIModule.java40
-rw-r--r--plugins/org.eclipse.xtext.ui.core/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextSourceViewerConfiguration.java16
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/CompletionProposalComputer.java82
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ContentAssistContext.java173
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ContextInformationComputer.java61
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ICompletionProposalAcceptor.java42
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ICompletionProposalComparator.java27
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContentAssistantFactory.java21
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContentProposalProvider.java17
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContextInformationAcceptor.java43
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContextInformationProvider.java17
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IFollowElementCalculator.java (renamed from plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IContentAssistCalculator.java)31
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ITemplateAcceptor.java42
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ITemplateProposalProvider.java17
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/PrefixMatcher.java19
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/XtextContentAssistProcessor.java176
-rw-r--r--plugins/org.eclipse.xtext.ui.generator/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/ContentAssist.ext10
-rw-r--r--plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java34
-rwxr-xr-xplugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.xpt107
-rw-r--r--plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendBasedContentAssistFragment.java4
-rw-r--r--plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendProposals.xpt12
-rw-r--r--plugins/org.eclipse.xtext.xtend/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/AbstractXtendService.java47
-rw-r--r--plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/InjectableResourceManager.java31
-rw-r--r--plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/XtendServiceHelper.java74
-rw-r--r--plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/AbstractXtendProposalProvider.java146
-rw-r--r--plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssist.ext17
-rw-r--r--plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssistHelper.java15
-rw-r--r--plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/Scope.java3
-rwxr-xr-xplugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/XtendScopeProvider.java24
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/plugin.properties8
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageProposalProvider.java690
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageUiModule.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageProposalProvider.java610
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageProposalProvider.java63
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.java54
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageProposalProvider.java65
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.java71
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageProposalProvider.java109
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageUiModule.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageProposalProvider.java205
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageUiModule.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageProposalProvider.java72
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageUiModule.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenContentAssistTestLanguageProposalProvider.java117
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageProposalProvider.java222
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenTreeTestLanguageProposalProvider.java78
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageProposalProvider.java64
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageUiModule.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/GenTwoContextsTestLanguageProposalProvider.java69
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/XtextGrammarTestLanguageProposalProvider.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageProposalProvider.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ContentAssistTestLanguageProposalProvider.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ReferenceGrammarTestLanguageProposalProvider.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/TreeTestLanguageProposalProvider.java2
-rwxr-xr-xtests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentAssistProcessorTest.java68
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java99
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java90
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/MockableSelectionProvider.java35
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/MockableTextViewer.java199
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/TwoContextsContentAssistTest.java30
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/TwoContextsTestLanguageProposalProvider.java26
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/tests/AllTests.java2
-rw-r--r--tests/org.eclipse.xtext.ui.integration.tests/META-INF/MANIFEST.MF1
-rw-r--r--tests/org.eclipse.xtext.ui.integration.tests/plugin.properties8
-rw-r--r--tests/org.eclipse.xtext.ui.integration.tests/src-gen/org/eclipse/xtext/ui/integration/AbstractTestLanguageProposalProvider.java56
-rw-r--r--tests/org.eclipse.xtext.ui.integration.tests/src-gen/org/eclipse/xtext/ui/integration/AbstractTestLanguageUiModule.java2
-rw-r--r--tests/org.eclipse.xtext.ui.integration.tests/src-gen/org/eclipse/xtext/ui/integration/GenTestLanguageProposalProvider.java60
-rw-r--r--tests/org.eclipse.xtext.ui.integration.tests/src/org/eclipse/xtext/ui/integration/TestLanguageProposalProvider.java2
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/plugin.properties8
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageProposalProvider.ext (renamed from tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageProposalProvider.ext)289
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageUiModule.java5
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageProposalProvider.ext (renamed from tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.ext)17
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java5
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageProposalProvider.ext (renamed from tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.ext)19
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java5
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageProposalProvider.ext (renamed from tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/GenContentAssistTestLanguageProposalProvider.ext)35
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageUiModule.java5
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageProposalProvider.ext (renamed from tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageProposalProvider.ext)79
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageUiModule.java5
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageProposalProvider.ext (renamed from tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/GenTreeTestLanguageProposalProvider.ext)21
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageUiModule.java5
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/XtextGrammarTestLanguageProposalProvider.ext2
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.ext2
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageProposalProvider.ext2
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/testlanguages/ContentAssistTestLanguageProposalProvider.ext2
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/testlanguages/ReferenceGrammarTestLanguageProposalProvider.ext2
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/testlanguages/TreeTestLanguageProposalProvider.ext2
-rwxr-xr-xtests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/contentassist/XtendContentAssistProcessorTest.java4
-rw-r--r--tests/org.eclipse.xtext.xtend.tests/src/org/eclipse/xtext/xtend/crossref/XtendScopeProviderTest.java6
149 files changed, 6340 insertions, 5325 deletions
diff --git a/devtools/org.eclipse.xtext.reference.ui/META-INF/MANIFEST.MF b/devtools/org.eclipse.xtext.reference.ui/META-INF/MANIFEST.MF
index 616a87d..2168327 100644
--- a/devtools/org.eclipse.xtext.reference.ui/META-INF/MANIFEST.MF
+++ b/devtools/org.eclipse.xtext.reference.ui/META-INF/MANIFEST.MF
@@ -6,6 +6,7 @@ Bundle-Version: 0.7.0.qualifier
Require-Bundle: org.eclipse.xtext.reference,
org.eclipse.xtext.ui.core,
org.eclipse.xtext.ui.common,
+ org.eclipse.xtext.xtext.ui,
org.eclipse.xtext.xtend;bundle-version="0.7.0";resolution:=optional,
org.eclipse.ui.editors,
org.eclipse.ui
@@ -13,4 +14,4 @@ Bundle-Vendor: Eclipse Modeling Project
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.xtext.reference.ui.Activator
-
+Export-Package: org.eclipse.xtext.reference
diff --git a/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarProposalProvider.java b/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarProposalProvider.java
new file mode 100644
index 0000000..e11cb40
--- /dev/null
+++ b/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarProposalProvider.java
@@ -0,0 +1,239 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.reference;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractReferenceGrammarProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractReferenceGrammarProposalProvider.class);
+
+ public void completeSpielplatz_Groesse(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Groesse feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Beschreibung(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Beschreibung feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Kinder(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Kinder feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Erzieher(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Erzieher feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Spielzeuge(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Spielzeuge feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Familie(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Familie feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Types(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Types feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeKind_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeKind_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeKind_Age(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeKind_Age feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeErwachsener_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeErwachsener_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeErwachsener_Age(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeErwachsener_Age feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielzeug_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielzeug_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielzeug_Farbe(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielzeug_Farbe feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFamilie_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFamilie_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getGroups().get(1)), context, acceptor);
+ completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getGroups().get(2)), context, acceptor);
+ }
+ public void completeFamilie_Mutter(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFamilie_Mutter feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFamilie_Vater(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFamilie_Vater feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFamilie_Kinder(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFamilie_Kinder feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFarbe_Wert(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFarbe_Wert feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ // subclasses may override
+ // subclasses may override
+ // subclasses may override
+ }
+ public void completeCustomTypeParserRule_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeCustomTypeParserRule_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_Spielplatz(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Spielplatz '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Person(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Person '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Kind(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Kind '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Erwachsener(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Erwachsener '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Spielzeug(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Spielzeug '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Familie(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Familie '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Farbe(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Farbe '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_CustomTypeParserRule(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_CustomTypeParserRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarUiModule.java b/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarUiModule.java
index 285bd83..e4d7c17 100644
--- a/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarUiModule.java
+++ b/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/AbstractReferenceGrammarUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractReferenceGrammarUiModule extends DefaultUIModule {
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.reference.ReferenceGrammarProposalProvider.class;
}
diff --git a/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/GenReferenceGrammarProposalProvider.java b/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/GenReferenceGrammarProposalProvider.java
deleted file mode 100644
index 2f85c2c..0000000
--- a/devtools/org.eclipse.xtext.reference.ui/src-gen/org/eclipse/xtext/reference/GenReferenceGrammarProposalProvider.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.reference;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenReferenceGrammarProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeSpielplatz_Groesse(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Groesse feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Beschreibung(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Beschreibung feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"Spielplatz_Beschreibung\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Kinder(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Kinder feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Erzieher(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Erzieher feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Spielzeuge(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Spielzeuge feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Familie(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Familie feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Types(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Types feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeKind_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKind_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Kind_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeKind_Age(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKind_Age feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeErwachsener_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeErwachsener_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Erwachsener_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeErwachsener_Age(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeErwachsener_Age feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielzeug_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielzeug_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Spielzeug_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielzeug_Farbe(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielzeug_Farbe feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeFamilie_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeFamilie_Mutter(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie_Mutter feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeFamilie_Vater(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie_Vater feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeFamilie_Kinder(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie_Kinder feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
-
- public List<? extends ICompletionProposal> completeFarbe_Wert(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFarbe_Wert feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeCustomTypeParserRule_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCustomTypeParserRule_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "CustomTypeParserRule_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completePerson(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completePerson '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeKind(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKind '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeErwachsener(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeErwachsener '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeSpielzeug(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielzeug '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeFamilie(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeFarbe(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFarbe '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeReferenceModel_CustomType(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReferenceModel_CustomType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/devtools/org.eclipse.xtext.reference.ui/src/org/eclipse/xtext/reference/ReferenceGrammarProposalProvider.java b/devtools/org.eclipse.xtext.reference.ui/src/org/eclipse/xtext/reference/ReferenceGrammarProposalProvider.java
index 7a61095..7fbaf4b 100644
--- a/devtools/org.eclipse.xtext.reference.ui/src/org/eclipse/xtext/reference/ReferenceGrammarProposalProvider.java
+++ b/devtools/org.eclipse.xtext.reference.ui/src/org/eclipse/xtext/reference/ReferenceGrammarProposalProvider.java
@@ -1,6 +1,6 @@
package org.eclipse.xtext.reference;
-public class ReferenceGrammarProposalProvider extends org.eclipse.xtext.reference.GenReferenceGrammarProposalProvider {
+public class ReferenceGrammarProposalProvider extends org.eclipse.xtext.reference.AbstractReferenceGrammarProposalProvider {
}
diff --git a/devtools/org.eclipse.xtext.reference/plugin.properties b/devtools/org.eclipse.xtext.reference/plugin.properties
new file mode 100644
index 0000000..1b1dffa
--- /dev/null
+++ b/devtools/org.eclipse.xtext.reference/plugin.properties
@@ -0,0 +1,8 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id: plugin.properties,v 1.1 2009/04/23 18:07:14 szarnekow Exp $
+
+pluginName = ReferenceGrammar Model
+providerName = www.example.org
diff --git a/examples/org.eclipse.xtext.example.domainmodel.ui/META-INF/MANIFEST.MF b/examples/org.eclipse.xtext.example.domainmodel.ui/META-INF/MANIFEST.MF
index 200c6b9..1cb3950 100644
--- a/examples/org.eclipse.xtext.example.domainmodel.ui/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.xtext.example.domainmodel.ui/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xtext.example.domainmodel,
org.eclipse.xtext.ui.core,
org.eclipse.xtext.ui.common,
+ org.eclipse.xtext.xtext.ui,
org.eclipse.xtext.log4j;bundle-version="1.2.15",
org.eclipse.ui.editors,
org.eclipse.xtext.xtend;bundle-version="0.7.0";resolution:=optional,
diff --git a/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelProposalProvider.java b/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelProposalProvider.java
new file mode 100644
index 0000000..ebc3372
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelProposalProvider.java
@@ -0,0 +1,298 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.example;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractDomainmodelProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractDomainmodelProposalProvider.class);
+
+ public void completeFile_Imports(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFile_Imports feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFile_NamedElements(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFile_NamedElements feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeImport_ImportURI(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeImport_ImportURI feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completePackage_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completePackage_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completePackage_NamedElements(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completePackage_NamedElements feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeDataType_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeDataType_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEntity_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEntity_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEntity_SuperType(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEntity_SuperType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEntity_Features(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEntity_Features feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAttribute_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAttribute_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAttribute_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAttribute_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeReference_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeReference_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeReference_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeReference_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeReference_Opposite(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeReference_Opposite feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeOperation_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeOperation_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeOperation_Params(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeOperation_Params feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeOperation_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeOperation_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeParameter_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeParameter_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeParameter_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeParameter_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTypeRef_Referenced(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTypeRef_Referenced feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_File(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_File '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Import(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Import '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_NamedElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_NamedElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Package(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Package '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Type(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Type '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_DataType(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_DataType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Entity(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Entity '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Feature(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Feature '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_StructuralFeature(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_StructuralFeature '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Attribute(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Attribute '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Reference(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Reference '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Operation(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Operation '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Parameter(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Parameter '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_TypedElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_TypedElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_TypeRef(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_TypeRef '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_QualifiedName(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_QualifiedName '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelUiModule.java b/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelUiModule.java
index cb79dcc..170018a 100644
--- a/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelUiModule.java
+++ b/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/AbstractDomainmodelUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractDomainmodelUiModule extends DefaultUIModule {
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.example.DomainmodelProposalProvider.class;
}
diff --git a/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/GenDomainmodelProposalProvider.java b/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/GenDomainmodelProposalProvider.java
deleted file mode 100644
index 5035dc3..0000000
--- a/examples/org.eclipse.xtext.example.domainmodel.ui/src-gen/org/eclipse/xtext/example/GenDomainmodelProposalProvider.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.example;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenDomainmodelProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeFile_Imports(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFile_Imports feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeFile_NamedElements(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFile_NamedElements feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeImport_ImportURI(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeImport_ImportURI feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"Import_ImportURI\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completePackage_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completePackage_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completePackage_NamedElements(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completePackage_NamedElements feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeDataType_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeDataType_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "DataType_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEntity_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEntity_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Entity_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEntity_SuperType(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEntity_SuperType feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeEntity_Features(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEntity_Features feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeAttribute_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAttribute_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Attribute_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeAttribute_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAttribute_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeReference_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReference_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Reference_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeReference_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReference_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeReference_Opposite(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReference_Opposite feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeOperation_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeOperation_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Operation_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeOperation_Params(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeOperation_Params feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeOperation_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeOperation_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeParameter_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParameter_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Parameter_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeParameter_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParameter_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeTypeRef_Referenced(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTypeRef_Referenced feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeFile(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFile '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeImport(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeImport '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeNamedElement(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeNamedElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completePackage(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completePackage '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeType(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeDataType(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeDataType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEntity(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEntity '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeFeature(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFeature '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeStructuralFeature(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeStructuralFeature '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAttribute(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAttribute '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeReference(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReference '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeOperation(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeOperation '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeParameter(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParameter '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeTypedElement(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTypedElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeTypeRef(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTypeRef '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EString(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EString '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/examples/org.eclipse.xtext.example.domainmodel.ui/src/org/eclipse/xtext/example/DomainmodelProposalProvider.java b/examples/org.eclipse.xtext.example.domainmodel.ui/src/org/eclipse/xtext/example/DomainmodelProposalProvider.java
index c1fde8f..d20bfa2 100644
--- a/examples/org.eclipse.xtext.example.domainmodel.ui/src/org/eclipse/xtext/example/DomainmodelProposalProvider.java
+++ b/examples/org.eclipse.xtext.example.domainmodel.ui/src/org/eclipse/xtext/example/DomainmodelProposalProvider.java
@@ -1,6 +1,6 @@
package org.eclipse.xtext.example;
-public class DomainmodelProposalProvider extends org.eclipse.xtext.example.GenDomainmodelProposalProvider {
+public class DomainmodelProposalProvider extends org.eclipse.xtext.example.AbstractDomainmodelProposalProvider {
}
diff --git a/examples/org.eclipse.xtext.example.domainmodel/plugin.properties b/examples/org.eclipse.xtext.example.domainmodel/plugin.properties
new file mode 100644
index 0000000..5b8d8b4
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.domainmodel/plugin.properties
@@ -0,0 +1,8 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id: plugin.properties,v 1.1 2009/04/23 18:07:17 szarnekow Exp $
+
+pluginName = Domainmodel Model
+providerName = www.example.org
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF b/examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF
index 18f81c9..9ead954 100644
--- a/examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF
@@ -5,6 +5,7 @@ Bundle-SymbolicName: org.eclipse.xtext.example.ecoredsl.ui;singleton:=true
Bundle-Version: 0.7.0.qualifier
Require-Bundle: org.eclipse.xtext.ui.core,
org.eclipse.xtext.ui.common,
+ org.eclipse.xtext.xtext.ui,
org.eclipse.ui.editors;bundle-version="3.4.0",
org.eclipse.ui,
org.eclipse.core.expressions;bundle-version="3.4.0",
@@ -15,4 +16,4 @@ Bundle-Vendor: Eclipse Modeling Project
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.xtext.example.EcoreDslActivator
-
+Export-Package: org.eclipse.xtext.example
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslProposalProvider.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslProposalProvider.java
new file mode 100644
index 0000000..44d022a
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslProposalProvider.java
@@ -0,0 +1,919 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.example;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractEcoreDslProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractEcoreDslProposalProvider.class);
+
+ public void completeEcoreDsl_MetamodelDeclarations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcoreDsl_MetamodelDeclarations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEcoreDsl_Package(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcoreDsl_Package feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeReferencedMetamodel_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeReferencedMetamodel_Alias feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeReferencedMetamodel_EPackage(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeReferencedMetamodel_EPackage feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEPackageDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEPackageDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEPackageDecl_NsURI(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_NsURI feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEPackageDecl_NsPrefix(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_NsPrefix feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEPackageDecl_ESubpackages(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_ESubpackages feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEPackageDecl_EClassifiers(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_EClassifiers feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSubEPackageDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSubEPackageDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSubEPackageDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSubEPackageDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSubEPackageDecl_ESubpackages(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSubEPackageDecl_ESubpackages feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSubEPackageDecl_EClassifiers(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSubEPackageDecl_EClassifiers feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEDataTypeDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEDataTypeDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEDataTypeDecl_Serializable(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEDataTypeDecl_Serializable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEDataTypeDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEDataTypeDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEDataTypeDecl_InstanceClassName(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEDataTypeDecl_InstanceClassName feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAnnotationDecl_Source(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAnnotationDecl_Source feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAnnotationDecl_Details(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAnnotationDecl_Details feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEClassDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEClassDecl_Abstract(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_Abstract feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEClassDecl_Interface(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_Interface feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEClassDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEClassDecl_ETypeParameters(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_ETypeParameters feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEClassDecl_EGenericSuperTypes(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_EGenericSuperTypes feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEClassDecl_InstanceClassName(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_InstanceClassName feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEClassDecl_EStructuralFeatures(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_EStructuralFeatures feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEClassDecl_EOperations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_EOperations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_ID(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_ID feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEAttributeDecl_Unique(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_Ordered(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_Changeable(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Changeable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_Volatile(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Volatile feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEAttributeDecl_Transient(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Transient feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEAttributeDecl_Unsettable(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Unsettable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEAttributeDecl_Derived(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Derived feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEAttributeDecl_EGenericType(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_LowerBound(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_LowerBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_UpperBound(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_UpperBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEAttributeDecl_DefaultValueLiteral(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_DefaultValueLiteral feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_ResolveProxies(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_ResolveProxies feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_Unique(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_Ordered(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_Changeable(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Changeable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_Volatile(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Volatile feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEReferenceDecl_Transient(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Transient feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEReferenceDecl_Unsettable(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Unsettable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEReferenceDecl_Derived(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Derived feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEReferenceDecl_Containment(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Containment feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEReferenceDecl_EGenericType(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_LowerBound(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_LowerBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_UpperBound(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_UpperBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_EOpposite(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_EOpposite feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEReferenceDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEEnumDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEEnumDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEEnumDecl_ELiterals(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumDecl_ELiterals feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEEnumLiteralDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumLiteralDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEEnumLiteralDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumLiteralDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEEnumLiteralDecl_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumLiteralDecl_Value feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEEnumLiteralDecl_Literal(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumLiteralDecl_Literal feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeETypeParameterDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeETypeParameterDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeETypeParameterDecl_EBounds(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeETypeParameterDecl_EBounds feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEGenericTypeReferenceDecl_EClassifier(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeReferenceDecl_EClassifier feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEGenericTypeReferenceDecl_ETypeArguments(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeReferenceDecl_ETypeArguments feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEGenericTypeReferenceDecl_ETypeParameter(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeReferenceDecl_ETypeParameter feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEGenericTypeDecl_EClassifier(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_EClassifier feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEGenericTypeDecl_ETypeArguments(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_ETypeArguments feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEGenericTypeDecl_ETypeParameter(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_ETypeParameter feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEGenericTypeDecl_EUpperBound(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_EUpperBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEGenericTypeDecl_ELowerBound(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_ELowerBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEOperationDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEOperationDecl_Unique(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEOperationDecl_Ordered(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEOperationDecl_EGenericType(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEOperationDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEOperationDecl_ETypeParameters(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_ETypeParameters feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEOperationDecl_EParameters(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_EParameters feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEOperationDecl_EGenericExceptions(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_EGenericExceptions feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEParameterDecl_EAnnotations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEParameterDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEParameterDecl_EGenericType(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEParameterDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEParameterDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEParameterDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeMapEntry_Key(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeMapEntry_Key feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeMapEntry_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeMapEntry_Value feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_EcoreDsl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EcoreDsl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ReferencedMetamodel(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ReferencedMetamodel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EPackageDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EPackageDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_SubEPackageDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_SubEPackageDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EClassifierDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EClassifierDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EDataTypeDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EDataTypeDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EAnnotationDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EAnnotationDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EClassDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EClassDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EStructuralFeatureDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EStructuralFeatureDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EAttributeDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EAttributeDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EReferenceDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EReferenceDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EEnumDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EEnumDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EEnumLiteralDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EEnumLiteralDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ETypeParameterDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ETypeParameterDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EGenericTypeReferenceDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EGenericTypeReferenceDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EGenericTypeDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EGenericTypeDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EOperationDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EOperationDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EParameterDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EParameterDecl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_MapEntry(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_MapEntry '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_QID(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_QID '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_STRING_OR_QID(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_STRING_OR_QID '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_SINT(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_SINT '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Bag(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Bag '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Random(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Random '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Readonly(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Readonly '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Local(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Local '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Serializable(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Serializable '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java
index 8ee6adf..103a839 100644
--- a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractEcoreDslUiModule extends DefaultUIModule {
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.example.EcoreDslProposalProvider.class;
}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/GenEcoreDslProposalProvider.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/GenEcoreDslProposalProvider.java
deleted file mode 100644
index e18cf12..0000000
--- a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/GenEcoreDslProposalProvider.java
+++ /dev/null
@@ -1,961 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.example;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenEcoreDslProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeEcoreDsl_MetamodelDeclarations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcoreDsl_MetamodelDeclarations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEcoreDsl_Package(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcoreDsl_Package feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeReferencedMetamodel_Alias(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReferencedMetamodel_Alias feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "ReferencedMetamodel_Alias", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeReferencedMetamodel_EPackage(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReferencedMetamodel_EPackage feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeEPackageDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEPackageDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEPackageDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEPackageDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEPackageDecl_NsURI(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEPackageDecl_NsURI feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"EPackageDecl_NsURI\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEPackageDecl_NsPrefix(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEPackageDecl_NsPrefix feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEPackageDecl_ESubpackages(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEPackageDecl_ESubpackages feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEPackageDecl_EClassifiers(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEPackageDecl_EClassifiers feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSubEPackageDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSubEPackageDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSubEPackageDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSubEPackageDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "SubEPackageDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSubEPackageDecl_ESubpackages(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSubEPackageDecl_ESubpackages feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSubEPackageDecl_EClassifiers(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSubEPackageDecl_EClassifiers feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEDataTypeDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEDataTypeDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEDataTypeDecl_Serializable(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEDataTypeDecl_Serializable feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEDataTypeDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEDataTypeDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EDataTypeDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEDataTypeDecl_InstanceClassName(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEDataTypeDecl_InstanceClassName feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAnnotationDecl_Source(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAnnotationDecl_Source feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAnnotationDecl_Details(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAnnotationDecl_Details feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeEClassDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEClassDecl_Abstract(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_Abstract feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEClassDecl_Interface(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_Interface feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEClassDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EClassDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEClassDecl_ETypeParameters(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_ETypeParameters feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeEClassDecl_EGenericSuperTypes(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_EGenericSuperTypes feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeEClassDecl_InstanceClassName(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_InstanceClassName feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEClassDecl_EStructuralFeatures(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_EStructuralFeatures feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEClassDecl_EOperations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEClassDecl_EOperations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_ID(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_ID feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_Unique(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_Ordered(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_Changeable(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_Changeable feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_Volatile(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_Volatile feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_Transient(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_Transient feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_Unsettable(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_Unsettable feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_Derived(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_Derived feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_EGenericType(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_LowerBound(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_LowerBound feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_UpperBound(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_UpperBound feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EAttributeDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEAttributeDecl_DefaultValueLiteral(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEAttributeDecl_DefaultValueLiteral feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"EAttributeDecl_DefaultValueLiteral\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_ResolveProxies(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_ResolveProxies feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Unique(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Ordered(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Changeable(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Changeable feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Volatile(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Volatile feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Transient(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Transient feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Unsettable(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Unsettable feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Derived(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Derived feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Containment(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Containment feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_EGenericType(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_LowerBound(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_LowerBound feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_UpperBound(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_UpperBound feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_EOpposite(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_EOpposite feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeEReferenceDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEReferenceDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EReferenceDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEEnumDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEEnumDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEEnumDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEEnumDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EEnumDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEEnumDecl_ELiterals(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEEnumDecl_ELiterals feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEEnumLiteralDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEEnumLiteralDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEEnumLiteralDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEEnumLiteralDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EEnumLiteralDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEEnumLiteralDecl_Value(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEEnumLiteralDecl_Value feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEEnumLiteralDecl_Literal(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEEnumLiteralDecl_Literal feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"EEnumLiteralDecl_Literal\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeETypeParameterDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeETypeParameterDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "ETypeParameterDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeETypeParameterDecl_EBounds(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeETypeParameterDecl_EBounds feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEGenericTypeReferenceDecl_EClassifier(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEGenericTypeReferenceDecl_EClassifier feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeEGenericTypeReferenceDecl_ETypeArguments(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEGenericTypeReferenceDecl_ETypeArguments feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeEGenericTypeReferenceDecl_ETypeParameter(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEGenericTypeReferenceDecl_ETypeParameter feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeEGenericTypeDecl_EClassifier(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEGenericTypeDecl_EClassifier feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeEGenericTypeDecl_ETypeArguments(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEGenericTypeDecl_ETypeArguments feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeEGenericTypeDecl_ETypeParameter(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEGenericTypeDecl_ETypeParameter feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeEGenericTypeDecl_EUpperBound(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEGenericTypeDecl_EUpperBound feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEGenericTypeDecl_ELowerBound(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEGenericTypeDecl_ELowerBound feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEOperationDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEOperationDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEOperationDecl_Unique(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEOperationDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEOperationDecl_Ordered(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEOperationDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEOperationDecl_EGenericType(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEOperationDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEOperationDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEOperationDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EOperationDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEOperationDecl_ETypeParameters(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEOperationDecl_ETypeParameters feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeEOperationDecl_EParameters(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEOperationDecl_EParameters feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeEOperationDecl_EGenericExceptions(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEOperationDecl_EGenericExceptions feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeEParameterDecl_EAnnotations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEParameterDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEParameterDecl_EGenericType(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEParameterDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEParameterDecl_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEParameterDecl_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EParameterDecl_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeMapEntry_Key(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeMapEntry_Key feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "MapEntry_Key", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeMapEntry_Value(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeMapEntry_Value feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"MapEntry_Value\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEcoreDsl(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcoreDsl '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeReferencedMetamodel(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReferencedMetamodel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EPackage(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EPackage '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EClassifier(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EClassifier '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EDataType(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EDataType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EAnnotation(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EAnnotation '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EClass(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EClass '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EStructuralFeature(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EStructuralFeature '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EAttribute(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EAttribute '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EReference(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EReference '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EEnum(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EEnum '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EEnumLiteral(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EEnumLiteral '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_ETypeParameter(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_ETypeParameter '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EGenericType(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EGenericType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EOperation(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EOperation '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EParameter(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EParameter '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EStringToStringMapEntry(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EStringToStringMapEntry '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EString(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EString '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EInt(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EInt '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java
index e0bb174..91a3b73 100644
--- a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java
@@ -1,34 +1,8 @@
package org.eclipse.xtext.example;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.Keyword;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-public class EcoreDslProposalProvider extends org.eclipse.xtext.example.GenEcoreDslProposalProvider {
+public class EcoreDslProposalProvider extends org.eclipse.xtext.example.AbstractEcoreDslProposalProvider {
- @Override
- public Template[] getTemplates(String contextTypeId) {
- return EcoreDslActivator.getDefault().getTemplateStore().getTemplates(contextTypeId);
- }
-
- @Override
- public TemplateContextType getTemplateContextType(Keyword keyword, IContentAssistContext contentAssistContext) {
- return EcoreDslActivator.getDefault().getTemplateContextRegistry()
- .getContextType(EcoreDslActivator.PREFIX + keyword.getValue());
- }
-
- @Override
- public TemplateContextType getTemplateContextType(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (ruleCall.eContainer() instanceof Assignment
- && ((Assignment) ruleCall.eContainer()).getFeature().equals("lowerBound")) {
- return EcoreDslActivator.getDefault().getTemplateContextRegistry().getContextType(EcoreDslActivator.PREFIX + "lowerBound");
- }
- return EcoreDslActivator.getDefault().getTemplateContextRegistry().getContextType(
- EcoreDslActivator.PREFIX + ruleCall.getRule().getName());
- }
}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslTemplateProposalProvider.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslTemplateProposalProvider.java
new file mode 100644
index 0000000..aea3f2f
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslTemplateProposalProvider.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.example;
+
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultTemplateProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class EcoreDslTemplateProposalProvider extends DefaultTemplateProposalProvider {
+
+ @Override
+ public Template[] getTemplates(String contextTypeId) {
+ return EcoreDslActivator.getDefault().getTemplateStore().getTemplates(contextTypeId);
+ }
+
+ @Override
+ public TemplateContextType getTemplateContextType(Keyword keyword, ContentAssistContext contentAssistContext) {
+ return EcoreDslActivator.getDefault().getTemplateContextRegistry()
+ .getContextType(EcoreDslActivator.PREFIX + keyword.getValue());
+ }
+
+ @Override
+ public TemplateContextType getTemplateContextType(RuleCall ruleCall, ContentAssistContext contentAssistContext) {
+ if (ruleCall.eContainer() instanceof Assignment
+ && ((Assignment) ruleCall.eContainer()).getFeature().equals("lowerBound")) {
+ return EcoreDslActivator.getDefault().getTemplateContextRegistry().getContextType(EcoreDslActivator.PREFIX + "lowerBound");
+ }
+ return EcoreDslActivator.getDefault().getTemplateContextRegistry().getContextType(
+ EcoreDslActivator.PREFIX + ruleCall.getRule().getName());
+ }
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUiModule.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUiModule.java
index 0f5f652..753dfdc 100644
--- a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUiModule.java
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUiModule.java
@@ -9,6 +9,7 @@
package org.eclipse.xtext.example;
import org.eclipse.xtext.example.editor.outline.EcoreSemanticModelTransformer;
+import org.eclipse.xtext.ui.core.editor.contentassist.ITemplateProposalProvider;
/**
* used to manually extend and modify configuration for components used within
@@ -18,11 +19,13 @@ import org.eclipse.xtext.example.editor.outline.EcoreSemanticModelTransformer;
*/
public class EcoreDslUiModule extends AbstractEcoreDslUiModule {
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
- return org.eclipse.xtext.example.EcoreDslProposalProvider.class;
- }
-
+ @Override
public Class<? extends org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTransformer> bindISemanticModelTransformer() {
return EcoreSemanticModelTransformer.class;
}
+
+ @Override
+ public Class<? extends ITemplateProposalProvider> bindITemplateProposalProvider() {
+ return EcoreDslTemplateProposalProvider.class;
+ }
}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml b/examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml
index 5252dcb..9b0e755 100644
--- a/examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<template name="empty Package" description="template for an empty EPackage"
- id="org.eclipse.xtext.ecore.dsl.ui.templates.EPackageDecl"
- context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EPackageDecl"
+ id="org.eclipse.xtext.ecoredsl.ui.templates.EPackageDecl"
+ context="org.eclipse.xtext.ecoredsl.ui.templates.contextType.EPackageDecl"
enabled="true">package ${name} nsURI="${nsURI}" nsPrefix=${nsPrefix} {
${cursor}
}</template>
<template name="empty EClass" description="template for an empty EClass"
- id="org.eclipse.xtext.ecore.dsl.ui.templates.EClassDecl"
- context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EClassDecl"
+ id="org.eclipse.xtext.ecoredsl.ui.templates.EClassDecl"
+ context="org.eclipse.xtext.ecoredsl.ui.templates.contextType.EClassDecl"
enabled="true">class ${name} {
${cursor}
}</template>
<template name="empty EDataTypeDecl" description="template for an empty EDataTypeDecl"
- id="org.eclipse.xtext.ecore.dsl.ui.templates.EDataTypeDecl"
- context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EDataTypeDecl"
+ id="org.eclipse.xtext.ecoredsl.ui.templates.EDataTypeDecl"
+ context="org.eclipse.xtext.ecoredsl.ui.templates.contextType.EDataTypeDecl"
enabled="true">datatype ${name} {
${cursor}
}</template>
<template name="empty EEnumDecl" description="template for an empty EEnumDecl"
- id="org.eclipse.xtext.ecore.dsl.ui.templates.EEnumDecl"
- context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EEnumDecl"
+ id="org.eclipse.xtext.ecoredsl.ui.templates.EEnumDecl"
+ context="org.eclipse.xtext.ecoredsl.ui.templates.contextType.EEnumDecl"
enabled="true">enum ${name} {
${NAME1}=${VALUE1};
${NAME2}=${VALUE2};
@@ -28,7 +28,7 @@
${cursor}
}</template>
<template name="empty EAttributeDecl" description="template for an empty EAttributeDecl"
- id="org.eclipse.xtext.ecore.dsl.ui.templates.EAttributeDecl"
- context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EAttributeDecl"
+ id="org.eclipse.xtext.ecoredsl.ui.templates.EAttributeDecl"
+ context="org.eclipse.xtext.ecoredsl.ui.templates.contextType.EAttributeDecl"
enabled="true">attr ${state:CrossReference('EGenericTypeReferenceDecl.eClassifier')} ${name};</template>
</templates>
diff --git a/examples/org.eclipse.xtext.example.ecoredsl/plugin.properties b/examples/org.eclipse.xtext.example.ecoredsl/plugin.properties
new file mode 100644
index 0000000..6295f0b
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl/plugin.properties
@@ -0,0 +1,8 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id: plugin.properties,v 1.1 2009/04/23 18:07:14 szarnekow Exp $
+
+pluginName = EcoreDsl Model
+providerName = www.example.org
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl.ui/META-INF/MANIFEST.MF b/examples/org.eclipse.xtext.example.fowlerdsl.ui/META-INF/MANIFEST.MF
index 2d66582..4ca7f0e 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl.ui/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.xtext.example.fowlerdsl.ui/META-INF/MANIFEST.MF
@@ -10,6 +10,7 @@ Export-Package: org.eclipse.xtext.example
Require-Bundle: org.eclipse.xtext.example.fowlerdsl,
org.eclipse.xtext.ui.core,
org.eclipse.xtext.ui.common,
+ org.eclipse.xtext.xtext.ui,
org.eclipse.xtext.xtend;bundle-version="0.7.0";resolution:=optional,
org.eclipse.ui.editors,
org.eclipse.ui
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslProposalProvider.java b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslProposalProvider.java
new file mode 100644
index 0000000..5da2945
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslProposalProvider.java
@@ -0,0 +1,165 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.example;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractFowlerDslProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractFowlerDslProposalProvider.class);
+
+ public void completeStatemachine_Events(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeStatemachine_Events feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeStatemachine_Commands(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeStatemachine_Commands feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeStatemachine_States(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeStatemachine_States feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEvent_Resetting(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEvent_Resetting feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeEvent_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEvent_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEvent_Code(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEvent_Code feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeCommand_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeCommand_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeCommand_Code(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeCommand_Code feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeState_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeState_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeState_Actions(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeState_Actions feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeState_Transitions(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeState_Transitions feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTransition_Event(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTransition_Event feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTransition_State(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTransition_State feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_Statemachine(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Statemachine '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Event(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Event '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Command(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Command '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_State(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_State '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Transition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Transition '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslUiModule.java b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslUiModule.java
index 421121c..a57708b 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslUiModule.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/AbstractFowlerDslUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractFowlerDslUiModule extends DefaultUIModule {
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.example.FowlerDslProposalProvider.class;
}
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/GenFowlerDslProposalProvider.java b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/GenFowlerDslProposalProvider.java
deleted file mode 100644
index 15dbb8e..0000000
--- a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src-gen/org/eclipse/xtext/example/GenFowlerDslProposalProvider.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.example;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenFowlerDslProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeStatemachine_Events(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeStatemachine_Events feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeStatemachine_Commands(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeStatemachine_Commands feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeStatemachine_States(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeStatemachine_States feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEvent_Resetting(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEvent_Resetting feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEvent_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEvent_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Event_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEvent_Code(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEvent_Code feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Event_Code", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeCommand_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCommand_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Command_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeCommand_Code(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCommand_Code feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Command_Code", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeState_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeState_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "State_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeState_Actions(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeState_Actions feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeState_Transitions(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeState_Transitions feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeTransition_Event(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTransition_Event feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeTransition_State(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTransition_State feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeStatemachine(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeStatemachine '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEvent(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEvent '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeCommand(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCommand '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeState(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeState '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeTransition(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTransition '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslActivator.java b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslActivator.java
index a91939c..b088f86 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslActivator.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslActivator.java
@@ -75,6 +75,7 @@ public class FowlerDslActivator extends org.eclipse.xtext.example.internal.Fowle
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
setDefault(this);
@@ -88,6 +89,7 @@ public class FowlerDslActivator extends org.eclipse.xtext.example.internal.Fowle
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
* )
*/
+ @Override
public void stop(BundleContext context) throws Exception {
setDefault(null);
super.stop(context);
@@ -167,10 +169,7 @@ public class FowlerDslActivator extends org.eclipse.xtext.example.internal.Fowle
*/
public static IStatus createErrorStatus(String message,
Throwable exception) {
- if (message == null) {
- message= "";
- }
- return new Status(Status.ERROR, PLUGIN_ID, 0, message, exception);
+ return new Status(IStatus.ERROR, PLUGIN_ID, 0, message == null ? "" : message, exception);
}
/**
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslProposalProvider.java b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslProposalProvider.java
index be92642..3f93f87 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslProposalProvider.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslProposalProvider.java
@@ -1,28 +1,7 @@
package org.eclipse.xtext.example;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.xtext.Keyword;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-public class FowlerDslProposalProvider extends org.eclipse.xtext.example.GenFowlerDslProposalProvider {
+public class FowlerDslProposalProvider extends org.eclipse.xtext.example.AbstractFowlerDslProposalProvider {
- @Override
- public Template[] getTemplates(String contextTypeId) {
- return FowlerDslActivator.getDefault().getTemplateStore().getTemplates(contextTypeId);
- }
-
- @Override
- public TemplateContextType getTemplateContextType(Keyword keyword, IContentAssistContext contentAssistContext) {
- return FowlerDslActivator.getDefault().getTemplateContextRegistry()
- .getContextType(FowlerDslActivator.PREFIX + keyword.getValue());
- }
-
- @Override
- public TemplateContextType getTemplateContextType(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- return FowlerDslActivator.getDefault().getTemplateContextRegistry().getContextType(
- FowlerDslActivator.PREFIX + ruleCall.getRule().getName());
- }
}
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslTemplateProposalProvider.java b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslTemplateProposalProvider.java
new file mode 100644
index 0000000..04d7e31
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslTemplateProposalProvider.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.example;
+
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultTemplateProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class FowlerDslTemplateProposalProvider extends DefaultTemplateProposalProvider {
+
+ @Override
+ public Template[] getTemplates(String contextTypeId) {
+ return FowlerDslActivator.getDefault().getTemplateStore().getTemplates(contextTypeId);
+ }
+
+ @Override
+ public TemplateContextType getTemplateContextType(Keyword keyword, ContentAssistContext contentAssistContext) {
+ return FowlerDslActivator.getDefault().getTemplateContextRegistry()
+ .getContextType(FowlerDslActivator.PREFIX + keyword.getValue());
+ }
+
+ @Override
+ public TemplateContextType getTemplateContextType(RuleCall ruleCall, ContentAssistContext contentAssistContext) {
+ return FowlerDslActivator.getDefault().getTemplateContextRegistry().getContextType(
+ FowlerDslActivator.PREFIX + ruleCall.getRule().getName());
+ }
+}
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslUiModule.java b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslUiModule.java
index dd90a90..bda4715 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslUiModule.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl.ui/src/org/eclipse/xtext/example/FowlerDslUiModule.java
@@ -3,12 +3,14 @@ Generated with Xtext
*/
package org.eclipse.xtext.example;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-
+import org.eclipse.xtext.ui.core.editor.contentassist.ITemplateProposalProvider;
/**
* used to manually extend and modify configuration for components used within the IDE.
*/
public class FowlerDslUiModule extends AbstractFowlerDslUiModule {
+ public Class<? extends ITemplateProposalProvider> bindITemplateProposalStrategy() {
+ return FowlerDslTemplateProposalProvider.class;
+ }
}
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/plugin.properties b/examples/org.eclipse.xtext.example.fowlerdsl/plugin.properties
new file mode 100644
index 0000000..0611a51
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/plugin.properties
@@ -0,0 +1,8 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id: plugin.properties,v 1.1 2009/04/23 18:07:18 szarnekow Exp $
+
+pluginName = FowlerDsl Model
+providerName = www.example.org
diff --git a/plugins/org.eclipse.xtext.ui.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext.ui.common/META-INF/MANIFEST.MF
index 29cd6a1..7db78ee 100644
--- a/plugins/org.eclipse.xtext.ui.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xtext.ui.common/META-INF/MANIFEST.MF
@@ -8,8 +8,7 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.xtext.ui.core,
org.eclipse.xtext.log4j;bundle-version="1.2.15",
org.eclipse.ui.ide;bundle-version="3.4.0"
-Export-Package: org.eclipse.xtext.ui.common.editor.contentassist,
- org.eclipse.xtext.ui.common.editor.contentassist.impl,
+Export-Package: org.eclipse.xtext.ui.common.editor.contentassist.impl,
org.eclipse.xtext.ui.common.editor.folding,
org.eclipse.xtext.ui.common.editor.formatting,
org.eclipse.xtext.ui.common.editor.hover,
@@ -22,7 +21,6 @@ Export-Package: org.eclipse.xtext.ui.common.editor.contentassist,
org.eclipse.xtext.ui.common.editor.tasks,
org.eclipse.xtext.ui.common.editor.tasks.dialogfields,
org.eclipse.xtext.ui.common.service
-Import-Package: org.eclipse.ui.texteditor.templates
Eclipse-RegisterBuddy: org.eclipse.xtext.log4j
Bundle-Activator: org.eclipse.xtext.ui.common.internal.Activator
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IContentAssistContext.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IContentAssistContext.java
deleted file mode 100644
index 7b92b3a..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IContentAssistContext.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.parsetree.AbstractNode;
-import org.eclipse.xtext.parsetree.CompositeNode;
-
-/**
- * Abstraction of a commonly used set of attributes related to the current content assist request.
- *
- * @author Michael Clay - Initial contribution and API
- */
-public interface IContentAssistContext {
- /**
- * @return the root node of the document which is used to compute the proposals
- */
- CompositeNode getRootNode();
-
- /**
- * @return the string that is already entered by the user prior to requesting content assist
- */
- String getMatchString();
-
- /**
- * @return the last node (on a none hidden channel) that starts at or spans across the cursor position the user requested content assist for
- */
- AbstractNode getNode();
-
- /**
- * @return the nearest node with an existing grammar element set (i.e. valid according to the underlying grammar)
- */
- AbstractNode getReferenceNode();
-
- /**
- * @return the most specific model element under the cursor the user requested content assist for
- */
- EObject getModel();
-
- /**
- * @return the position in the document described by this context.
- */
- int getOffSet();
-
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IProposalProvider.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IProposalProvider.java
deleted file mode 100644
index 1b7691f..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IProposalProvider.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Michael Clay and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist;
-
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.Keyword;
-import org.eclipse.xtext.RuleCall;
-
-/**
- * @author Sven Efftinge - Initial contribution and API
- * @author Michael Clay
- */
-public interface IProposalProvider {
- /**
- * Is invoked by the framework if (with respect to the grammar) it is
- * possible that the keyword passed as first parameter can occur next up.
- *
- * @param keyword the <code>Keyword</code> to be completed
- * @param contentAssistContext the current context of the content assist
- * @return a list of matching {@link ICompletionProposal}
- */
- List<? extends ICompletionProposal> completeKeyword(Keyword keyword, IContentAssistContext contentAssistContext);
-
- /**
- * Is invoked by the framework if (with respect to the grammar) it is
- * possible that the rule call passed as first parameter can occur next up.
- *
- * @param ruleCall the <code>RuleCall</code> to be completed
- * @param contentAssistContext the current context of the content assist
- * @return a list of matching {@link ICompletionProposal}
- */
- List<? extends ICompletionProposal> completeRuleCall(RuleCall ruleCall, IContentAssistContext contentAssistContext);
-
- /**
- * Is invoked by the framework if (with respect to the grammar) it is
- * possible that the assignment passed as first parameter can occur next up.
- *
- * @param assignment the <code>Assignment</code> to be completed
- * @param contentAssistContext the current context of the content assist
- * @return a list of matching {@link ICompletionProposal}
- */
- List<? extends ICompletionProposal> completeAssignment(Assignment assignment, IContentAssistContext contentAssistContext);
-
- /**
- * Returns the context type that can handle template insertion at the given
- * region in the viewer's document.
- *
- * @param keyword the <code>Keyword</code> to be completed
- * @param contentAssistContext the current context of the content assist
- * @return the context type that can handle template expansion for the given
- * location, or <code>null</code> if none exists
- */
- TemplateContextType getTemplateContextType(Keyword keyword, IContentAssistContext contentAssistContext);
-
- /**
- * Returns the context type that can handle template insertion at the given
- * region in the viewer's document.
- *
- * @param ruleCall the <code>RuleCall</code>
- * @param contentAssistContext the current context of the content assist
- * @return the context type that can handle template expansion for the given
- * location, or <code>null</code> if none exists
- */
- TemplateContextType getTemplateContextType(RuleCall ruleCall, IContentAssistContext contentAssistContext);
-
- /**
- * Returns the templates valid for the context type specified by
- * <code>contextTypeId</code>.
- *
- * @param contextTypeId the context type id
- * @return the templates valid for this context type id
- */
- Template[] getTemplates(String contextTypeId);
-
- /**
- * Used to filter the given list of completion proposals.
- * <p/>
- * This method is after all possible completions and templates have been collected.
- *
- * @param completionProposalList the collected list of {@link ICompletionProposal} to filter
- * @param contentAssistContext the current context of the content assist
- * @return the filtered <code>ICompletionProposal</code> list.
- */
- List<? extends ICompletionProposal> filter(List<ICompletionProposal> completionProposalList,IContentAssistContext contentAssistContext);
-
- /**
- * Used to sort the given list of completion proposals.
- * <p/>
- * This method is after all possible completions and templates have been collected and filtered.
- *
- * @param completionProposalList the collected list of {@link ICompletionProposal} to sort
- * @return the sorted <code>ICompletionProposal</code> list.
- */
- List<? extends ICompletionProposal> sort(List<ICompletionProposal> completionProposalList);
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/ITemplateContentAssistProcessor.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/ITemplateContentAssistProcessor.java
deleted file mode 100644
index f1f38c7..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/ITemplateContentAssistProcessor.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist;
-
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Strategy interface for computing template proposals matching the given <code>TemplateContextType</code> and
- * <code>IContentAssistContext</code>.
- *
- * @author Michael Clay - Initial contribution and API
- */
-public interface ITemplateContentAssistProcessor extends IContentAssistProcessor {
-
- /**
- * @param contextType the context type that can handle template expansion for the given contentAssistContext (must not be null)
- */
- void setContextType(TemplateContextType contextType);
-
- /**
- * @param contentAssistContext the current context of the content assist proposal request (must not be null)
- */
- void setContentAssistContext(IContentAssistContext contentAssistContext);
-
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentProposalProvider.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentProposalProvider.java
new file mode 100755
index 0000000..45a6e4f
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentProposalProvider.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.xtext.AbstractElement;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider;
+import org.eclipse.xtext.util.XtextSwitch;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+
+/**
+ * The default implementation of interface {@link IContentProposalProvider} provided with Xtext.
+ *
+ * @author Michael Clay - Initial contribution and API
+ * @author Sebastian Zarnekow - Initial contribution and API
+ * @author Heiko Behrens
+ * @author Jan K&ouml;hnlein
+ */
+public abstract class AbstractContentProposalProvider implements IContentProposalProvider {
+
+ public class DefaultContentAssistProcessorSwitch extends XtextSwitch<Boolean> {
+
+ private final ContentAssistContext context;
+ private final ICompletionProposalAcceptor acceptor;
+
+ public DefaultContentAssistProcessorSwitch(ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ this.context = context;
+ this.acceptor = acceptor;
+ }
+
+ @Override
+ public Boolean defaultCase(EObject object) {
+ return Boolean.TRUE;
+ }
+
+ @Override
+ public Boolean caseKeyword(Keyword object) {
+ completeKeyword(object, context, acceptor);
+ return Boolean.TRUE;
+ }
+
+ @Override
+ public Boolean caseRuleCall(RuleCall object) {
+ completeRuleCall(object, context, acceptor);
+ return Boolean.TRUE;
+ }
+
+ @Override
+ public Boolean caseAssignment(Assignment object) {
+ completeAssignment(object, context, acceptor);
+ return Boolean.TRUE;
+ }
+ }
+
+ public static class NullSafeCompletionProposalAcceptor extends ICompletionProposalAcceptor.Delegate {
+
+ public NullSafeCompletionProposalAcceptor(ICompletionProposalAcceptor delegate) {
+ super();
+ setDelegate(delegate);
+ }
+
+ @Override
+ public void accept(ICompletionProposal proposal) {
+ if (proposal != null)
+ super.accept(proposal);
+ }
+ }
+
+ public void createProposals(ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ ICompletionProposalAcceptor nullSafe = new NullSafeCompletionProposalAcceptor(acceptor);
+ DefaultContentAssistProcessorSwitch selector = new DefaultContentAssistProcessorSwitch(context, nullSafe);
+ for (AbstractElement element : context.getFirstSetGrammarElements()) {
+ selector.doSwitch(element);
+ }
+ }
+
+ public abstract void completeKeyword(Keyword object, ContentAssistContext context,
+ ICompletionProposalAcceptor acceptor);
+
+ public abstract void completeRuleCall(RuleCall object, ContentAssistContext context,
+ ICompletionProposalAcceptor acceptor);
+
+ public abstract void completeAssignment(Assignment object, ContentAssistContext context,
+ ICompletionProposalAcceptor acceptor);
+
+ public DefaultContentAssistProcessorSwitch createSelector(ContentAssistContext context,
+ ICompletionProposalAcceptor acceptor) {
+ return new DefaultContentAssistProcessorSwitch(context, acceptor);
+ }
+
+ public static class FilteringCompletionProposalAcceptor extends ICompletionProposalAcceptor.Delegate {
+
+ private final Predicate<ICompletionProposal> filter;
+
+ public FilteringCompletionProposalAcceptor(ICompletionProposalAcceptor delegate, Predicate<ICompletionProposal> filter) {
+ super();
+ this.filter = filter;
+ setDelegate(delegate);
+ }
+
+ @Override
+ public void accept(ICompletionProposal proposal) {
+ if (filter.apply(proposal))
+ super.accept(proposal);
+ }
+
+ }
+
+ public static class ModifyingCompletionProposalAcceptor extends ICompletionProposalAcceptor.Delegate {
+ private final Function<ICompletionProposal, ICompletionProposal> modifier;
+
+ public ModifyingCompletionProposalAcceptor(ICompletionProposalAcceptor delegate, Function<ICompletionProposal, ICompletionProposal> modifier) {
+ super();
+ this.modifier = modifier;
+ setDelegate(delegate);
+ }
+
+ @Override
+ public void accept(ICompletionProposal proposal) {
+ if (proposal != null)
+ super.accept(modifier.apply(proposal));
+ }
+ }
+
+ public ICompletionProposalAcceptor filter(ICompletionProposalAcceptor acceptor, Predicate<ICompletionProposal> filter) {
+ return new FilteringCompletionProposalAcceptor(acceptor, Predicates.and(Predicates.notNull(), filter));
+ }
+
+ public ICompletionProposalAcceptor modify(ICompletionProposalAcceptor acceptor, Function<ICompletionProposal, ICompletionProposal> modifier) {
+ return new ModifyingCompletionProposalAcceptor(acceptor, modifier);
+ }
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractJavaBasedContentProposalProvider.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractJavaBasedContentProposalProvider.java
new file mode 100755
index 0000000..1b1df84
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractJavaBasedContentProposalProvider.java
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.xtext.AbstractRule;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.GrammarUtil;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.ParserRule;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.crossref.IScope;
+import org.eclipse.xtext.crossref.IScopeProvider;
+import org.eclipse.xtext.crossref.IScopedElement;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.util.PolymorphicDispatcher;
+import org.eclipse.xtext.util.Strings;
+import org.eclipse.xtext.util.PolymorphicDispatcher.ErrorHandler;
+import org.eclipse.xtext.util.PolymorphicDispatcher.NullErrorHandler;
+
+import com.google.inject.Inject;
+
+/**
+ * @author Michael Clay - Initial contribution and API
+ * @author Jan Köhnlein - Initial contribution and API
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public abstract class AbstractJavaBasedContentProposalProvider extends AbstractContentProposalProvider {
+
+ protected final static Logger logger = Logger.getLogger(AbstractJavaBasedContentProposalProvider.class);
+
+ @Inject
+ protected IScopeProvider scopeProvider;
+
+ @Inject
+ protected ILabelProvider labelProvider;
+
+ private final Map<String, PolymorphicDispatcher<Void>> dispatchers;
+
+ protected AbstractJavaBasedContentProposalProvider() {
+ dispatchers = new HashMap<String, PolymorphicDispatcher<Void>>();
+ }
+
+ @Override
+ public void completeKeyword(Keyword keyword, ContentAssistContext contentAssistContext, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeKeyword '" + keyword.getValue()+ "' for model '" + contentAssistContext.getCurrentModel()
+ + "' and prefix '"+ contentAssistContext.getPrefix() + "'");
+ }
+ acceptor.accept(createCompletionProposal(keyword, keyword.getValue(), contentAssistContext));
+ }
+
+ @Override
+ public void completeRuleCall(RuleCall ruleCall, ContentAssistContext contentAssistContext, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeRuleCall '"+ ruleCall.getRule().getName()+ "' cardinality '"
+ + ruleCall.getCardinality()+ "' for model '"+ contentAssistContext.getCurrentModel()
+ + "' and prefix '"+ contentAssistContext.getPrefix() + "'");
+ }
+ AbstractRule calledRule = ruleCall.getRule();
+ String methodName = "complete_"+ calledRule.getName();
+ invokeMethod(methodName, acceptor, contentAssistContext.getCurrentModel(), ruleCall, contentAssistContext);
+ }
+
+ @Override
+ public void completeAssignment(Assignment assignment, ContentAssistContext contentAssistContext, ICompletionProposalAcceptor acceptor) {
+ ParserRule parserRule = GrammarUtil.containingParserRule(assignment);
+ String methodName = "complete"+ Strings.toFirstUpper(parserRule.getName()) + "_"+
+ Strings.toFirstUpper(assignment.getFeature());
+ invokeMethod(methodName, acceptor, contentAssistContext.getCurrentModel(), assignment, contentAssistContext);
+ }
+
+ /**
+ * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
+ */
+ protected ICompletionProposal createCompletionProposal(IScopedElement element, ContentAssistContext contentAssistContext) {
+ return createCompletionProposal(element.element(), element.name(), contentAssistContext);
+ }
+
+ /**
+ * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
+ */
+ protected ICompletionProposal createCompletionProposal(EObject element, String name, ContentAssistContext contentAssistContext) {
+ return createCompletionProposal(name, name, getImage(element), contentAssistContext);
+ }
+
+ /**
+ * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
+ */
+ protected ICompletionProposal createCompletionProposal(IScopedElement element, String prefix, ContentAssistContext contentAssistContext) {
+ return createCompletionProposal(element.element(), element.name(), prefix, contentAssistContext);
+ }
+
+ /**
+ * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
+ */
+ protected ICompletionProposal createCompletionProposal(EObject element, String name, String prefix, ContentAssistContext contentAssistContext) {
+ return createCompletionProposal(name, name, getImage(element), prefix, contentAssistContext);
+ }
+
+ /**
+ * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
+ */
+ protected ICompletionProposal createCompletionProposal(String name, ContentAssistContext contentAssistContext) {
+ return createCompletionProposal(name, name, null, 100, contentAssistContext.getPrefix(), contentAssistContext);
+ }
+
+ /**
+ * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
+ */
+ protected ICompletionProposal createCompletionProposal(String name, Image image, ContentAssistContext contentAssistContext) {
+ return createCompletionProposal(name, name, image, 100, contentAssistContext.getPrefix(), contentAssistContext);
+ }
+
+ /**
+ * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
+ */
+ protected ICompletionProposal createCompletionProposal(String name, String displayString, Image image,
+ ContentAssistContext contentAssistContext) {
+ return createCompletionProposal(name, displayString, image, 100, contentAssistContext.getPrefix(), contentAssistContext);
+ }
+
+ /**
+ * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
+ */
+ protected ICompletionProposal createCompletionProposal(String name, String displayString, Image image,
+ String prefix, ContentAssistContext contentAssistContext) {
+ return createCompletionProposal(name, displayString, image, 100, prefix, contentAssistContext);
+ }
+
+ /**
+ * @param abstractElement the {@link AbstractElement} which is used to create the proposals
+ * @param displayString the string that is already entered by the user prior to requesting content assist
+ * @param contentAssistContext the commonly used set of attributes related to the current content assist request
+ * @param image the {@link Image} for the {@link ICompletionProposal}
+ * @return a new <code>XtextCompletionProposal</code> for the given text and offset.
+ */
+ protected ICompletionProposal createCompletionProposal(String name, String displayString, Image image,
+ int priority, String prefix, ContentAssistContext context) {
+ int replacementOffset = context.getReplaceRegion().getOffset();
+ int replacementLength = context.getReplaceRegion().getLength();
+ return createCompletionProposal(name, displayString, image, replacementOffset, replacementLength, prefix, context);
+ }
+
+ protected ICompletionProposal createCompletionProposal(String name, String displayString, Image image,
+ int replacementOffset, int replacementLength, String prefix, ContentAssistContext context) {
+ if (context.getMatcher().isCandidateMatchingPrefix(name, prefix))
+ return doCreateProposal(name, displayString, image, replacementOffset, replacementLength, context);
+ return null;
+ }
+
+ protected ConfigurableCompletionProposal doCreateProposal(String name, String displayString, Image image,
+ int replacementOffset, int replacementLength, ContentAssistContext context) {
+ ConfigurableCompletionProposal result = new ConfigurableCompletionProposal(name, replacementOffset, replacementLength, name.length(), image, displayString, null, null);
+ result.setMatcher(context.getMatcher());
+ return result;
+ }
+
+ /**
+ * Concrete subclasses can override this to provide custom lookup behavior
+ * for <code>CrossReference</code>. This implementation delegates to the
+ * injected LinkingService
+ *
+ * @return a list of <code>ICompletionProposal</code> matching the given
+ * assignment
+ */
+ protected void lookupCrossReference(CrossReference crossReference, ContentAssistContext contentAssistContext,
+ ICompletionProposalAcceptor acceptor) {
+ if (scopeProvider != null) {
+ ParserRule containingParserRule = GrammarUtil.containingParserRule(crossReference);
+ if (!GrammarUtil.isDatatypeRule(containingParserRule)) {
+ EClass eClass = (EClass) containingParserRule.getType().getClassifier();
+ EReference ref = GrammarUtil.getReference(crossReference, eClass);
+ IScope scope = scopeProvider.getScope(contentAssistContext.getCurrentModel(), ref);
+ Iterable<IScopedElement> candidates = scope.getAllContents();
+ for (IScopedElement candidate: candidates) {
+ if (!acceptor.canAcceptMoreProposals())
+ return;
+ acceptor.accept(createCompletionProposal(candidate, contentAssistContext));
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the image for the label of the given element.
+ *
+ * @param element the element for which to provide the label image
+ * @return the image used to label the element, or <code>null</code> if there is no image for the given object
+ */
+ protected Image getImage(EObject eObject) {
+ return labelProvider.getImage(eObject);
+ }
+
+ protected void invokeMethod(String methodName, ICompletionProposalAcceptor acceptor, Object... params) {
+ PolymorphicDispatcher<Void> dispatcher = dispatchers.get(methodName);
+ if (dispatcher == null) {
+ ErrorHandler<Void> errorHandler = NullErrorHandler.get();
+ dispatcher = new PolymorphicDispatcher<Void>(methodName, params.length + 1, params.length + 1, Collections.singletonList(this), errorHandler) {
+ @Override
+ public Class<?> getDefaultClass(int paramIndex) {
+ if (paramIndex == 0)
+ return EObject.class;
+ return super.getDefaultClass(paramIndex);
+ }
+ };
+ dispatchers.put(methodName, dispatcher);
+ }
+ Object[] paramAsArray = new Object[params.length + 1];
+ System.arraycopy(params, 0, paramAsArray, 0, params.length);
+ paramAsArray[params.length] = acceptor;
+ dispatcher.invoke(paramAsArray);
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractJavaProposalProvider.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractJavaProposalProvider.java
deleted file mode 100644
index 07a5e5e..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractJavaProposalProvider.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.xtext.AbstractElement;
-import org.eclipse.xtext.AbstractRule;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.GrammarUtil;
-import org.eclipse.xtext.Keyword;
-import org.eclipse.xtext.ParserRule;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.TerminalRule;
-import org.eclipse.xtext.TypeRef;
-import org.eclipse.xtext.crossref.IScope;
-import org.eclipse.xtext.crossref.IScopeProvider;
-import org.eclipse.xtext.crossref.IScopedElement;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.util.Strings;
-
-import com.google.inject.Inject;
-
-/**
- * @author Michael Clay - Initial contribution and API
- * @author Jan Köhnlein - Initial contribution and API
- */
-public abstract class AbstractJavaProposalProvider implements IProposalProvider {
- // constants
- protected static final String LEXER_RULE_INT = "INT";
- protected static final String LEXER_RULE_STRING = "STRING";
- // logger available to subclasses
- protected final static Logger logger = Logger.getLogger(IProposalProvider.class);
-
- @Inject
- protected IScopeProvider scopeProvider;
-
- @Inject
- protected ILabelProvider labelProvider;
-
- protected JavaReflectiveMethodInvoker methodInvoker;
- protected List<IProposalProvider> proposalProviders;
-
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#completeKeyword(Keyword,
- * IContentAssistContext)
- */
- public List<? extends ICompletionProposal> completeKeyword(Keyword keyword,
- IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKeyword '" + keyword.getValue()+ "' for model '" + contentAssistContext.getModel()
- + "' and prefix '"+ contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(keyword,keyword.getValue(), contentAssistContext));
- }
-
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#completeRuleCall(RuleCall,
- * IContentAssistContext)
- */
- public List<? extends ICompletionProposal> completeRuleCall(
- RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeRuleCall '"+ ruleCall.getRule().getName()+ "' cardinality '"
- + ruleCall.getCardinality()+ "' for model '"+ contentAssistContext.getModel()
- + "' and prefix '"+ contentAssistContext.getMatchString().trim().trim() + "'");
- }
- AbstractRule calledRule = ruleCall.getRule();
- if (calledRule instanceof TerminalRule) {
- return completeTerminalRuleRuleCall((TerminalRule) calledRule, ruleCall,contentAssistContext);
- } else if (calledRule.getType() != null) {
- TypeRef typeRef = calledRule.getType();
- return invokeMethod("complete"+ ( null!=typeRef.getMetamodel().getAlias() ? Strings.toFirstUpper(typeRef.getMetamodel().getAlias()) + "_" : "" )
- + Strings.toFirstUpper(typeRef.getClassifier().getName()),
- Arrays.<Class<?>> asList(EObject.class, RuleCall.class,contentAssistContext.getModel() == null ?
- EObject.class : contentAssistContext.getModel().getClass(),
- IContentAssistContext.class), Arrays.asList(
- contentAssistContext.getModel(),ruleCall,contentAssistContext));
- }
- return Collections.emptyList();
- }
-
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#completeAssignment(Assignment,
- * IContentAssistContext)
- */
- public List<? extends ICompletionProposal> completeAssignment(
- Assignment assignment, IContentAssistContext contentAssistContext) {
- ParserRule parserRule = GrammarUtil.containingParserRule(assignment);
- // TODO : Better call completeRuleCall ?
- return invokeMethod("complete"+ Strings.toFirstUpper(parserRule.getName()) + "_"+
- Strings.toFirstUpper(assignment.getFeature()), Arrays.<Class<?>> asList(EObject.class, Assignment.class,
- IContentAssistContext.class), Arrays.asList(contentAssistContext.getModel(), assignment,contentAssistContext));
- }
-
-
- /**
- * @see #createCompletionProposal(AbstractElement, String, IContentAssistContext, Image)
- */
- protected ICompletionProposal createCompletionProposal(AbstractElement abstractElement, String displayString,
- IContentAssistContext contentAssistContext) {
- return createCompletionProposal(abstractElement, displayString, contentAssistContext,
- getImage(abstractElement));
- }
-
- /**
- * @param abstractElement the {@link AbstractElement} which is used to create the proposals
- * @param displayString the string that is already entered by the user prior to requesting content assist
- * @param contentAssistContext the commonly used set of attributes related to the current content assist request
- * @param image the {@link Image} for the {@link ICompletionProposal}
- * @return a new <code>XtextCompletionProposal</code> for the given text and offset.
- */
- protected ICompletionProposal createCompletionProposal(AbstractElement abstractElement, String displayString,
- IContentAssistContext contentAssistContext, Image image) {
- return new XtextCompletionProposal(abstractElement, displayString,contentAssistContext,image);
- }
-
-
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#getTemplateContextType(Keyword,
- * IContentAssistContext)
- */
- public TemplateContextType getTemplateContextType(Keyword keyword,
- IContentAssistContext contentAssistContext) {
- return null;
- }
-
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#getTemplateContextType(RuleCall,
- * IContentAssistContext)
- */
- public TemplateContextType getTemplateContextType(RuleCall ruleCall,
- IContentAssistContext contentAssistContext) {
- return null;
- }
-
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#getTemplates(String)
- */
- public Template[] getTemplates(String contextTypeId) {
- return new Template[] {};
- }
-
- /**
- * Concrete subclasses can override this to provide a more meaningful and
- * sophisticated behavior whenever a list of ICompletionProposal's should be
- * computed for simple <code>LexerRule</code> call's.
- *
- * This implementation returns an empty list by default.
- *
- * @param terminalRule the 'called' {@link TerminalRule} instance
- * @param ruleCall the ruleCall for the provided lexerRule
- * @param offset an offset within the document for which completions should be computed
- * @return a computed list of <code>ICompletionProposal</code> for the given
- * <code>LexerRule</code>
- */
- protected List<? extends ICompletionProposal> completeTerminalRuleRuleCall(
- TerminalRule terminalRule, RuleCall ruleCall,
- IContentAssistContext contentAssistContext) {
- return Collections.emptyList();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#filter(java.util.List, org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext)
- */
- public List<? extends ICompletionProposal> filter(List<ICompletionProposal> completionProposalList,
- IContentAssistContext contentAssistContext) {
- return ProposalFilterSorterUtil.filter(completionProposalList,contentAssistContext);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#sort(java.util.List)
- */
- public List<? extends ICompletionProposal> sort(List<ICompletionProposal> completionProposalList) {
- return ProposalFilterSorterUtil.sort(completionProposalList);
- }
-
- /**
- * Concrete subclasses can override this to provide custom lookup behavior
- * for <code>CrossReference</code>. This implementation delegates to the
- * injected LinkingService
- *
- * @return a list of <code>ICompletionProposal</code> matching the given
- * assignment
- */
- protected List<? extends ICompletionProposal> lookupCrossReference(
- CrossReference crossReference,IContentAssistContext contentAssistContext) {
- List<ICompletionProposal> completionProposalList = new ArrayList<ICompletionProposal>();
- if (null!= scopeProvider) {
- ParserRule containingParserRule = GrammarUtil.containingParserRule(crossReference);
- if (!GrammarUtil.isDatatypeRule(containingParserRule)) {
- EClass eClass = (EClass) containingParserRule.getType().getClassifier();
- EReference ref = GrammarUtil.getReference(crossReference,eClass);
- String trimmedPrefix = contentAssistContext.getMatchString().trim();
- IScope scope = scopeProvider.getScope(contentAssistContext.getModel(), ref);
- Iterable<IScopedElement> candidates = scope.getAllContents();
- for (IScopedElement candidate : candidates) {
- if (null != candidate.name() && isCandidateMatchingPrefix(contentAssistContext
- .getModel(), ref, candidate, trimmedPrefix)) {
- completionProposalList.add(createCompletionProposal(crossReference, candidate.name(),
- contentAssistContext, getImage(candidate.element())));
- }
- }
- }
- }
- return completionProposalList;
- }
-
- /**
- * Returns the image for the label of the given element.
- *
- * @param element the element for which to provide the label image
- * @return the image used to label the element, or <code>null</code> if there is no image for the given object
- */
- protected Image getImage(EObject eObject) {
- return labelProvider.getImage(eObject);
- }
-
- @SuppressWarnings("unchecked")
- protected List<? extends ICompletionProposal> invokeMethod(String methodName, List<Class<?>> parameterTypes,
- List<?> parameterValues) {
- return (List<? extends ICompletionProposal>) getMethodInvoker().invoke(methodName, parameterTypes, parameterValues);
- }
-
- protected JavaReflectiveMethodInvoker getMethodInvoker() {
- if (null==this.methodInvoker) {
- this.methodInvoker = new JavaReflectiveMethodInvoker(getAllProposalProviders());
- }
- return this.methodInvoker;
- }
-
- public List<IProposalProvider> getAllProposalProviders() {
- if (null==this.proposalProviders) {
- this.proposalProviders = new ArrayList<IProposalProvider>();
- this.proposalProviders.add(this);
- this.proposalProviders.addAll(getReferencedProposalProviders());
- }
- return this.proposalProviders;
- }
-
- protected List<IProposalProvider> getReferencedProposalProviders() {
- return Collections.emptyList();
- }
-
- protected boolean isCandidateMatchingPrefix(EObject model, EReference ref,
- IScopedElement candidate, String prefix) {
- if (candidate.name() == null)
- throw new IllegalArgumentException("unnamed candidates may not be proposed");
- return candidate.name().regionMatches(true, 0, prefix, 0,prefix.length());
- }
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTemplateProposalProvider.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTemplateProposalProvider.java
new file mode 100755
index 0000000..b02810a
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTemplateProposalProvider.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateProposal;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.xtext.crossref.IScopeProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.ITemplateAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ITemplateProposalProvider;
+
+import com.google.inject.Inject;
+
+/**
+ * Provides an abstract implementation of interface {@link ITemplateProposalProvider}.
+ *
+ * @author Michael Clay - Initial contribution and API
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public abstract class AbstractTemplateProposalProvider implements ITemplateProposalProvider {
+
+ @Inject
+ private IScopeProvider scopeProvider;
+
+ public static class NullSafeTemplateAcceptor extends ITemplateAcceptor.Delegate {
+
+ public NullSafeTemplateAcceptor(ITemplateAcceptor delegate) {
+ super();
+ setDelegate(delegate);
+ }
+
+ @Override
+ public void accept(TemplateProposal template) {
+ if (template != null)
+ super.accept(template);
+ }
+ }
+
+ public void createTemplates(ContentAssistContext context, ITemplateAcceptor acceptor) {
+ if (!acceptor.canAcceptMoreTemplates())
+ return;
+ TemplateContext[] templateContexts = createTemplateContexts(context);
+ if (templateContexts == null || templateContexts.length == 0)
+ return;
+
+ ITemplateAcceptor nullSafe = new NullSafeTemplateAcceptor(acceptor);
+ for(TemplateContext templateContext: templateContexts) {
+ if (!nullSafe.canAcceptMoreTemplates())
+ return;
+ templateContext.setVariable("selection", context.getSelectedText()); // name of the selection variables {line, word}_selection //$NON-NLS-1$
+ createTemplates(templateContext, context, nullSafe);
+ }
+ }
+
+ protected abstract void createTemplates(TemplateContext templateContext, ContentAssistContext context, ITemplateAcceptor acceptor);
+
+ protected TemplateProposal createProposal(Template template, TemplateContext templateContext,
+ ContentAssistContext context, Image image, int relevance) {
+ return new TemplateProposal(template, templateContext, context.getReplaceRegion(), image, relevance);
+ }
+
+ protected boolean validate(Template template, TemplateContext context) {
+ try {
+ context.getContextType().validate(template.getPattern());
+ } catch(TemplateException e) {
+ return false;
+ }
+ return true;
+ }
+
+ protected TemplateContext[] createTemplateContexts(ContentAssistContext context) {
+ TemplateContextType[] contextTypes = getContextTypes(context);
+ if (contextTypes != null && contextTypes.length != 0) {
+ TemplateContext[] result = new TemplateContext[contextTypes.length];
+ for(int i = 0; i < contextTypes.length; i++) {
+ result[i] = doCreateTemplateContext(contextTypes[i], context);
+ }
+ return result;
+ }
+ return null;
+ }
+
+ protected TemplateContext doCreateTemplateContext(TemplateContextType contextType, ContentAssistContext context) {
+ return new XtextTemplateContext(contextType, context.getDocument(),
+ new Position(context.getReplaceRegion().getOffset(), context.getReplaceRegion().getLength()),
+ context, getScopeProvider());
+ }
+
+ protected abstract TemplateContextType[] getContextTypes(ContentAssistContext context);
+
+ public void setScopeProvider(IScopeProvider scopeProvider) {
+ this.scopeProvider = scopeProvider;
+ }
+
+ public IScopeProvider getScopeProvider() {
+ return scopeProvider;
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ConfigurableCompletionProposal.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ConfigurableCompletionProposal.java
new file mode 100644
index 0000000..bce0f8b
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ConfigurableCompletionProposal.java
@@ -0,0 +1,349 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension4;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.link.ILinkedModeListener;
+import org.eclipse.jface.text.link.LinkedModeModel;
+import org.eclipse.jface.text.link.LinkedModeUI;
+import org.eclipse.jface.text.link.LinkedPosition;
+import org.eclipse.jface.text.link.LinkedPositionGroup;
+import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags;
+import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.xtext.ui.core.editor.contentassist.PrefixMatcher;
+import org.eclipse.xtext.util.Strings;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class ConfigurableCompletionProposal implements ICompletionProposal, ICompletionProposalExtension2, ICompletionProposalExtension4 {
+
+ private static final Logger log = Logger.getLogger(ConfigurableCompletionProposal.class);
+
+ // copied from final class CompletionProposal
+
+ /** The string to be displayed in the completion proposal popup. */
+ private String displayString;
+ /** The replacement string. */
+ private String replacementString;
+ /** The replacement offset. */
+ private int replacementOffset;
+ /** The replacement length. */
+ private int replacementLength;
+ /** The cursor position after this proposal has been applied. */
+ private int cursorPosition;
+ /** The image to be displayed in the completion proposal popup. */
+ private Image image;
+ /** The context information of this proposal. */
+ private IContextInformation contextInformation;
+ /** The additional info of this proposal. */
+ private String additionalProposalInfo;
+
+ /**
+ * Creates a new completion proposal based on the provided information. The replacement string is
+ * considered being the display string too. All remaining fields are set to <code>null</code>.
+ *
+ * @param replacementString the actual string to be inserted into the document
+ * @param replacementOffset the offset of the text to be replaced
+ * @param replacementLength the length of the text to be replaced
+ * @param cursorPosition the position of the cursor following the insert relative to replacementOffset
+ */
+ public ConfigurableCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition) {
+ this(replacementString, replacementOffset, replacementLength, cursorPosition, null, null, null, null);
+ }
+
+ /**
+ * Creates a new completion proposal. All fields are initialized based on the provided information.
+ *
+ * @param replacementString the actual string to be inserted into the document
+ * @param replacementOffset the offset of the text to be replaced
+ * @param replacementLength the length of the text to be replaced
+ * @param cursorPosition the position of the cursor following the insert relative to replacementOffset
+ * @param image the image to display for this proposal
+ * @param displayString the string to be displayed for the proposal
+ * @param contextInformation the context information associated with this proposal
+ * @param additionalProposalInfo the additional information associated with this proposal
+ */
+ public ConfigurableCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo) {
+ Assert.isNotNull(replacementString);
+ Assert.isTrue(replacementOffset >= 0);
+ Assert.isTrue(replacementLength >= 0);
+ Assert.isTrue(cursorPosition >= 0);
+
+ this.replacementString= replacementString;
+ this.replacementOffset= replacementOffset;
+ this.replacementLength= replacementLength;
+ this.cursorPosition= cursorPosition;
+ this.selectionStart = replacementOffset + cursorPosition;
+ this.image= image;
+ this.displayString= displayString;
+ this.contextInformation= contextInformation;
+ this.additionalProposalInfo= additionalProposalInfo;
+ }
+
+ /*
+ * @see ICompletionProposal#apply(IDocument)
+ */
+ public void apply(IDocument document) {
+ try {
+ document.replace(getReplacementOffset(), getReplacementLength(), getReplacementString());
+ if (linkedMode)
+ setUpLinkedMode(document);
+ } catch (BadLocationException x) {
+ // ignore
+ }
+ }
+
+ /*
+ * @see ICompletionProposal#getSelection(IDocument)
+ */
+ public Point getSelection(IDocument document) {
+ return new Point(getSelectionStart(), getSelectionLength());
+ }
+
+ /*
+ * @see ICompletionProposal#getContextInformation()
+ */
+ public IContextInformation getContextInformation() {
+ return contextInformation;
+ }
+
+ /*
+ * @see ICompletionProposal#getImage()
+ */
+ public Image getImage() {
+ return image;
+ }
+
+ /*
+ * @see ICompletionProposal#getDisplayString()
+ */
+ public String getDisplayString() {
+ if (displayString != null)
+ return displayString;
+ return replacementString;
+ }
+
+ /*
+ * @see ICompletionProposal#getAdditionalProposalInfo()
+ */
+ public String getAdditionalProposalInfo() {
+ return additionalProposalInfo;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null)
+ return false;
+ if (!(obj instanceof ConfigurableCompletionProposal))
+ return false;
+ String otherDisplayString = ((ConfigurableCompletionProposal) obj).getDisplayString();
+ return Strings.equal(otherDisplayString, getDisplayString());
+ }
+
+ @Override
+ public int hashCode() {
+ String displayString = getDisplayString();
+ return displayString != null ? displayString.hashCode() : 31;
+ }
+
+ // end copy
+
+ private boolean autoInsertable = true;
+
+ private int selectionLength = 0;
+
+ private int selectionStart;
+ private boolean linkedMode;
+ private ITextViewer viewer;
+ private char[] exitChars;
+ private PrefixMatcher matcher;
+
+ public boolean isAutoInsertable() {
+ return autoInsertable;
+ }
+
+ public void setAutoInsertable(boolean autoInsertable) {
+ this.autoInsertable = autoInsertable;
+ }
+
+ public String getReplacementString() {
+ return replacementString;
+ }
+
+ public int getReplacementOffset() {
+ return replacementOffset;
+ }
+
+ public int getReplacementLength() {
+ return replacementLength;
+ }
+
+ public int getCursorPosition() {
+ return cursorPosition;
+ }
+
+ public void setDisplayString(String displayString) {
+ this.displayString = displayString;
+ }
+
+ public void setReplacementString(String replacementString) {
+ this.replacementString = replacementString;
+ }
+
+ public void setReplacementOffset(int replacementOffset) {
+ this.replacementOffset = replacementOffset;
+ }
+
+ public void setReplacementLength(int replacementLength) {
+ this.replacementLength = replacementLength;
+ }
+
+ public void setCursorPosition(int cursorPosition) {
+ this.cursorPosition = cursorPosition;
+ }
+
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+ public void setContextInformation(IContextInformation contextInformation) {
+ this.contextInformation = contextInformation;
+ }
+
+ public void setAdditionalProposalInfo(String additionalProposalInfo) {
+ this.additionalProposalInfo = additionalProposalInfo;
+ }
+
+ public int getSelectionStart() {
+ return selectionStart;
+ }
+
+ public int getSelectionLength() {
+ return selectionLength;
+ }
+
+ public void setSelectionLength(int selectionLength) {
+ this.selectionLength = selectionLength;
+ }
+
+ public void setSelectionStart(int selectionStart) {
+ this.selectionStart = selectionStart;
+ }
+
+ public void setSimpleLinkedMode(ITextViewer viewer, char... exitChars) {
+ this.linkedMode = true;
+ this.viewer = viewer;
+ this.exitChars = exitChars;
+ }
+
+ public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
+ apply(viewer.getDocument());
+ }
+
+ public void selected(ITextViewer viewer, boolean smartToggle) {
+ // TODO implement highlighting depending on smartToggle
+ }
+
+ public void unselected(ITextViewer viewer) {
+ // TODO implement highlighting depending on smartToggle
+ }
+
+ public boolean validate(IDocument document, int offset, DocumentEvent event) {
+ try {
+ String prefix = document.get(replacementOffset, offset - replacementOffset);
+ return matcher.isCandidateMatchingPrefix(replacementString, prefix);
+ }
+ catch (BadLocationException e) {
+ log.info(e.getMessage(), e);
+ return false;
+ }
+ }
+
+ public void setMatcher(PrefixMatcher matcher) {
+ this.matcher = matcher;
+ }
+
+ public PrefixMatcher getMatcher() {
+ return matcher;
+ }
+
+ // copied from AbstractJavaCompletionProposal
+ /**
+ * Sets up a simple linked mode at {@link #getCursorPosition()} and an exit policy that will
+ * exit the mode when <code>closingCharacter</code> is typed and an exit position at
+ * <code>getCursorPosition() + 1</code>.
+ *
+ * @param document the document
+ * @param closingCharacter the exit character
+ */
+ protected void setUpLinkedMode(IDocument document) {
+ try {
+ LinkedPositionGroup group= new LinkedPositionGroup();
+ group.addPosition(new LinkedPosition(document, getSelectionStart(), getSelectionLength(), LinkedPositionGroup.NO_STOP));
+
+ LinkedModeModel model= new LinkedModeModel();
+ model.addGroup(group);
+ model.forceInstall();
+
+ LinkedModeUI ui= new LinkedModeUI(model, viewer);
+// ui.setSimpleMode(true);
+ ui.setExitPolicy(new ExitPolicy(exitChars));
+ ui.setExitPosition(viewer, getCursorPosition() + getReplacementOffset(), 0, Integer.MAX_VALUE);
+ ui.setCyclingMode(LinkedModeUI.CYCLE_NEVER);
+ ui.enter();
+ } catch (BadLocationException e) {
+ log.info(e.getMessage(), e);
+ }
+ }
+
+ // mainly copied from AbstractJavaCompletionProposal
+ protected static class ExitPolicy implements IExitPolicy {
+
+ private final char exitCharacters[];
+
+ public ExitPolicy(char[] exitCharacter) {
+ exitCharacters= exitCharacter;
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.ExitPolicy#doExit(org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager, org.eclipse.swt.events.VerifyEvent, int, int)
+ */
+ public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) {
+ if (event.character == '\0')
+ return null;
+ for (char c: exitCharacters) {
+ if (event.character == c) {
+ return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
+ }
+ }
+
+ switch (event.character) {
+ case SWT.CR:
+ return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
+ default:
+ return null;
+ }
+ }
+
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistContext.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistContext.java
deleted file mode 100644
index 1c25deb..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistContext.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.parsetree.AbstractNode;
-import org.eclipse.xtext.parsetree.CompositeNode;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * @author Sven Efftinge - Initial contribution and API
- *
- */
-public class ContentAssistContext implements IContentAssistContext {
-
- private String matchingString;
- private EObject model;
- private AbstractNode node;
- private int offSet;
- private AbstractNode referenceNode;
- private CompositeNode rootNode;
-
- public ContentAssistContext(EObject model, int offSet, String matchingString, AbstractNode node,
- AbstractNode referenceNode, CompositeNode rootNode) {
- super();
- this.model = model;
- this.offSet = offSet;
- this.matchingString = matchingString;
- this.node = node;
- this.referenceNode = referenceNode;
- this.rootNode = rootNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext
- * #getMatchString()
- */
- public String getMatchString() {
- return matchingString;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext
- * #getModel()
- */
- public EObject getModel() {
- return model;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext
- * #getNode()
- */
- public AbstractNode getNode() {
- return node;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext
- * #getOffSet()
- */
- public int getOffSet() {
- return offSet;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext
- * #getReferenceNode()
- */
- public AbstractNode getReferenceNode() {
- return referenceNode;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext
- * #getRootNode()
- */
- public CompositeNode getRootNode() {
- return rootNode;
- }
-
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistContextFactory.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistContextFactory.java
deleted file mode 100644
index 163b347..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistContextFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.parser.IParseResult;
-import org.eclipse.xtext.parsetree.AbstractNode;
-import org.eclipse.xtext.parsetree.CompositeNode;
-import org.eclipse.xtext.parsetree.NodeUtil;
-import org.eclipse.xtext.parsetree.ParseTreeUtil;
-import org.eclipse.xtext.resource.XtextResource;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-public class ContentAssistContextFactory {
- public static IContentAssistContext create(XtextResource resource, int offset, String prefix) {
- IParseResult parseResult = resource.getParseResult();
- Assert.isNotNull(parseResult);
-
- CompositeNode rootNode = parseResult.getRootNode();
-
- AbstractNode referenceNode = ParseTreeUtil.getLastCompleteNodeByOffset(rootNode, offset);
-
- EObject model = NodeUtil.getNearestSemanticObject(referenceNode);
-
- AbstractNode node = ParseTreeUtil.getCurrentOrFollowingNodeByOffset(rootNode, offset);
-
- return new ContentAssistContext(model, offset, prefix, node,
- referenceNode, rootNode);
- }
-
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/CrossReferenceTemplateVariableResolver.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/CrossReferenceTemplateVariableResolver.java
new file mode 100644
index 0000000..09f2554
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/CrossReferenceTemplateVariableResolver.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateVariable;
+import org.eclipse.jface.text.templates.TemplateVariableResolver;
+import org.eclipse.xtext.AbstractMetamodelDeclaration;
+import org.eclipse.xtext.Grammar;
+import org.eclipse.xtext.GrammarUtil;
+import org.eclipse.xtext.crossref.IScope;
+import org.eclipse.xtext.crossref.IScopedElement;
+
+/**
+ * @author Michael Clay - Initial contribution and API
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class CrossReferenceTemplateVariableResolver extends TemplateVariableResolver {
+
+ public CrossReferenceTemplateVariableResolver() {
+ super("CrossReference", "TemplateVariableResolver for CrossReferences");
+ }
+
+ @Override
+ public void resolve(TemplateVariable variable, TemplateContext templateContext) {
+ XtextTemplateContext castedContext = (XtextTemplateContext) templateContext;
+
+ String abbreviatedCrossReference = (String) variable.getVariableType().getParams().iterator().next();
+
+ String[] classReferencePair = abbreviatedCrossReference.split("\\.");
+
+ EReference reference = getReference(classReferencePair[0], classReferencePair[1], getGrammar(castedContext));
+
+ IScope scope = castedContext.getScopeProvider().getScope(castedContext.getContentAssistContext().getCurrentModel(), reference);
+ Iterable<IScopedElement> linkingCandidates = scope.getAllContents();
+
+ List<String> names = new ArrayList<String>();
+
+ for (IScopedElement scopedElement : linkingCandidates) {
+ names.add(scopedElement.name());
+ }
+
+ String[] bindings = names.toArray(new String[names.size()]);
+
+ if (bindings.length != 0)
+ variable.setValues(bindings);
+ if (bindings.length > 1)
+ variable.setUnambiguous(false);
+ else
+ variable.setUnambiguous(isUnambiguous(castedContext));
+
+ variable.setResolved(true);
+ }
+
+ private Grammar getGrammar(XtextTemplateContext xtextTemplateContext) {
+ EObject grammarElement = xtextTemplateContext.getContentAssistContext().getRootNode().getGrammarElement();
+ Grammar g = (Grammar) EcoreUtil.getRootContainer(grammarElement);
+ return g;
+ }
+
+ private EReference getReference(String eClassName, String eReferenceName, Grammar g) {
+ List<AbstractMetamodelDeclaration> allMetamodelDeclarations = GrammarUtil.allMetamodelDeclarations(g);
+ for (AbstractMetamodelDeclaration decl : allMetamodelDeclarations) {
+ EClass eClass = (EClass) decl.getEPackage().getEClassifier(eClassName);
+ if (eClass != null) {
+ return (EReference) eClass.getEStructuralFeature(eReferenceName);
+ }
+ }
+ return null;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java
deleted file mode 100644
index d0a678a..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.AbstractElement;
-import org.eclipse.xtext.AbstractRule;
-import org.eclipse.xtext.Action;
-import org.eclipse.xtext.Alternatives;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.EnumLiteralDeclaration;
-import org.eclipse.xtext.EnumRule;
-import org.eclipse.xtext.GrammarUtil;
-import org.eclipse.xtext.Group;
-import org.eclipse.xtext.Keyword;
-import org.eclipse.xtext.ParserRule;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.parsetree.AbstractNode;
-import org.eclipse.xtext.parsetree.ParseTreeUtil;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistCalculator;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-import org.eclipse.xtext.util.XtextSwitch;
-
-/**
- * Provides a default implementation of interface {@link IContentAssistContext} designed as <b>Switch</b> over the
- * Xtext ecore inheritance hierarchy to calculate and resolve (or flatten) 'container' level elements like
- * <code>Group</code> or <code>Alternatives</code> to gather potential completion proposal candidates.
- *
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)} instead of
- * typical <code>if (x instanceof y)</code> code blocks.
- *
- * @author Michael Clay - Initial contribution and API
- * @see org.eclipse.xtext.util.XtextSwitch
- */
-public class DefaultContentAssistCalculator extends XtextSwitch<List<AbstractElement>> implements IContentAssistCalculator {
-
- public List<AbstractElement> computeProposalElements(IContentAssistContext contentAssistContext) {
- List<AbstractElement> computedElementList = new ArrayList<AbstractElement>();
- AbstractNode referenceNode=contentAssistContext.getReferenceNode();
- Set<AbstractElement> nextValidElementSet = ParseTreeUtil.getElementSetValidFromOffset(
- contentAssistContext.getRootNode(),referenceNode, contentAssistContext.getOffSet());
-
- for (Iterator<AbstractElement> iterator = nextValidElementSet.iterator(); iterator.hasNext();) {
- AbstractElement abstractElement = iterator.next();
- computedElementList.addAll(doSwitch(abstractElement));
- }
- return computedElementList;
- }
-
- @Override
- public List<AbstractElement> caseAlternatives(Alternatives alternatives) {
- List<AbstractElement> elementList = new ArrayList<AbstractElement>();
- for (AbstractElement alternativeElement : alternatives.getGroups()) {
- addWithNullCheck(elementList, doSwitch(alternativeElement));
- }
- return elementList;
- }
-
- @Override
- public List<AbstractElement> caseEnumLiteralDeclaration(EnumLiteralDeclaration object) {
- return Arrays.asList(object.getLiteral(), object);
- }
-
- @Override
- public List<AbstractElement> caseGroup(Group group) {
- List<AbstractElement> elementList = new ArrayList<AbstractElement>();
- boolean includeNext = true;
- for (Iterator<AbstractElement> iterator = group.getTokens().iterator(); iterator.hasNext()
- && includeNext;) {
- AbstractElement groupElement = iterator.next();
- addWithNullCheck(elementList, doSwitch(groupElement));
- includeNext = isOptional(groupElement);
- }
- return elementList;
- }
-
- @Override
- public List<AbstractElement> caseAssignment(Assignment assignment) {
- List<AbstractElement> elementList = new ArrayList<AbstractElement>();
- if (assignment.getTerminal() instanceof RuleCall) {
- addWithNullCheck(elementList, doSwitch(assignment.getTerminal()));
- } else if (assignment.getTerminal() instanceof Alternatives) {
- addWithNullCheck(elementList, doSwitch(assignment.getTerminal()));
- } else if (assignment.getTerminal() instanceof Keyword) {
- addWithNullCheck(elementList, doSwitch(assignment.getTerminal()));
- }
- elementList.add(assignment);
- return elementList;
- }
-
- @Override
- public List<AbstractElement> caseRuleCall(RuleCall ruleCall) {
- List<AbstractElement> elementList = new ArrayList<AbstractElement>(Collections.singleton(ruleCall));
- AbstractRule abstractRule = ruleCall.getRule();
- if (abstractRule instanceof ParserRule || abstractRule instanceof EnumRule) {
- addWithNullCheck(elementList, doSwitch(abstractRule.getAlternatives()));
- }
- return elementList;
- }
-
- @Override
- public List<AbstractElement> caseCrossReference(CrossReference crossReference) {
- return Collections.singletonList(((AbstractElement)crossReference.eContainer()));
- }
-
- @Override
- public List<AbstractElement> defaultCase(EObject object) {
- return Collections.singletonList(((AbstractElement)object));
- }
-
- private void addWithNullCheck(List<AbstractElement> source, List<AbstractElement> list) {
- if (null != list) {
- source.addAll(list);
- }
- }
-
- private boolean isOptional(AbstractElement groupElement) {
- boolean isOptional = true;
- if ((groupElement instanceof Group || groupElement instanceof Alternatives) && !GrammarUtil.isOptionalCardinality(groupElement)) {
- EList<AbstractElement> abstractTokens = groupElement instanceof Group ?
- ((Group) groupElement).getTokens() : ((Alternatives) groupElement).getGroups();
- for (Iterator<AbstractElement> iterator = abstractTokens.iterator(); isOptional && iterator.hasNext();) {
- AbstractElement abstractElement = iterator.next();
- isOptional = isOptional(abstractElement);
- }
-
- } else if (!(groupElement instanceof Action)) {
- isOptional = GrammarUtil.isOptionalCardinality(groupElement);
- }
- return isOptional;
- }
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistContextFactory.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistContextFactory.java
new file mode 100755
index 0000000..298e1ab
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistContextFactory.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.TerminalRule;
+import org.eclipse.xtext.parser.IParseResult;
+import org.eclipse.xtext.parsetree.AbstractNode;
+import org.eclipse.xtext.parsetree.CompositeNode;
+import org.eclipse.xtext.parsetree.LeafNode;
+import org.eclipse.xtext.parsetree.NodeUtil;
+import org.eclipse.xtext.parsetree.ParseTreeUtil;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.IFollowElementCalculator;
+import org.eclipse.xtext.ui.core.editor.contentassist.PrefixMatcher;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class DefaultContentAssistContextFactory implements ContentAssistContext.Factory {
+
+ @Inject
+ private IFollowElementCalculator followElementCalculator;
+
+ @Inject
+ private Provider<ContentAssistContext> contentAssistContextProvider;
+
+ @Inject
+ private PrefixMatcher matcher;
+
+ public ContentAssistContext[] create(ITextViewer viewer, int offset, XtextResource resource) {
+ List<ContentAssistContext> result = new ArrayList<ContentAssistContext>(2);
+ IParseResult parseResult = resource.getParseResult();
+ if (parseResult == null)
+ throw new NullPointerException("parseResult is null");
+
+ // adjust offset to beginning of normalized selection
+ ITextSelection selection= (ITextSelection) viewer.getSelectionProvider().getSelection();
+ int fixedOffset = offset;
+ if (selection.getOffset() + selection.getLength() == offset)
+ fixedOffset= selection.getOffset();
+
+ CompositeNode rootNode = parseResult.getRootNode();
+ AbstractNode lastCompleteNode = ParseTreeUtil.getLastCompleteNodeByOffset(rootNode, fixedOffset);
+ EObject currentModel = NodeUtil.getNearestSemanticObject(lastCompleteNode);
+ AbstractNode currentNode = ParseTreeUtil.getCurrentOrFollowingNodeByOffset(rootNode, fixedOffset);
+
+ if (lastCompleteNode.getOffset()+lastCompleteNode.getLength() == fixedOffset) {
+ AbstractNode precedingLastCompleteNode = ParseTreeUtil.getLastCompleteNodeByOffset(rootNode, Math.max(0, lastCompleteNode.getOffset()));
+ String prefix = getPrefix(lastCompleteNode, fixedOffset);
+ result.add(createContext(viewer, fixedOffset, parseResult, rootNode, precedingLastCompleteNode, currentModel, lastCompleteNode, prefix));
+
+ if (lastCompleteNode.getGrammarElement() instanceof Keyword ||
+ lastCompleteNode.getGrammarElement() instanceof CrossReference ||
+ (lastCompleteNode.getGrammarElement() instanceof RuleCall &&
+ ((RuleCall)lastCompleteNode.getGrammarElement()).getRule() instanceof TerminalRule)) {
+ result.add(createContext(viewer, fixedOffset, parseResult, rootNode, lastCompleteNode, currentModel, currentNode, ""));
+ }
+ } else if (lastCompleteNode == currentNode) {
+ AbstractNode precedingLastCompleteNode = ParseTreeUtil.getLastCompleteNodeByOffset(rootNode, Math.max(0, lastCompleteNode.getOffset()));
+ String prefix = getPrefix(currentNode, fixedOffset);
+ result.add(createContext(viewer, fixedOffset, parseResult, rootNode, precedingLastCompleteNode, currentModel, currentNode, prefix));
+ } else {
+ String prefix = getPrefix(currentNode, fixedOffset);
+ result.add(createContext(viewer, fixedOffset, parseResult, rootNode, lastCompleteNode, currentModel, currentNode, prefix));
+ }
+
+ return result.toArray(new ContentAssistContext[result.size()]);
+ }
+
+ public ContentAssistContext createContext(ITextViewer viewer, int offset, IParseResult parseResult, CompositeNode rootNode,
+ AbstractNode lastCompleteNode, EObject currentModel, AbstractNode currentNode, String prefix) {
+ ITextSelection selection= (ITextSelection) viewer.getSelectionProvider().getSelection();
+ ContentAssistContext context = contentAssistContextProvider.get();
+
+ context.setRootNode(rootNode);
+ context.setLastCompleteNode(lastCompleteNode);
+ context.setCurrentNode(currentNode);
+
+ context.setRootModel(parseResult.getRootASTElement());
+ context.setCurrentModel(currentModel);
+ context.setOffset(offset);
+ context.setViewer(viewer);
+ context.setPrefix(prefix);
+ int regionLength = prefix.length();
+ if (selection.getLength() > 0)
+ regionLength = regionLength + selection.getLength();
+ Region region= new Region(offset - prefix.length(), regionLength);
+ context.setReplaceRegion(region);
+ context.setSelectedText(selection.getText());
+ followElementCalculator.calculateValidElements(rootNode, lastCompleteNode, offset, context);
+ context.setMatcher(matcher);
+ return context;
+ }
+
+ public String getPrefix(AbstractNode currentNode, int offset) {
+ if (currentNode instanceof LeafNode) {
+ if (((LeafNode) currentNode).isHidden())
+ return "";
+ return getNodeText(currentNode, offset);
+ }
+ StringBuilder result = new StringBuilder(currentNode.getTotalLength());
+ doComputePrefix((CompositeNode) currentNode, result, offset);
+ return result.toString();
+ }
+
+ public String getNodeText(AbstractNode currentNode, int offset) {
+ int startOffset = currentNode.getOffset();
+ String text = ((LeafNode) currentNode).getText();
+ String result = text.substring(0, offset - startOffset);
+ return result;
+ }
+
+ public boolean doComputePrefix(CompositeNode node, StringBuilder result, int offset) {
+ List<LeafNode> hiddens = new ArrayList<LeafNode>(2);
+ for (AbstractNode child: node.getChildren()) {
+ if (child instanceof CompositeNode) {
+ if (!doComputePrefix((CompositeNode) child, result, offset))
+ return false;
+ } else {
+ LeafNode leaf = (LeafNode) child;
+ if (leaf.getOffset() > offset)
+ return false;
+ if (leaf.isHidden()) {
+ if (result.length() != 0)
+ hiddens.add((LeafNode)child);
+ } else {
+ Iterator<LeafNode> iter = hiddens.iterator();
+ while(iter.hasNext()) {
+ result.append(iter.next().getText());
+ }
+ hiddens.clear();
+ result.append(getNodeText(leaf, offset));
+ if (leaf.getOffset() + leaf.getLength() > offset)
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessor.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessor.java
deleted file mode 100644
index 72b4936..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessor.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import static java.lang.Math.max;
-import static org.eclipse.xtext.parsetree.ParseTreeUtil.getCurrentOrFollowingNodeByOffset;
-import static org.eclipse.xtext.parsetree.ParseTreeUtil.getLastCompleteNodeByOffset;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ContextInformationValidator;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.xtext.AbstractElement;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.Keyword;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.TerminalRule;
-import org.eclipse.xtext.XtextPackage;
-import org.eclipse.xtext.parser.IParseResult;
-import org.eclipse.xtext.parsetree.AbstractNode;
-import org.eclipse.xtext.parsetree.CompositeNode;
-import org.eclipse.xtext.parsetree.LeafNode;
-import org.eclipse.xtext.parsetree.NodeUtil;
-import org.eclipse.xtext.resource.XtextResource;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistCalculator;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.ITemplateContentAssistProcessor;
-import org.eclipse.xtext.ui.core.editor.model.IXtextDocument;
-import org.eclipse.xtext.ui.core.editor.model.UnitOfWork;
-
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-
-/**
- * The default implementation of interface {@link IContentAssistProcessor} provided with Xtext.
- *
- * @author Michael Clay - Initial contribution and API
- * @author Heiko Behrens
- * @author Jan K&ouml;hnlein
- */
-public class DefaultContentAssistProcessor implements IContentAssistProcessor {
- // logger available to subclasses
- protected final Logger logger = Logger.getLogger(getClass());
- @Inject
- protected ITemplateContentAssistProcessor templateContentAssistProcessor;
- @Inject
- protected IContentAssistCalculator contentAssistCalculator;
- @Inject
- protected IProposalProvider proposalProvider;
- /**
- * Computes the possible grammar elements following the one at the given offset and calls the respective methods on
- * the proposal provider.
- */
- public ICompletionProposal[] computeCompletionProposals(final ITextViewer viewer, final int offset) {
- IXtextDocument document = (IXtextDocument) viewer.getDocument();
- return document.readOnly(new ContentAssistProcessorUow(offset, viewer));
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
- */
- public String getErrorMessage() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- return new ContextInformationValidator(this);
- }
-
- protected List<ICompletionProposal> collectCompletionProposals(List<AbstractElement> computeProposalElements, IContentAssistContext contentAssistContext) {
- List<ICompletionProposal> completionProposalList = new ArrayList<ICompletionProposal>();
- for (AbstractElement computeProposalElement : computeProposalElements) {
- List<? extends ICompletionProposal> proposals;
- switch(computeProposalElement.eClass().getClassifierID()) {
- case XtextPackage.KEYWORD:
- proposals = proposalProvider.completeKeyword((Keyword) computeProposalElement, contentAssistContext);
- addAllIfNotNull(completionProposalList,proposals);
- break;
- case XtextPackage.RULE_CALL:
- proposals = proposalProvider.completeRuleCall((RuleCall) computeProposalElement, contentAssistContext);
- addAllIfNotNull(completionProposalList,proposals);
- break;
- case XtextPackage.ASSIGNMENT:
- proposals = proposalProvider.completeAssignment((Assignment) computeProposalElement, contentAssistContext);
- addAllIfNotNull(completionProposalList,proposals);
- break;
- }
- }
- return completionProposalList;
- }
-
- private <T> void addAllIfNotNull(List<T> completionProposalList,
- List<? extends T> proposals) {
- if (proposals != null)
- Iterables.addAll(completionProposalList, Iterables.filter(proposals, Predicates.notNull()));
- }
-
- protected List<TemplateContextType> collectTemplateContextTypes(List<AbstractElement> computeProposalElements,
- IContentAssistContext contentAssistContext) {
- List<TemplateContextType> templateContextTypes = new ArrayList<TemplateContextType>();
- for (AbstractElement computeProposalElement : computeProposalElements) {
- TemplateContextType templateContextType;
- switch (computeProposalElement.eClass().getClassifierID()) {
- case XtextPackage.KEYWORD:
- templateContextType = proposalProvider.getTemplateContextType((Keyword) computeProposalElement,
- contentAssistContext);
- addIfNotNull(templateContextTypes, templateContextType);
- break;
- case XtextPackage.RULE_CALL:
- templateContextType = proposalProvider.getTemplateContextType((RuleCall) computeProposalElement,
- contentAssistContext);
- addIfNotNull(templateContextTypes, templateContextType);
- break;
- case XtextPackage.ASSIGNMENT:
- // TODO: change interface
- // templateContextType =
- // proposalProvider.getTemplateContextType((Assignment)computeProposalElement, contentAssistContext);
- // addIfNotNull(templateContextTypes, templateContextType);
- break;
- }
- }
- return templateContextTypes;
- }
-
- private <T> void addIfNotNull(List<T> result, T obj) {
- if (obj != null)
- result.add(obj);
- }
-
- /**
- * Adds templates to the list of proposals,
- *
- * @param viewer the viewer whose document is used to compute the proposals
- * @param offset an offset within the document for which completions should be computed
- * @param contentAssistContext the current context of the content assist proposal request
- * @param templateContextType within which templates are resolved
- * @param completionProposalList list of proposal to add to
- */
- protected void addTemplates(ITextViewer viewer, int offset, IContentAssistContext contentAssistContext,
- TemplateContextType templateContextType, List<ICompletionProposal> completionProposalList) {
- if (templateContentAssistProcessor != null) {
- templateContentAssistProcessor.setContentAssistContext(contentAssistContext);
- templateContentAssistProcessor.setContextType(templateContextType);
- completionProposalList.addAll(Arrays.asList(templateContentAssistProcessor.computeCompletionProposals(
- viewer, offset)));
- }
- }
- /**
- * Creates a new <code>IContentAssistContext</code> with all required informations for the current CA request.
- *
- * @param resource the underlying EMF resource to read (parse) from
- * @param viewer the viewer whose document is used to compute the proposals
- * @param offset the offset within the resource for which the context should be created
- * @return a list of applicable <code>IContentAssistContext</code>
- */
- protected List<IContentAssistContext> createContextList(XtextResource resource, String text, final int offset) {
- List<IContentAssistContext> result = new ArrayList<IContentAssistContext>();
- IParseResult parseResult = resource.getParseResult();
- Assert.isNotNull(parseResult);
- CompositeNode rootNode = parseResult.getRootNode();
- AbstractNode referenceNode = getLastCompleteNodeByOffset(rootNode, offset);
- AbstractNode nodeAtOffset = getCurrentOrFollowingNodeByOffset(rootNode, offset);
-
- if (referenceNode.getOffset()+referenceNode.getLength() == offset) {
- AbstractNode precedingReferenceNode = getLastCompleteNodeByOffset(rootNode,max(0, referenceNode.getOffset()));
- String matchingString = computeMatchString(referenceNode);
- result.add(newContentAssistContext(matchingString, offset, rootNode, precedingReferenceNode));
- if (referenceNode.getGrammarElement() instanceof Keyword ||
- referenceNode.getGrammarElement() instanceof CrossReference ||
- (referenceNode.getGrammarElement() instanceof RuleCall &&
- ((RuleCall)referenceNode.getGrammarElement()).getRule() instanceof TerminalRule)) {
- result.add(newContentAssistContext("", offset, rootNode, referenceNode));
- }
- } else if (referenceNode == nodeAtOffset) {
- AbstractNode precedingReferenceNode = getLastCompleteNodeByOffset(rootNode,max(0, referenceNode.getOffset()));
- String matchingString = calculateMatchString(nodeAtOffset,text, offset);
- result.add(newContentAssistContext(matchingString, offset, rootNode, precedingReferenceNode));
- } else {
- String matchingString = calculateMatchString(nodeAtOffset,text, offset);
- result.add(newContentAssistContext(matchingString, offset, rootNode, referenceNode));
- }
-
- return result;
- }
-
- protected String computeMatchString(AbstractNode node) {
- if (node instanceof LeafNode) {
- return ((LeafNode) node).getText();
- }
- StringBuilder result = new StringBuilder(node.getTotalLength());
- doComputeMatchString((CompositeNode) node, result);
- return result.toString();
- }
-
- protected void doComputeMatchString(CompositeNode node, StringBuilder result) {
- List<LeafNode> hiddens = new ArrayList<LeafNode>(2);
- for (AbstractNode child: node.getChildren()) {
- if (child instanceof CompositeNode) {
- doComputeMatchString((CompositeNode) child, result);
- } else {
- if (((LeafNode) child).isHidden()) {
- if (result.length() != 0)
- hiddens.add((LeafNode)child);
- } else {
- Iterator<LeafNode> iter = hiddens.iterator();
- while(iter.hasNext()) {
- result.append(iter.next().getText());
- iter.remove();
- }
- result.append(((LeafNode) child).getText());
- }
- }
- }
- }
-
- /**
- * Calculates the match string of the based on the specified location within the given text.
- *
- * @param caretNode the node at the current caret position
- * @param text the text to compute the matching string
- * @param offset an offset within the document for which the matchstring should be computed
- * @return a matching string
- */
- protected String calculateMatchString(AbstractNode caretNode, String text, int offset) {
- StringBuilder matchString = new StringBuilder();
- char c = ' ';
- while (offset>caretNode.getOffset() && !Character.isWhitespace(c = text.charAt(--offset))) {
- matchString.insert(0, c);
- }
- return matchString.toString();
- }
-
- private ContentAssistContext newContentAssistContext(String matchingString, final int offset, CompositeNode rootNode,
- AbstractNode referenceNode) {
- EObject model = NodeUtil.getNearestSemanticObject(referenceNode);
- AbstractNode node = getCurrentOrFollowingNodeByOffset(rootNode, offset);
- return new ContentAssistContext(model, offset, matchingString, node, referenceNode, rootNode);
- }
-
- private final class ContentAssistProcessorUow implements UnitOfWork<ICompletionProposal[]> {
- private final int offset;
- private final ITextViewer viewer;
-
- private ContentAssistProcessorUow(int offset, ITextViewer viewer) {
- this.offset = offset;
- this.viewer = viewer;
- }
-
- public ICompletionProposal[] exec(XtextResource resource) throws Exception {
- List<ICompletionProposal> completionProposalList = new ArrayList<ICompletionProposal>();
- List<IContentAssistContext> contextList = createContextList(
- resource, viewer.getTextWidget().getText(), offset);
- for (IContentAssistContext contentAssistContext : contextList) {
- List<AbstractElement> computedElements = contentAssistCalculator
- .computeProposalElements(contentAssistContext);
- completionProposalList.addAll(collectCompletionProposals(computedElements,contentAssistContext));
- for (TemplateContextType templateContextType : collectTemplateContextTypes(computedElements,
- contentAssistContext)) {
- addTemplates(viewer, offset, contentAssistContext, templateContextType, completionProposalList);
- }
- proposalProvider.filter(completionProposalList,contentAssistContext);
- }
- proposalProvider.sort(completionProposalList);
- return completionProposalList.toArray(new ICompletionProposal[completionProposalList.size()]);
- }
- }
-
-}
-
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistantFactory.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistantFactory.java
new file mode 100644
index 0000000..63ac1ab
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistantFactory.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.xtext.ui.core.editor.contentassist.IContentAssistantFactory;
+
+import com.google.inject.Inject;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class DefaultContentAssistantFactory implements IContentAssistantFactory {
+
+ @Inject(optional = true)
+ private IContentAssistProcessor contentAssistProcessor;
+
+ public IContentAssistant createConfiguredAssistant(SourceViewerConfiguration configuration,
+ ISourceViewer sourceViewer) {
+ ContentAssistant assistant = createAssistant();
+ configureContentAssistant(assistant, configuration, sourceViewer);
+ return assistant;
+ }
+
+ protected ContentAssistant createAssistant() {
+ // cannot use Provider<ContentAssistent>.get() since ContentAssistant does not know anything about guice
+ return new ContentAssistant();
+ }
+
+ protected void configureContentAssistant(ContentAssistant assistant, SourceViewerConfiguration configuration, ISourceViewer sourceViewer) {
+ configureDefaults(assistant, configuration, sourceViewer);
+ loadPreferences(assistant);
+ }
+
+ protected void loadPreferences(ContentAssistant assistant) {
+ // TODO load CA preferences
+ }
+
+ private void configureDefaults(ContentAssistant assistant, SourceViewerConfiguration configuration, ISourceViewer sourceViewer) {
+ setAutoInsert(assistant);
+ setContentAssistProcessor(assistant);
+ setInformationControlCreator(assistant, configuration, sourceViewer);
+ }
+
+ private void setInformationControlCreator(ContentAssistant assistant, SourceViewerConfiguration configuration,
+ ISourceViewer sourceViewer) {
+ if (configuration != null && sourceViewer != null)
+ assistant.setInformationControlCreator(configuration.getInformationControlCreator(sourceViewer));
+ }
+
+ protected void setAutoInsert(ContentAssistant assistant) {
+ assistant.enableAutoInsert(true);
+ }
+
+ protected void setContentAssistProcessor(ContentAssistant assistant) {
+ if (contentAssistProcessor != null)
+ assistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultFollowElementCalculator.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultFollowElementCalculator.java
new file mode 100644
index 0000000..7586df0
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultFollowElementCalculator.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import java.util.Set;
+
+import org.eclipse.xtext.AbstractElement;
+import org.eclipse.xtext.AbstractRule;
+import org.eclipse.xtext.Action;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.EnumLiteralDeclaration;
+import org.eclipse.xtext.EnumRule;
+import org.eclipse.xtext.GrammarUtil;
+import org.eclipse.xtext.Group;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.ParserRule;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.parsetree.AbstractNode;
+import org.eclipse.xtext.parsetree.CompositeNode;
+import org.eclipse.xtext.parsetree.ParseTreeUtil;
+import org.eclipse.xtext.ui.core.editor.contentassist.IFollowElementCalculator;
+import org.eclipse.xtext.util.XtextSwitch;
+
+/**
+ * Provides a default implementation of interface {@link IFollowElementCalculator} to compute
+ * the valid element set at a given offset.
+ *
+ * @author Michael Clay - Initial contribution and API
+ * @author Sebastian Zarnekow
+ */
+public class DefaultFollowElementCalculator implements IFollowElementCalculator {
+
+ public void calculateValidElements(CompositeNode rootNode, AbstractNode lastCompleteNode, int offset, IFollowElementAcceptor acceptor) {
+ Set<AbstractElement> nextValidElementSet = getValidElementSet(rootNode, lastCompleteNode, offset);
+ if (nextValidElementSet != null && !nextValidElementSet.isEmpty()) {
+ IFollowElementAcceptor nullSafeAcceptor = new NullSafeElementAcceptor(acceptor);
+ ElementSwitch elementSwitch = new ElementSwitch(nullSafeAcceptor);
+ for (AbstractElement element: nextValidElementSet) {
+ elementSwitch.doSwitch(element);
+ }
+ }
+ }
+
+ public Set<AbstractElement> getValidElementSet(CompositeNode rootNode, AbstractNode lastCompleteNode, int offset) {
+ return ParseTreeUtil.getElementSetValidFromOffset(rootNode, lastCompleteNode, offset);
+ }
+
+ public static class NullSafeElementAcceptor implements IFollowElementAcceptor {
+
+ private final IFollowElementAcceptor decorated;
+
+ public NullSafeElementAcceptor(IFollowElementAcceptor decorated) {
+ this.decorated = decorated;
+ }
+
+ public void accept(AbstractElement element, SetKind kind) {
+ if (element != null)
+ decorated.accept(element, kind);
+ }
+
+ }
+
+ public static class ElementSwitch extends XtextSwitch<ElementSwitch> {
+
+ private final IFollowElementAcceptor acceptor;
+
+ public ElementSwitch(IFollowElementAcceptor acceptor) {
+ this.acceptor = acceptor;
+ }
+
+ @Override
+ public ElementSwitch caseAlternatives(Alternatives alternatives) {
+ for (AbstractElement alternativeElement : alternatives.getGroups()) {
+ doSwitch(alternativeElement);
+ }
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseEnumLiteralDeclaration(EnumLiteralDeclaration object) {
+ doSwitch(object.getLiteral());
+ acceptor.accept(object, SetKind.FirstSet);
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseGroup(Group group) {
+ for(AbstractElement token: group.getTokens()) {
+ doSwitch(token);
+ if (!isOptional(token))
+ return this;
+ }
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseAssignment(Assignment assignment) {
+ acceptor.accept(assignment, SetKind.FirstSet);
+ doSwitch(assignment.getTerminal());
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseRuleCall(RuleCall ruleCall) {
+ doSwitch(ruleCall.getRule());
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseAbstractRule(AbstractRule object) {
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseParserRule(ParserRule object) {
+ doSwitch(object.getAlternatives());
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseEnumRule(EnumRule object) {
+ doSwitch(object.getAlternatives());
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseAbstractElement(AbstractElement object) {
+ return this;
+ }
+
+ @Override
+ public ElementSwitch caseKeyword(Keyword object) {
+ acceptor.accept(object, SetKind.FirstSet);
+ return this;
+ }
+
+ public boolean isOptional(AbstractElement element) {
+ return (element instanceof Action) || GrammarUtil.isOptionalCardinality(element);
+ }
+
+ }
+
+
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultTemplateContentAssistProcessor.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultTemplateContentAssistProcessor.java
deleted file mode 100644
index a22101a..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultTemplateContentAssistProcessor.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.xtext.crossref.IScopeProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.ITemplateContentAssistProcessor;
-
-import com.google.inject.Inject;
-
-/**
- * Provides a default implementation of interface {@link ITemplateContentAssistProcessor}.
- *
- * @author Michael Clay - Initial contribution and API
- */
-public class DefaultTemplateContentAssistProcessor extends TemplateCompletionProcessor implements ITemplateContentAssistProcessor {
-
- @Inject
- private IProposalProvider proposalProvider;
-
- @Inject
- private IScopeProvider scopeProvider;
-
- private TemplateContextType contextType;
-
- private IContentAssistContext contentAssistContext;
-
- @Override
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- return super.computeCompletionProposals(viewer, offset);
- }
-
- @Override
- protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
- return this.contextType;
- }
-
- @Override
- protected Image getImage(Template template) {
- return null;
- }
-
- @Override
- protected Template[] getTemplates(String contextTypeId) {
- return this.proposalProvider.getTemplates(contextTypeId);
- }
-
- @Override
- protected TemplateContext createContext(ITextViewer viewer, IRegion region) {
-
- TemplateContextType contextType = getContextType(viewer, region);
-
- if (contextType != null) {
-
- return new XtextTemplateContext(contextType, viewer.getDocument(),
- new Position(region.getOffset(), region.getLength()),
- this.contentAssistContext,
- this.scopeProvider);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.xtext.ui.common.editor.contentassist.ITemplateContentAssistProcessor#setContextType(org.eclipse.jface.text.templates.TemplateContextType)
- */
- public void setContextType(TemplateContextType contextType) {
- this.contextType = contextType;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.xtext.ui.common.editor.contentassist.ITemplateContentAssistProcessor#setContentAssistContext(org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext)
- */
- public void setContentAssistContext(IContentAssistContext contentAssistContext) {
- this.contentAssistContext = contentAssistContext;
- }
-
-
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultTemplateProposalProvider.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultTemplateProposalProvider.java
new file mode 100644
index 0000000..6059e49
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultTemplateProposalProvider.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.xtext.AbstractElement;
+import org.eclipse.xtext.Action;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.GrammarUtil;
+import org.eclipse.xtext.Group;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.ITemplateAcceptor;
+import org.eclipse.xtext.util.XtextSwitch;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class DefaultTemplateProposalProvider extends AbstractTemplateProposalProvider {
+
+ @Override
+ protected void createTemplates(TemplateContext templateContext, ContentAssistContext context,
+ ITemplateAcceptor acceptor) {
+ Template[] templates = getTemplates(templateContext.getContextType().getId());
+ for(Template template: templates) {
+ if (!acceptor.canAcceptMoreTemplates())
+ return;
+ if (validate(template, templateContext)) {
+ acceptor.accept(createProposal(template, templateContext, context,
+ getImage(template), getRelevance(template)));
+ }
+ }
+ }
+
+ @Override
+ protected TemplateContextType[] getContextTypes(ContentAssistContext context) {
+ return getTemplateContextTypes(context);
+ }
+
+ public class TemplateContextTypeProvider extends XtextSwitch<Boolean> {
+
+ private final ContentAssistContext context;
+
+ private final Collection<TemplateContextType> contextTypes;
+
+ public TemplateContextTypeProvider(ContentAssistContext context, Collection<TemplateContextType> contextTypes) {
+ this.context = context;
+ this.contextTypes = contextTypes;
+ }
+
+ @Override
+ public Boolean defaultCase(EObject object) {
+ return Boolean.FALSE;
+ }
+
+ private void add(TemplateContextType type) {
+ if (type != null)
+ contextTypes.add(type);
+ }
+
+ @Override
+ public Boolean caseKeyword(Keyword object) {
+ add(getTemplateContextType(object, context));
+ return Boolean.FALSE;
+ }
+
+ @Override
+ public Boolean caseRuleCall(RuleCall object) {
+ add(getTemplateContextType(object, context));
+ return doSwitch(object.getRule().getAlternatives());
+ }
+
+ @Override
+ public Boolean caseGroup(Group object) {
+ Iterator<AbstractElement> iter = object.getTokens().iterator();
+ AbstractElement current = iter.next();
+ doSwitch(current);
+ while((GrammarUtil.isOptionalCardinality(current) || current instanceof Action) &&
+ iter.hasNext()) {
+ current = iter.next();
+ doSwitch(current);
+ }
+ return Boolean.FALSE;
+ }
+
+ @Override
+ public Boolean caseAssignment(Assignment object) {
+ return doSwitch(object.getTerminal());
+ }
+
+ @Override
+ public Boolean caseAlternatives(Alternatives object) {
+ for (AbstractElement element: object.getGroups()) {
+ doSwitch(element);
+ }
+ return Boolean.FALSE;
+ }
+ }
+
+ public Image getImage(Template template) {
+ return null;
+ }
+
+ public int getRelevance(Template template) {
+ return 90;
+ }
+
+ public TemplateContextType[] getTemplateContextTypes(ContentAssistContext context) {
+ Collection<TemplateContextType> templateContextTypes = new LinkedHashSet<TemplateContextType>();
+ TemplateContextTypeProvider provider = new TemplateContextTypeProvider(context, templateContextTypes);
+ for (AbstractElement element : context.getFirstSetGrammarElements()) {
+ provider.doSwitch(element);
+ }
+ return templateContextTypes.toArray(new TemplateContextType[templateContextTypes.size()]);
+ }
+
+ /**
+ * Returns the context type that can handle template insertion at the given
+ * region in the viewer's document.
+ *
+ * @param keyword the <code>Keyword</code> to be completed
+ * @param contentAssistContext the current context of the content assist
+ * @return the context type that can handle template expansion for the given
+ * location, or <code>null</code> if none exists
+ */
+ public TemplateContextType getTemplateContextType(Keyword keyword, ContentAssistContext context) {
+ return null;
+ }
+
+ /**
+ * Returns the context type that can handle template insertion at the given
+ * region in the viewer's document.
+ *
+ * @param ruleCall the <code>RuleCall</code>
+ * @param contentAssistContext the current context of the content assist
+ * @return the context type that can handle template expansion for the given
+ * location, or <code>null</code> if none exists
+ */
+ public TemplateContextType getTemplateContextType(RuleCall ruleCall, ContentAssistContext contentAssistContext) {
+ return null;
+ }
+
+ /**
+ * Returns the templates valid for the context type specified by
+ * <code>contextTypeId</code>.
+ *
+ * @param contextTypeId the context type id
+ * @return the templates valid for this context type id
+ */
+ public Template[] getTemplates(String contextId) {
+ return null;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/JavaReflectiveMethodInvoker.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/JavaReflectiveMethodInvoker.java
deleted file mode 100644
index 2688c75..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/JavaReflectiveMethodInvoker.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.util.Triple;
-import org.eclipse.xtext.util.Tuples;
-
-/**
- * Calls methods on a target object or collection reflectively. Caches resolved methods in a map.
- *
- * @author Jan K&ouml;hnlein - Initial contribution and API
- * @author Michael Clay
- *
- */
-public class JavaReflectiveMethodInvoker {
-
- private final Map<Triple<? extends Class<?>,String, ? extends Class<?>>, Method> methodLookupMap = new HashMap<Triple<? extends Class<?>,String, ? extends Class<?>>, Method>();
-
- private final Object target;
-
- public JavaReflectiveMethodInvoker(Object target) {
- this.target = target;
- }
-
- public Object invoke(String methodName, java.util.List<Class<?>> parameterTypes, java.util.List<?> parameterValues) {
- Object invocationResult = null;
- if (target instanceof Collection<?>) {
- for (Iterator<?> iterator = ((Collection<?>)target).iterator(); null == invocationResult && iterator.hasNext();) {
- invocationResult = doInvoke(iterator.next(),methodName, parameterTypes, parameterValues);
- }
- } else {
- invocationResult = doInvoke(target,methodName, parameterTypes, parameterValues);
- }
- return invocationResult;
- }
-
- private Object doInvoke(Object invocationTarget,String methodName, java.util.List<Class<?>> parameterTypes, java.util.List<?> parameterValues) {
- Method method = findMethod(invocationTarget.getClass(), methodName, parameterTypes.toArray(new Class[] {}));
- if (method == null) {
- return null;
- }
- return invokeMethod(method, invocationTarget, parameterValues.toArray(new Object[] {}));
- }
-
- private final Method findMethod(Class<?> clazz, String name, Class<?>... paramTypes) {
- Assert.isNotNull(clazz, "Class must not be null");
- Assert.isNotNull(name, "Method name must not be null");
- Triple<? extends Class<?>,String, ? extends Class<?>> methodKey = Tuples.create(clazz,name, (paramTypes == null || paramTypes.length == 0) ? null
- : paramTypes[0]);
- Method result = methodLookupMap.get(methodKey);
- if (result != null)
- return result;
- Class<?> searchType = clazz;
- while (!Object.class.equals(searchType) && searchType != null) {
- Method[] methods = (searchType.isInterface() ? searchType.getMethods() : searchType.getDeclaredMethods());
- for (int i = 0; i < methods.length; i++) {
- Method method = methods[i];
- if (name.equals(method.getName())
- && (paramTypes == null || equalOrAssignableTypes(method.getParameterTypes(), paramTypes))) {
- if (result == null || equalOrAssignableTypes(result.getParameterTypes(), method.getParameterTypes())) {
- result = method;
- methodLookupMap.put(methodKey, method);
- }
- }
- }
- searchType = searchType.getSuperclass();
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- private final List<ICompletionProposal> invokeMethod(Method method, Object target, Object... args) {
- try {
- method.setAccessible(true);
- return (List<ICompletionProposal>) method.invoke(target, args);
- }
- catch (IllegalArgumentException e) {
- throw new IllegalStateException("Illegal argument exception: " + e.getMessage(), e);
- }
- catch (IllegalAccessException e) {
- throw new IllegalStateException("Could not access method: " + e.getMessage(), e);
- }
- catch (InvocationTargetException e) {
- Throwable targetEx = e.getTargetException();
- if (targetEx instanceof RuntimeException)
- throw (RuntimeException) targetEx;
- if (targetEx instanceof Error)
- throw (Error)targetEx;
- throw new IllegalStateException("Unexpected exception thrown", targetEx);
- }
- }
-
- private boolean equalOrAssignableTypes(Class<?>[] a, Class<?>[] a2) {
- if (a == a2) {
- return true;
- }
- if (a == null || a2 == null) {
- return false;
- }
- int length = a.length;
- if (a2.length != length) {
- return false;
- }
- for (int i = 0; i < length; i++) {
- Class<?> o1 = a[i];
- Class<?> o2 = a2[i];
-
- if (!(o1 == null ? o2 == null : o1.equals(o2) || o1.isAssignableFrom(o2))) {
- return false;
- }
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ProposalFilterSorterUtil.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ProposalFilterSorterUtil.java
deleted file mode 100644
index 1ce2b99..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ProposalFilterSorterUtil.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.util.Strings;
-
-/**
- * @author Jan Köhnlein - Initial contribution and API
- * @author Michael Clay - Initial contribution and API
- */
-public class ProposalFilterSorterUtil {
- private static Logger logger = Logger.getLogger(IProposalProvider.class);
-
- protected static final Comparator<ICompletionProposal> PROPOSAL_COMPARATOR = new Comparator<ICompletionProposal>() {
- public int compare(ICompletionProposal o1, ICompletionProposal o2) {
- return o1.getDisplayString().compareTo(o2.getDisplayString());
- }
- };
-
- public static List<? extends ICompletionProposal> filter(
- List<? extends ICompletionProposal> completionProposalList, IContentAssistContext contentAssistContext) {
- Map<String, ICompletionProposal> displayString2ICompletionProposalMap = new HashMap<String, ICompletionProposal>();
- for (Iterator<? extends ICompletionProposal> iterator = completionProposalList.iterator(); iterator.hasNext();) {
- ICompletionProposal completionProposal = iterator.next();
- if (!displayString2ICompletionProposalMap.containsKey(completionProposal.getDisplayString())) {
- displayString2ICompletionProposalMap.put(completionProposal.getDisplayString(), completionProposal);
- if (!Strings.isEmpty(contentAssistContext.getMatchString()) &&
- (!completionProposal.getDisplayString().toUpperCase().startsWith(contentAssistContext.getMatchString().toUpperCase()) ||
- completionProposal.getDisplayString().equalsIgnoreCase(contentAssistContext.getMatchString()))) {
- if (logger.isDebugEnabled()) {
- logger.debug("filter completionProposal '" + completionProposal + "'");
- }
- iterator.remove();
- }
- }
- else {
- if (logger.isDebugEnabled()) {
- logger.debug("filter duplicate completionProposal '" + completionProposal + "'");
- }
- iterator.remove();
- }
- }
- return completionProposalList;
- }
-
- public static List<? extends ICompletionProposal> sort(List<? extends ICompletionProposal> completionProposalList) {
- Collections.sort(completionProposalList, PROPOSAL_COMPARATOR);
- return completionProposalList;
- }
-
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextCompletionProposal.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextCompletionProposal.java
deleted file mode 100644
index 35323ea..0000000
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextCompletionProposal.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import org.apache.log4j.Logger;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.xtext.AbstractElement;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Default Xtext implementation of interface <code>ICompletionProposal</code>.
- *
- * @author Dennis Hübner - Initial contribution and API
- * @author Michael Clay
- * @author Jan Köhnlein
- * @see org.eclipse.jface.text.contentassist.ICompletionProposal
- */
-public class XtextCompletionProposal implements ICompletionProposal {
-
- // logger available to subclasses
- protected final Logger logger = Logger.getLogger(XtextCompletionProposal.class);
-
- private final String text;
- private int selectionOffset;
-
- // information copied from contentAssistContext
- private int offset;
- private int nodeTotalOffset;
- private int nodeTotalLength;
- private String matchString;
- private Image image;
-
- public XtextCompletionProposal(AbstractElement abstractElement, String displayString,
- IContentAssistContext contentAssistContext, Image image) {
- this.text = displayString;
- this.offset = contentAssistContext.getOffSet();
- this.nodeTotalOffset = contentAssistContext.getNode().getTotalOffset();
- this.nodeTotalLength = contentAssistContext.getNode().getTotalLength();
- this.matchString = contentAssistContext.getMatchString();
- this.image = image;
- }
-
- public void apply(IDocument document) {
- try {
- int replacementOffset = offset;
- if (!"".equals(matchString) && getDisplayString().toUpperCase().startsWith(matchString.toUpperCase())) {
- document.replace(nodeTotalOffset, nodeTotalLength, "");
- replacementOffset = nodeTotalOffset;
- }
- document.replace(replacementOffset, 0, this.text.trim());
- this.selectionOffset = replacementOffset + this.text.trim().length();
- }
- catch (BadLocationException e) {
- logger.error(e);
- }
- }
-
- public String getAdditionalProposalInfo() {
- return null;
- }
-
- public IContextInformation getContextInformation() {
- return null;
- }
-
- public String getDisplayString() {
- return this.text;
- }
-
- public Image getImage() {
- return this.image;
- }
-
- public Point getSelection(IDocument document) {
- return new Point(this.selectionOffset, 0);
- }
-
- @Override
- public String toString() {
- return "XtextCompletionPoposal[text='" + this.text + "']";
- }
-
-}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContext.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContext.java
index 6e1afe5..3f8b7d5 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContext.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContext.java
@@ -12,22 +12,22 @@ import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.templates.DocumentTemplateContext;
import org.eclipse.jface.text.templates.TemplateContextType;
import org.eclipse.xtext.crossref.IScopeProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
/**
- * Represents an extended version of class {@link DocumentTemplateContext} to provide additional Xtext related
+ * Represents an extended version of class {@link DocumentTemplateContext} to provide additional Xtext related
* information and services for resolving a <code>Template</code>.
*
* @author Michael Clay - Initial contribution and API
*/
public class XtextTemplateContext extends DocumentTemplateContext {
- private IContentAssistContext contentAssistContext;
-
- private IScopeProvider scopeProvider;
+ private final ContentAssistContext contentAssistContext;
+
+ private final IScopeProvider scopeProvider;
public XtextTemplateContext(TemplateContextType type, IDocument document, Position position,
- IContentAssistContext contentAssistContext, IScopeProvider scopeProvider) {
+ ContentAssistContext contentAssistContext, IScopeProvider scopeProvider) {
super(type, document, position);
this.contentAssistContext = contentAssistContext;
this.scopeProvider = scopeProvider;
@@ -36,7 +36,7 @@ public class XtextTemplateContext extends DocumentTemplateContext {
/**
* @return the contentAssistContext
*/
- public IContentAssistContext getContentAssistContext() {
+ public ContentAssistContext getContentAssistContext() {
return contentAssistContext;
}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContextType.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContextType.java
index ea30041..48f6102 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContextType.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/XtextTemplateContextType.java
@@ -8,22 +8,10 @@
*******************************************************************************/
package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContext;
import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateVariable;
-import org.eclipse.jface.text.templates.TemplateVariableResolver;
-import org.eclipse.xtext.AbstractMetamodelDeclaration;
-import org.eclipse.xtext.Grammar;
-import org.eclipse.xtext.GrammarUtil;
-import org.eclipse.xtext.crossref.IScopedElement;
+
+import com.google.inject.Inject;
/**
* Provides a convenience base type for <code>TemplateContextType's</code> preconfigured with several handy
@@ -34,7 +22,15 @@ import org.eclipse.xtext.crossref.IScopedElement;
public class XtextTemplateContextType extends TemplateContextType {
public XtextTemplateContextType() {
- addResolver(new CrossReferenceTemplateVariableResolver());
+ addDefaultTemplateVariables();
+ }
+
+ @Inject
+ public void setCrossReferenceResolver(CrossReferenceTemplateVariableResolver resolver) {
+ addResolver(resolver);
+ }
+
+ protected void addDefaultTemplateVariables() {
addResolver(new GlobalTemplateVariables.WordSelection());
addResolver(new GlobalTemplateVariables.LineSelection());
addResolver(new GlobalTemplateVariables.Date());
@@ -44,60 +40,20 @@ public class XtextTemplateContextType extends TemplateContextType {
addResolver(new GlobalTemplateVariables.User());
addResolver(new GlobalTemplateVariables.Cursor());
}
-
- public static class CrossReferenceTemplateVariableResolver extends TemplateVariableResolver {
-
- public CrossReferenceTemplateVariableResolver() {
- super("CrossReference", "TemplateVariableResolver for CrossReferences");
- }
-
- @Override
- public void resolve(TemplateVariable variable, TemplateContext context) {
-
- XtextTemplateContext xtextTemplateContext = (XtextTemplateContext) context;
-
- String abbreviatedCrossReference = (String) variable.getVariableType().getParams().iterator().next();
-
- String[] classReferencePair = abbreviatedCrossReference.split("\\.");
-
- EReference reference = getReference(classReferencePair[0], classReferencePair[1], getGrammar(xtextTemplateContext));
-
- Iterable<IScopedElement> linkingCandidates = xtextTemplateContext.getScopeProvider()
- .getScope(xtextTemplateContext.getContentAssistContext().getModel(), reference).getAllContents();
-
- List<String> names = new ArrayList<String>();
-
- for (IScopedElement scopedElement : linkingCandidates) {
- names.add(scopedElement.name());
- }
-
- String[] bindings = names.toArray(new String[names.size()]);
-
- if (bindings.length != 0)
- variable.setValues(bindings);
- if (bindings.length > 1)
- variable.setUnambiguous(false);
- else
- variable.setUnambiguous(isUnambiguous(context));
-
- variable.setResolved(true);
- }
-
- private Grammar getGrammar(XtextTemplateContext xtextTemplateContext) {
- EObject grammarElement = xtextTemplateContext.getContentAssistContext().getRootNode().getGrammarElement();
- Grammar g = (Grammar) EcoreUtil.getRootContainer(grammarElement);
- return g;
- }
- private EReference getReference(String eClassName, String eReferenceName, Grammar g) {
- List<AbstractMetamodelDeclaration> allMetamodelDeclarations = GrammarUtil.allMetamodelDeclarations(g);
- for (AbstractMetamodelDeclaration decl : allMetamodelDeclarations) {
- EClass eClass = (EClass) decl.getEPackage().getEClassifier(eClassName);
- if (eClass != null) {
- return (EReference) eClass.getEStructuralFeature(eReferenceName);
- }
- }
- return null;
- }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof TemplateContextType))
+ return false;
+ if (obj == this)
+ return true;
+ TemplateContextType contextType = (TemplateContextType) obj;
+ return getId().equals(contextType.getId());
+ }
+
+ @Override
+ public int hashCode() {
+ return getId().hashCode();
}
}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/DefaultUIModule.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/DefaultUIModule.java
index 023c033..7b9b761 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/DefaultUIModule.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/service/DefaultUIModule.java
@@ -17,9 +17,10 @@ import org.eclipse.jface.text.rules.ITokenScanner;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.xtext.service.AbstractGenericModule;
-import org.eclipse.xtext.ui.common.editor.contentassist.ITemplateContentAssistProcessor;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultContentAssistProcessor;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultTemplateContentAssistProcessor;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultContentAssistContextFactory;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultContentAssistantFactory;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultFollowElementCalculator;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultTemplateProposalProvider;
import org.eclipse.xtext.ui.common.editor.hyperlinking.DefaultHyperlinkDetector;
import org.eclipse.xtext.ui.common.editor.outline.XtextContentOutlinePage;
import org.eclipse.xtext.ui.common.editor.syntaxcoloring.DefaultTokenScanner;
@@ -32,6 +33,11 @@ import org.eclipse.xtext.ui.core.InjectableAdapterFactory;
import org.eclipse.xtext.ui.core.InjectableAdapterFactoryLabelProvider;
import org.eclipse.xtext.ui.core.editor.IDamagerRepairer;
import org.eclipse.xtext.ui.core.editor.XtextDamagerRepairer;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.IContentAssistantFactory;
+import org.eclipse.xtext.ui.core.editor.contentassist.IFollowElementCalculator;
+import org.eclipse.xtext.ui.core.editor.contentassist.ITemplateProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.XtextContentAssistProcessor;
import org.eclipse.xtext.ui.core.editor.reconciler.XtextReconciler;
/**
@@ -47,14 +53,6 @@ public abstract class DefaultUIModule extends AbstractGenericModule {
return org.eclipse.xtext.ui.common.editor.outline.impl.LazyTransformingTreeProvider.class;
}
- public Class<? extends IContentAssistProcessor> bindIContentAssistProcessor() {
- return DefaultContentAssistProcessor.class;
- }
-
- public Class<? extends ITemplateContentAssistProcessor> bindITemplateContentAssistProcessor() {
- return DefaultTemplateContentAssistProcessor.class;
- }
-
public Class<? extends ITokenColorer> bindITokenColorer() {
return NullTokenColorer.class;
}
@@ -91,6 +89,26 @@ public abstract class DefaultUIModule extends AbstractGenericModule {
return InjectableAdapterFactory.class;
}
+ public Class<? extends IContentAssistantFactory> bindIContentAssistantFactory() {
+ return DefaultContentAssistantFactory.class;
+ }
+
+ public Class<? extends IContentAssistProcessor> bindIContentAssistProcessor() {
+ return XtextContentAssistProcessor.class;
+ }
+
+ public Class<? extends ITemplateProposalProvider> bindITemplateProposalProvider() {
+ return DefaultTemplateProposalProvider.class;
+ }
+
+ public Class<? extends ContentAssistContext.Factory> bindContentAssistContextFactory() {
+ return DefaultContentAssistContextFactory.class;
+ }
+
+ public Class<? extends IFollowElementCalculator> bindIFollowElementCalculator() {
+ return DefaultFollowElementCalculator.class;
+ }
+
public Class<? extends AdapterFactoryLabelProvider> bindAdapterFactoryLabelProvider() {
return InjectableAdapterFactoryLabelProvider.class;
}
diff --git a/plugins/org.eclipse.xtext.ui.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext.ui.core/META-INF/MANIFEST.MF
index 2970e55..87ff465 100644
--- a/plugins/org.eclipse.xtext.ui.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xtext.ui.core/META-INF/MANIFEST.MF
@@ -23,6 +23,7 @@ Require-Bundle: org.eclipse.xtext.log4j;bundle-version="1.2.15";visibility:=reex
Bundle-Activator: org.eclipse.xtext.ui.core.internal.Activator
Export-Package: org.eclipse.xtext.ui.core,
org.eclipse.xtext.ui.core.editor,
+ org.eclipse.xtext.ui.core.editor.contentassist,
org.eclipse.xtext.ui.core.editor.handler,
org.eclipse.xtext.ui.core.editor.model,
org.eclipse.xtext.ui.core.editor.preferences,
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextSourceViewerConfiguration.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextSourceViewerConfiguration.java
index 77f9d99..c7e75f0 100644
--- a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextSourceViewerConfiguration.java
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextSourceViewerConfiguration.java
@@ -6,8 +6,6 @@ import java.util.List;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
@@ -16,15 +14,16 @@ import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.reconciler.IReconciler;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
+import org.eclipse.xtext.ui.core.editor.contentassist.IContentAssistantFactory;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class XtextSourceViewerConfiguration extends TextSourceViewerConfiguration {
- @Inject(optional = true)
- private IContentAssistProcessor contentAssistProcessor;
-
+ @Inject
+ private IContentAssistantFactory contentAssistantFactory;
+
@Inject
private IHyperlinkDetector detector;
@@ -36,12 +35,7 @@ public class XtextSourceViewerConfiguration extends TextSourceViewerConfiguratio
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- ContentAssistant contentAssistant = new ContentAssistant();
- if (contentAssistProcessor != null) {
- contentAssistant.setContentAssistProcessor(contentAssistProcessor,
- IDocument.DEFAULT_CONTENT_TYPE);
- }
- return contentAssistant;
+ return contentAssistantFactory.createConfiguredAssistant(this, sourceViewer);
}
@Override
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/CompletionProposalComputer.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/CompletionProposalComputer.java
new file mode 100644
index 0000000..bd9e615
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/CompletionProposalComputer.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import java.util.Collection;
+import java.util.LinkedHashSet;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.templates.TemplateProposal;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.ui.core.editor.model.UnitOfWork;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class CompletionProposalComputer implements UnitOfWork<ICompletionProposal[]>, ICompletionProposalAcceptor, ITemplateAcceptor {
+
+ public interface State {
+ ITemplateProposalProvider getTemplateProposalProvider();
+ IContentProposalProvider getContentProposalProvider();
+ ContentAssistContext.Factory getContextFactory();
+ ICompletionProposalAcceptor createAcceptor(ICompletionProposalAcceptor delegate);
+ ITemplateAcceptor createAcceptor(ITemplateAcceptor delegate);
+ }
+
+ private final int offset;
+ private final ITextViewer viewer;
+ private final State state;
+
+ private final Collection<ICompletionProposal> proposals;
+
+ public CompletionProposalComputer(State state, ITextViewer viewer, int offset) {
+ super();
+ this.proposals = new LinkedHashSet<ICompletionProposal>(30);
+ this.state = state;
+ this.viewer = viewer;
+ this.offset = offset;
+ }
+
+ public ICompletionProposal[] exec(XtextResource resource) throws Exception {
+ ICompletionProposalAcceptor proposalAcceptor = state.createAcceptor((ICompletionProposalAcceptor)this);
+ ContentAssistContext[] contexts = state.getContextFactory().create(viewer, offset, resource);
+ for (ContentAssistContext context: contexts) {
+ if (proposalAcceptor.canAcceptMoreProposals())
+ state.getContentProposalProvider().createProposals(context, proposalAcceptor);
+ }
+ ITemplateAcceptor templateAcceptor = state.createAcceptor((ITemplateAcceptor) this);
+ for (ContentAssistContext context: contexts) {
+ if (templateAcceptor.canAcceptMoreTemplates())
+ state.getTemplateProposalProvider().createTemplates(context, templateAcceptor);
+
+ }
+ return proposals.toArray(new ICompletionProposal[proposals.size()]);
+ }
+
+ public void accept(ICompletionProposal proposal) {
+ if (proposal == null)
+ throw new NullPointerException("proposal may not be null");
+ proposals.add(proposal);
+ }
+
+ public boolean canAcceptMoreProposals() {
+ return true;
+ }
+
+ public void accept(TemplateProposal template) {
+ if (template == null)
+ throw new NullPointerException("template may not be null");
+ proposals.add(template);
+ }
+
+ public boolean canAcceptMoreTemplates() {
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ContentAssistContext.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ContentAssistContext.java
new file mode 100644
index 0000000..bcab07b
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ContentAssistContext.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.xtext.AbstractElement;
+import org.eclipse.xtext.parsetree.AbstractNode;
+import org.eclipse.xtext.parsetree.CompositeNode;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.ui.core.editor.contentassist.IFollowElementCalculator.IFollowElementAcceptor;
+import org.eclipse.xtext.ui.core.editor.model.IXtextDocument;
+
+import com.google.inject.Inject;
+
+/**
+ * Abstraction of a commonly used set of attributes related to the current content assist request.
+ *
+ * @author Michael Clay - Initial contribution and API
+ * @author Sebastian Zarnekow
+ */
+public class ContentAssistContext implements IFollowElementAcceptor {
+
+ public interface Factory {
+ ContentAssistContext[] create(ITextViewer viewer, int offset, XtextResource resource);
+ }
+
+ private String prefix;
+ private String selectedText;
+ private EObject rootModel;
+ private CompositeNode rootNode;
+ private EObject currentModel;
+ private AbstractNode currentNode;
+ private AbstractNode lastCompleteNode;
+ private int offset;
+ private ITextViewer viewer;
+ private Region replaceRegion;
+ private PrefixMatcher matcher;
+ private final List<AbstractElement> firstSetGrammarElements;
+ private final List<AbstractElement> followSetGrammarElements;
+
+ @Inject
+ public ContentAssistContext() {
+ super();
+ firstSetGrammarElements = new ArrayList<AbstractElement>();
+ followSetGrammarElements = new ArrayList<AbstractElement>();
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
+ public void setPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+
+ public EObject getRootModel() {
+ return rootModel;
+ }
+
+ public void setRootModel(EObject rootModel) {
+ this.rootModel = rootModel;
+ }
+
+ public CompositeNode getRootNode() {
+ return rootNode;
+ }
+
+ public void setRootNode(CompositeNode rootNode) {
+ this.rootNode = rootNode;
+ }
+
+ public AbstractNode getCurrentNode() {
+ return currentNode;
+ }
+
+ public void setCurrentNode(AbstractNode currentNode) {
+ this.currentNode = currentNode;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+
+ public void setViewer(ITextViewer viewer) {
+ this.viewer = viewer;
+ }
+
+ public ITextViewer getViewer() {
+ return viewer;
+ }
+
+ public IXtextDocument getDocument() {
+ return (IXtextDocument) viewer.getDocument();
+ }
+
+ public void accept(AbstractElement element, IFollowElementCalculator.SetKind kind) {
+ if (element == null || kind == null)
+ throw new NullPointerException("element or kind was null. element: '" + element + "' kind: '" + kind + "'");
+ switch (kind) {
+ case FirstSet:
+ getFirstSetGrammarElements().add(element);
+ break;
+ case FollowSet:
+ getFollowSetGrammarElements().add(element);
+ break;
+ default:
+ throw new IllegalArgumentException("Unexpected kind: '" + kind + "'");
+ }
+ }
+
+ public void setLastCompleteNode(AbstractNode lastCompleteNode) {
+ this.lastCompleteNode = lastCompleteNode;
+ }
+
+ public AbstractNode getLastCompleteNode() {
+ return lastCompleteNode;
+ }
+
+ public void setCurrentModel(EObject currentModel) {
+ this.currentModel = currentModel;
+ }
+
+ public EObject getCurrentModel() {
+ return currentModel;
+ }
+
+ public void setReplaceRegion(Region replaceRegion) {
+ this.replaceRegion = replaceRegion;
+ }
+
+ public Region getReplaceRegion() {
+ return replaceRegion;
+ }
+
+ public void setSelectedText(String selectedText) {
+ this.selectedText = selectedText;
+ }
+
+ public String getSelectedText() {
+ return selectedText;
+ }
+
+ public List<AbstractElement> getFirstSetGrammarElements() {
+ return firstSetGrammarElements;
+ }
+
+ public List<AbstractElement> getFollowSetGrammarElements() {
+ return followSetGrammarElements;
+ }
+
+ public void setMatcher(PrefixMatcher matcher) {
+ this.matcher = matcher;
+ }
+
+ public PrefixMatcher getMatcher() {
+ return matcher;
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ContextInformationComputer.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ContextInformationComputer.java
new file mode 100644
index 0000000..e605170
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ContextInformationComputer.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import java.util.Collection;
+import java.util.LinkedHashSet;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.ui.core.editor.model.UnitOfWork;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public final class ContextInformationComputer implements UnitOfWork<IContextInformation[]>, IContextInformationAcceptor {
+
+ public interface State {
+ ContentAssistContext.Factory getContextFactory();
+ IContextInformationProvider getContextInformationProvider();
+ IContextInformationAcceptor createAcceptor(IContextInformationAcceptor delegate);
+ }
+
+ private final int offset;
+ private final ITextViewer viewer;
+ private final State state;
+ private final Collection<IContextInformation> information;
+
+ public ContextInformationComputer(State state, ITextViewer viewer, int offset) {
+ super();
+ this.information = new LinkedHashSet<IContextInformation>();
+ this.state = state;
+ this.offset = offset;
+ this.viewer = viewer;
+ }
+
+ public IContextInformation[] exec(XtextResource resource) throws Exception {
+ IContextInformationAcceptor acceptor = state.createAcceptor(this);
+ ContentAssistContext[] contexts = state.getContextFactory().create(viewer, offset, resource);
+ for (ContentAssistContext context: contexts) {
+ if (acceptor.canAcceptMoreInformation())
+ state.getContextInformationProvider().getContextInformation(context, acceptor);
+ }
+ if (information.isEmpty())
+ return null;
+ return information.toArray(new IContextInformation[information.size()]);
+ }
+
+ public void accept(IContextInformation information) {
+ this.information.add(information);
+ }
+
+ public boolean canAcceptMoreInformation() {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ICompletionProposalAcceptor.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ICompletionProposalAcceptor.java
new file mode 100644
index 0000000..0671e9a
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ICompletionProposalAcceptor.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public interface ICompletionProposalAcceptor {
+
+ void accept(ICompletionProposal proposal);
+
+ boolean canAcceptMoreProposals();
+
+ class Delegate implements ICompletionProposalAcceptor {
+
+ private ICompletionProposalAcceptor delegate;
+
+ public void setDelegate(ICompletionProposalAcceptor acceptor) {
+ this.delegate = acceptor;
+ }
+
+ public ICompletionProposalAcceptor getDelegate() {
+ return delegate;
+ }
+
+ public void accept(ICompletionProposal proposal) {
+ delegate.accept(proposal);
+ }
+
+ public boolean canAcceptMoreProposals() {
+ return delegate.canAcceptMoreProposals();
+ }
+
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ICompletionProposalComparator.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ICompletionProposalComparator.java
new file mode 100644
index 0000000..e675354
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ICompletionProposalComparator.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import java.util.Comparator;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+
+import com.google.inject.ImplementedBy;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+@ImplementedBy(ICompletionProposalComparator.DisplayString.class)
+public interface ICompletionProposalComparator extends Comparator<ICompletionProposal> {
+
+ class DisplayString implements ICompletionProposalComparator {
+ public int compare(ICompletionProposal o1, ICompletionProposal o2) {
+ return o1.getDisplayString().compareTo(o2.getDisplayString());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContentAssistantFactory.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContentAssistantFactory.java
new file mode 100644
index 0000000..8ad1c97
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContentAssistantFactory.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public interface IContentAssistantFactory {
+
+ IContentAssistant createConfiguredAssistant(SourceViewerConfiguration configuration, ISourceViewer sourceViewer);
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContentProposalProvider.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContentProposalProvider.java
new file mode 100644
index 0000000..9a938a5
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContentProposalProvider.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public interface IContentProposalProvider {
+
+ void createProposals(ContentAssistContext context, ICompletionProposalAcceptor acceptor);
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContextInformationAcceptor.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContextInformationAcceptor.java
new file mode 100644
index 0000000..ba9001f
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContextInformationAcceptor.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import org.eclipse.jface.text.contentassist.IContextInformation;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public interface IContextInformationAcceptor {
+
+ void accept(IContextInformation information);
+
+ boolean canAcceptMoreInformation();
+
+ class Delegate implements IContextInformationAcceptor {
+
+ private IContextInformationAcceptor delegate;
+
+ public void setDelegate(IContextInformationAcceptor acceptor) {
+ this.delegate = acceptor;
+ }
+
+ public IContextInformationAcceptor getDelegate() {
+ return delegate;
+ }
+
+ public void accept(IContextInformation information) {
+ delegate.accept(information);
+ }
+
+ public boolean canAcceptMoreInformation() {
+ return delegate.canAcceptMoreInformation();
+ }
+
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContextInformationProvider.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContextInformationProvider.java
new file mode 100644
index 0000000..80cd4b4
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IContextInformationProvider.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public interface IContextInformationProvider {
+
+ void getContextInformation(ContentAssistContext context, IContextInformationAcceptor acceptor);
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IContentAssistCalculator.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IFollowElementCalculator.java
index 74f1965..8f1fa2a 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/IContentAssistCalculator.java
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/IFollowElementCalculator.java
@@ -1,27 +1,32 @@
/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist;
-
-import java.util.List;
+package org.eclipse.xtext.ui.core.editor.contentassist;
import org.eclipse.xtext.AbstractElement;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.DefaultContentAssistCalculator;
-
-import com.google.inject.ImplementedBy;
+import org.eclipse.xtext.parsetree.AbstractNode;
+import org.eclipse.xtext.parsetree.CompositeNode;
/**
- * Strategy interface for calculating a list of <code>AbstractElement</code> elements which are applicable for
- * the provided <code>IContentAssistContext</code>.
+ * Strategy interface for calculating a list of <code>AbstractElement</code> elements which are applicable for
+ * the provided <code>resource</code> at the given <code>offset</code>.
*
* @author Michael Clay - Initial contribution and API
+ * @author Sebastian Zarnekow
*/
-@ImplementedBy(DefaultContentAssistCalculator.class)
-public interface IContentAssistCalculator {
+public interface IFollowElementCalculator {
+
+ enum SetKind {
+ FirstSet, FollowSet
+ }
+
+ interface IFollowElementAcceptor {
+ void accept(AbstractElement element, SetKind kind);
+ }
/**
* Calculate a list of <code>AbstractElement</code> matching the provided <code>IContentAssistContext</code>.
@@ -29,5 +34,5 @@ public interface IContentAssistCalculator {
* @param contentAssistContext the current context of the content assist proposal request
* @return the list of <code>AbstractElement</code> matching the provided <code>IContentAssistContext</code>.
*/
- List<AbstractElement> computeProposalElements(IContentAssistContext contentAssistContext);
-}
+ void calculateValidElements(CompositeNode rootNode, AbstractNode lastCompleteNode, int offset, IFollowElementAcceptor acceptor);
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ITemplateAcceptor.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ITemplateAcceptor.java
new file mode 100644
index 0000000..713fb10
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ITemplateAcceptor.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import org.eclipse.jface.text.templates.TemplateProposal;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public interface ITemplateAcceptor {
+
+ void accept(TemplateProposal template);
+
+ boolean canAcceptMoreTemplates();
+
+ public class Delegate implements ITemplateAcceptor {
+
+ private ITemplateAcceptor delegate;
+
+ public void accept(TemplateProposal template) {
+ delegate.accept(template);
+ }
+
+ public boolean canAcceptMoreTemplates() {
+ return delegate.canAcceptMoreTemplates();
+ }
+
+ public void setDelegate(ITemplateAcceptor delegate) {
+ this.delegate = delegate;
+ }
+
+ public ITemplateAcceptor getDelegate() {
+ return delegate;
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ITemplateProposalProvider.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ITemplateProposalProvider.java
new file mode 100644
index 0000000..836f88d
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/ITemplateProposalProvider.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+/**
+ * @author Sebastian Zarnekow
+ */
+public interface ITemplateProposalProvider {
+
+ void createTemplates(ContentAssistContext context, ITemplateAcceptor acceptor);
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/PrefixMatcher.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/PrefixMatcher.java
new file mode 100644
index 0000000..a88154b
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/PrefixMatcher.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class PrefixMatcher {
+
+ public boolean isCandidateMatchingPrefix(String name, String prefix) {
+ return name.regionMatches(true, 0, prefix, 0,prefix.length());
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/XtextContentAssistProcessor.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/XtextContentAssistProcessor.java
new file mode 100644
index 0000000..709735d
--- /dev/null
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/contentassist/XtextContentAssistProcessor.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.core.editor.contentassist;
+
+import java.util.Arrays;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContextInformationValidator;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.xtext.ui.core.editor.model.IXtextDocument;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.name.Named;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class XtextContentAssistProcessor implements IContentAssistProcessor, CompletionProposalComputer.State, ContextInformationComputer.State {
+
+ public static final String COMPLETION_AUTO_ACTIVATION_CHARS = "org.eclipse.xtext.ui.core.editor.XtextContentAssistProcessor.COMPLETION_AUTO_ACTIVATION_CHARS";
+
+ public static final String CONTEXT_INFO_AUTO_ACTIVATION_CHARS = "org.eclipse.xtext.ui.core.editor.XtextContentAssistProcessor.CONTEXT_INFO_AUTO_ACTIVATION_CHARS";
+
+ public static final String ERROR_MESSAGE = "org.eclipse.xtext.ui.core.editor.XtextContentAssistProcessor.ERROR_MESSAGE";
+
+ @Inject
+ private ContentAssistContext.Factory contextFactory;
+
+ @Inject(optional = true)
+ private ITemplateProposalProvider templateProposalProvider;
+
+ @Inject(optional = true)
+ private IContentProposalProvider contentProposalProvider;
+
+ @Inject(optional = true)
+ private IContextInformationProvider contextInformationProvider;
+
+ @Inject
+ private Provider<ICompletionProposalAcceptor.Delegate> completionProposalAcceptorProvider;
+
+ @Inject
+ private Provider<ITemplateAcceptor.Delegate> templateAcceptorProvider;
+
+ @Inject
+ private Provider<IContextInformationAcceptor.Delegate> contextInformationAcceptorProvider;
+
+ @Inject
+ private ICompletionProposalComparator completionProposalComparator;
+
+ @Inject(optional = true)
+ @Named(value=COMPLETION_AUTO_ACTIVATION_CHARS)
+ private String completionProposalAutoActivationCharacters = null;
+
+ @Inject(optional = true)
+ @Named(value=COMPLETION_AUTO_ACTIVATION_CHARS)
+ private String contextInformationAutoActivationCharacters = null;
+
+ @Inject(optional = true)
+ @Named(value=ERROR_MESSAGE)
+ private String errorMessage = null;
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+ if (contentProposalProvider == null)
+ return null;
+
+ IXtextDocument document = (IXtextDocument) viewer.getDocument();
+ ICompletionProposal[] result = document.readOnly(createCompletionProposalComputer(viewer, offset));
+ Arrays.sort(result, completionProposalComparator);
+ return result;
+ }
+
+ private CompletionProposalComputer createCompletionProposalComputer(ITextViewer viewer, int offset) {
+ return new CompletionProposalComputer(this, viewer, offset);
+ }
+
+ public IContextInformation[] computeContextInformation(final ITextViewer viewer, final int offset) {
+ if (contextInformationProvider == null)
+ return null;
+
+ IXtextDocument document = (IXtextDocument) viewer.getDocument();
+ return document.readOnly(createContextInformationComputer(viewer, offset));
+ }
+
+ protected ContextInformationComputer createContextInformationComputer(final ITextViewer viewer, final int offset) {
+ return new ContextInformationComputer(this, viewer, offset);
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ if (completionProposalAutoActivationCharacters != null)
+ return completionProposalAutoActivationCharacters.toCharArray();
+ return null;
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ if (contextInformationAutoActivationCharacters != null)
+ return contextInformationAutoActivationCharacters.toCharArray();
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return new ContextInformationValidator(this);
+ }
+
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ public void setCompletionProposalAutoActivationCharacters(String completionProposalAutoActivationCharacters) {
+ this.completionProposalAutoActivationCharacters = completionProposalAutoActivationCharacters;
+ }
+
+ public void setContextFactory(ContentAssistContext.Factory contextFactory) {
+ this.contextFactory = contextFactory;
+ }
+
+ public ContentAssistContext.Factory getContextFactory() {
+ return contextFactory;
+ }
+
+ public void setErrorMessage(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+
+ public void setContextInformationAutoActivationCharacters(String contextInformationAutoActivationCharacters) {
+ this.contextInformationAutoActivationCharacters = contextInformationAutoActivationCharacters;
+ }
+
+ public void setContentProposalProvider(IContentProposalProvider contentProposalProvider) {
+ this.contentProposalProvider = contentProposalProvider;
+ }
+
+ public IContentProposalProvider getContentProposalProvider() {
+ return contentProposalProvider;
+ }
+
+ public void setTemplateProposalProvider(ITemplateProposalProvider templateProposalProvider) {
+ this.templateProposalProvider = templateProposalProvider;
+ }
+
+ public ITemplateProposalProvider getTemplateProposalProvider() {
+ return templateProposalProvider;
+ }
+
+ public IContextInformationProvider getContextInformationProvider() {
+ return contextInformationProvider;
+ }
+
+ public ICompletionProposalAcceptor createAcceptor(ICompletionProposalAcceptor delegate) {
+ ICompletionProposalAcceptor.Delegate result = completionProposalAcceptorProvider.get();
+ result.setDelegate(delegate);
+ return result;
+ }
+
+ public ITemplateAcceptor createAcceptor(ITemplateAcceptor delegate) {
+ ITemplateAcceptor.Delegate result = templateAcceptorProvider.get();
+ result.setDelegate(delegate);
+ return result;
+ }
+
+ public IContextInformationAcceptor createAcceptor(IContextInformationAcceptor delegate) {
+ IContextInformationAcceptor.Delegate result = contextInformationAcceptorProvider.get();
+ result.setDelegate(delegate);
+ return result;
+ }
+
+}
+
diff --git a/plugins/org.eclipse.xtext.ui.generator/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext.ui.generator/META-INF/MANIFEST.MF
index 9bebd55..4e22aca 100644
--- a/plugins/org.eclipse.xtext.ui.generator/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xtext.ui.generator/META-INF/MANIFEST.MF
@@ -8,4 +8,5 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.xtext;bundle-version="0.7.0",
org.eclipse.xtext.generator;bundle-version="0.7.0",
org.eclipse.xtext.ui.common;bundle-version="0.7.0";visibility:=reexport,
- org.eclipse.xtext.xtend;bundle-version="0.7.0"
+ org.eclipse.xtext.xtend;bundle-version="0.7.0",
+ org.eclipse.xtext.ui.core
diff --git a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/ContentAssist.ext b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/ContentAssist.ext
index 14829fa..b2899cd 100644
--- a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/ContentAssist.ext
+++ b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/ContentAssist.ext
@@ -15,16 +15,14 @@ getProposalProvider(Grammar grammar) :
grammar.name + "ProposalProvider";
getGenProposalProvider(Grammar grammar) :
- grammar.name.toJavaPackage() + ".Gen" + grammar.name.toSimpleName() + "ProposalProvider";
+ grammar.name.toJavaPackage() + ".Abstract" + grammar.name.toSimpleName() + "ProposalProvider";
String getFqFeatureName(Assignment this):
containingParserRule().name.toFirstUpper()+"_"+feature.toFirstUpper();
-String getFqFeatureName(ParserRule this):
- (null!=type.metamodel.alias ? type.metamodel.alias.toFirstUpper()+"_" : "")+type.classifier.name.toFirstUpper();
-
-List[ParserRule] getParserRulesWithType(Grammar grammar) :
- grammar.allParserRules().select(parserRule|parserRule.type!=null);
+String getFqFeatureName(AbstractRule this):
+ "_" + name;
+
diff --git a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java
index d62f4ff..1a2d598 100644
--- a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java
+++ b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java
@@ -1,28 +1,54 @@
package org.eclipse.xtext.ui.generator.contentAssist;
+import java.util.Collections;
+import java.util.List;
import java.util.Map;
import org.eclipse.xtext.Grammar;
+import org.eclipse.xtext.GrammarUtil;
import org.eclipse.xtext.generator.AbstractGeneratorFragment;
import org.eclipse.xtext.generator.BindFactory;
import org.eclipse.xtext.generator.BindKey;
import org.eclipse.xtext.generator.BindValue;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider;
public class JavaBasedContentAssistFragment extends AbstractGeneratorFragment {
+ private boolean inherit = true;
+
@Override
public Map<BindKey, BindValue> getGuiceBindingsUi(Grammar grammar) {
return new BindFactory()
- .addTypeToType(IProposalProvider.class.getName(), grammar.getName()+"ProposalProvider")
- .getBindings();
+ .addTypeToType(IContentProposalProvider.class.getName(), grammar.getName()+"ProposalProvider")
+ .getBindings();
}
@Override
public String[] getRequiredBundlesUi(Grammar grammar) {
return new String[]{
- "org.eclipse.xtext.ui.common"
+ "org.eclipse.xtext.ui.common",
+ "org.eclipse.xtext.ui.core"
+ };
+ }
+
+ @Override
+ public String[] getExportedPackagesUi(Grammar grammar) {
+ return new String[] {
+ GrammarUtil.getNamespace(grammar)
};
}
+ @Override
+ protected List<Object> getParameters(Grammar grammar) {
+ return Collections.<Object>singletonList(inherit);
+ }
+
+ public void setInherit(boolean inherit) {
+ this.inherit = inherit;
+ }
+
+ public boolean isInherit() {
+ return inherit;
+ }
+
}
diff --git a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.xpt b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.xpt
index 6c16b62..8e275e7 100755
--- a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.xpt
+++ b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.xpt
@@ -15,95 +15,63 @@
«EXTENSION org::eclipse::xtext::GrammarUtil»
«EXTENSION org::eclipse::xtext::generator::Naming»
-«DEFINE generate FOR Grammar»
+«DEFINE generate(Boolean inherit) FOR Grammar-»
«FILE getGenProposalProvider().asPath()+".java" SRC_GEN_UI -»
/*
«fileHeader()»
*/
package «getGenProposalProvider().toJavaPackage()»;
-«IF !usedGrammars.containedAssignments().isEmpty-»
-import java.util.ArrayList;
-«ENDIF-»
-import java.util.Collections;
-import java.util.List;
-
-
+import org.apache.log4j.Logger;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.xtext.Alternatives;
import org.eclipse.xtext.Assignment;
import org.eclipse.xtext.CrossReference;
import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-«IF !usedGrammars.containedAssignments().isEmpty-»
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
+«IF inherit && usedGrammars.size == 1-»
+import «usedGrammars.first().getProposalProvider()»;
+«ELSE-»
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaBasedContentProposalProvider;
«ENDIF-»
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
/**
* Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
* with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
*/
-public class «getGenProposalProvider().toSimpleName()» extends AbstractJavaProposalProvider {
- «IF !usedGrammars.containedAssignments().isEmpty-»
- «FOREACH usedGrammars AS usedGrammar-»
- @Inject(optional=true)
- @Named("«usedGrammar.name»")
- protected IProposalProvider «usedGrammar.name.toSimpleName().toFirstLower()»IProposalProvider;
- «ENDFOREACH-»
-
- protected List<IProposalProvider> getReferencedProposalProviders() {
- List<IProposalProvider> referencedProposalProviders = new ArrayList<IProposalProvider>();
- «FOREACH usedGrammars AS usedGrammar-»
- if («usedGrammar.name.toSimpleName().toFirstLower()»IProposalProvider instanceof AbstractJavaProposalProvider) {
- referencedProposalProviders.addAll(((AbstractJavaProposalProvider) this.«usedGrammar.name.toSimpleName().toFirstLower()»IProposalProvider).getAllProposalProviders());
- }
- «ENDFOREACH-»
- return referencedProposalProviders;
- }
- «ENDIF-»
+public class «getGenProposalProvider().toSimpleName()» extends «IF inherit && usedGrammars.size == 1-»«usedGrammars.first().getProposalProvider().toSimpleName()»«ELSE-»AbstractJavaBasedContentProposalProvider«ENDIF-» {
+
+ private final static Logger logger = Logger.getLogger(«getGenProposalProvider().toSimpleName()».class);
+
«LET {} AS processedFqnFeatureNames-»
«FOREACH containedAssignments() AS assignment-»
- «LET getFqFeatureName(assignment) AS fqnFeatureName»
+ «LET getFqFeatureName(assignment) AS fqnFeatureName-»
«IF !processedFqnFeatureNames.contains(fqnFeatureName)-»
«processedFqnFeatureNames.add(fqnFeatureName)->""-»
- public List<? extends ICompletionProposal> complete«fqnFeatureName»(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
+ public void complete«fqnFeatureName»(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
if (logger.isDebugEnabled()) {
logger.debug("complete«fqnFeatureName» feature '" + assignment.getFeature() + "' terminal '"
+ assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
+ + context.getPrefix() + "'");
}
- «IF CrossReference.isInstance(assignment.terminal)-»
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- «ELSEIF RuleCall.isInstance(assignment.terminal) && ((RuleCall)assignment.terminal).rule.name=="ID" -»
- return Collections.singletonList(createCompletionProposal(assignment, "«fqnFeatureName»", contentAssistContext));
- «ELSEIF RuleCall.isInstance(assignment.terminal) && ((RuleCall)assignment.terminal).rule.name=="INT" -»
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- «ELSEIF RuleCall.isInstance(assignment.terminal) && ((RuleCall)assignment.terminal).rule.name=="STRING" -»
- return Collections.singletonList(createCompletionProposal(assignment, "\"«fqnFeatureName»\"", contentAssistContext));
- «ELSE-»
- return Collections.emptyList();
- «ENDIF-»
+«EXPAND assignmentTerminal("assignment.getTerminal()") FOR assignment.terminal-»
}
«ENDIF-»
«ENDLET-»
«ENDFOREACH-»
- «FOREACH getParserRulesWithType() AS parserRule-»
- «LET getFqFeatureName(parserRule) AS fqnFeatureName-»
+ «FOREACH rules AS rule-»
+ «LET getFqFeatureName(rule) AS fqnFeatureName-»
«IF !processedFqnFeatureNames.contains(fqnFeatureName)-»
«processedFqnFeatureNames.add(fqnFeatureName)->""-»
- public List<? extends ICompletionProposal> complete«fqnFeatureName»(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ public void complete«fqnFeatureName»(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
if (logger.isDebugEnabled()) {
logger.debug("complete«fqnFeatureName» '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
}
- return Collections.emptyList();
+ // subclasses may override
}
«ENDIF-»
«ENDLET-»
@@ -112,7 +80,7 @@ public class «getGenProposalProvider().toSimpleName()» extends AbstractJavaPropo
}
«ENDFILE»
-«FILE getProposalProvider().asPath()+".java" SRC_UI»
+«FILE getProposalProvider().asPath()+".java" SRC_UI-»
package «getProposalProvider().toJavaPackage()»;
public class «getProposalProvider().toSimpleName()» extends «getGenProposalProvider()» {
@@ -121,8 +89,27 @@ public class «getProposalProvider().toSimpleName()» extends «getGenProposalProvi
«ENDFILE»
«ENDDEFINE»
-«DEFINE addToPluginXmlRt FOR Grammar»«ENDDEFINE»
-«DEFINE addToPluginXmlUi FOR Grammar»«ENDDEFINE»
+«DEFINE assignmentTerminal(String accessor) FOR AbstractElement-»
+ // subclasses may override
+«ENDDEFINE»
+
+«DEFINE assignmentTerminal(String accessor) FOR CrossReference-»
+ lookupCrossReference(((CrossReference)«accessor»), context, acceptor);
+«ENDDEFINE»
+
+«DEFINE assignmentTerminal(String accessor) FOR RuleCall-»
+ completeRuleCall(((RuleCall)«accessor»), context, acceptor);
+«ENDDEFINE»
+
+«DEFINE assignmentTerminal(String accessor) FOR Alternatives-»
+«FOREACH groups AS group ITERATOR iter-»
+«EXPAND assignmentTerminal("((Alternatives)" + accessor + ").getGroups().get(" + iter.counter0 + ")") FOR group-»
+«ENDFOREACH-»
+«ENDDEFINE»
+
+«DEFINE addToPluginXmlRt(Boolean inherit) FOR Grammar»«ENDDEFINE»
+
+«DEFINE addToPluginXmlUi(Boolean inherit) FOR Grammar»«ENDDEFINE»
-«DEFINE addToStandaloneSetup FOR Grammar»«ENDDEFINE» \ No newline at end of file
+«DEFINE addToStandaloneSetup(Boolean inherit) FOR Grammar»«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendBasedContentAssistFragment.java b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendBasedContentAssistFragment.java
index 4b85ea4..5f95306 100644
--- a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendBasedContentAssistFragment.java
+++ b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendBasedContentAssistFragment.java
@@ -7,14 +7,14 @@ import org.eclipse.xtext.generator.AbstractGeneratorFragment;
import org.eclipse.xtext.generator.BindFactory;
import org.eclipse.xtext.generator.BindKey;
import org.eclipse.xtext.generator.BindValue;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider;
public class XtendBasedContentAssistFragment extends AbstractGeneratorFragment {
@Override
public Map<BindKey, BindValue> getGuiceBindingsUi(Grammar grammar) {
return new BindFactory()
- .addTypeToType(IProposalProvider.class.getName(), grammar.getName()+"ProposalProvider")
+ .addTypeToType(IContentProposalProvider.class.getName(), grammar.getName()+"ProposalProvider")
.getBindings();
}
diff --git a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendProposals.xpt b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendProposals.xpt
index e5253eb..03aa697 100644
--- a/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendProposals.xpt
+++ b/plugins/org.eclipse.xtext.ui.generator/src/org/eclipse/xtext/ui/generator/contentAssist/XtendProposals.xpt
@@ -33,6 +33,7 @@ import org::eclipse::xtext;
import org::eclipse::emf::ecore;
import org::eclipse::jface::text::contentassist;
import org::eclipse::xtext::crossref;
+import org::eclipse::xtext::ui::core::editor::contentassist;
import org::eclipse::xtext::ui::common::editor::contentassist;
import org::eclipse::xtext::ui::common::xtend::contentassist;
@@ -49,10 +50,10 @@ extension org::eclipse::xtend::util::stdlib::io;
LET getFqFeatureName(assignment) AS fqnFeatureName»«
IF !processedFqnFeatureNames.contains(fqnFeatureName)»«
processedFqnFeatureNames.add(fqnFeatureName)->""»
-List[ICompletionProposal] complete«fqnFeatureName»(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) :
+List[ICompletionProposal] complete«fqnFeatureName»(EObject model, Assignment assignment, ContentAssistContext contentAssistContext) :
debug("complete«fqnFeatureName» feature '" + assignment.feature + "' terminal '"
+ assignment.terminal + "' cardinality '" + assignment.cardinality + "' and prefix '"
- + contentAssistContext.matchString.trim() + "'") ->«
+ + contentAssistContext.prefix + "'") ->«
IF CrossReference.isInstance(assignment.terminal)»
lookupCrossReference(((CrossReference)assignment.terminal), contentAssistContext);«
ELSEIF RuleCall.isInstance(assignment.terminal) && ((RuleCall)assignment.terminal).rule.name=="ID" »
@@ -67,11 +68,11 @@ List[ICompletionProposal] complete«fqnFeatureName»(EObject model, Assignment ass
ENDIF»
« ENDLET»«
ENDFOREACH-»
-« FOREACH getParserRulesWithType() AS parserRule»«
- LET getFqFeatureName(parserRule) AS fqnFeatureName»«
+« FOREACH rules AS rule»«
+ LET getFqFeatureName(rule) AS fqnFeatureName»«
IF !processedFqnFeatureNames.contains(fqnFeatureName)»«
processedFqnFeatureNames.add(fqnFeatureName)->""»
-List[ICompletionProposal] complete«fqnFeatureName»(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) :
+List[ICompletionProposal] complete«fqnFeatureName»(EObject model, RuleCall ruleCall, ContentAssistContext contentAssistContext) :
{};
« ENDIF»«
ENDLET»«
@@ -102,6 +103,7 @@ import org::eclipse::xtext;
import org::eclipse::jface::text::contentassist;
import org::eclipse::xtext::crossref;
+import org::eclipse::xtext::ui::core::editor::contentassist;
import org::eclipse::xtext::ui::common::editor::contentassist;
import org::eclipse::xtext::ui::common::xtend::contentassist;
diff --git a/plugins/org.eclipse.xtext.xtend/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext.xtend/META-INF/MANIFEST.MF
index c3cd6b4..967eba1 100644
--- a/plugins/org.eclipse.xtext.xtend/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xtext.xtend/META-INF/MANIFEST.MF
@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.xtend.typesystem.emf;bundle-version="0.7.0",
org.eclipse.xtext.log4j;bundle-version="1.2.15",
org.eclipse.xtend.util.stdlib;bundle-version="0.7.0";visibility:=reexport,
- com.google.collect;bundle-version="0.8.0";visibility:=reexport
+ com.google.collect;bundle-version="0.8.0";visibility:=reexport,
+ org.eclipse.xtext.ui.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.xtext.check,
diff --git a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/AbstractXtendService.java b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/AbstractXtendService.java
index 326ef34..80f0957 100644
--- a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/AbstractXtendService.java
+++ b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/AbstractXtendService.java
@@ -9,10 +9,6 @@ package org.eclipse.xtext.xtend;
import java.util.List;
-import org.eclipse.xtend.XtendFacade;
-import org.eclipse.xtend.expression.ExecutionContext;
-
-import com.google.common.base.Function;
import com.google.inject.Inject;
/**
@@ -20,45 +16,26 @@ import com.google.inject.Inject;
* variables in the execution context, making them accessible from within Xtend.
*
* @author Jan Köhnlein - Initial contribution and API
+ * @author Sebastian Zarnekow
*/
public abstract class AbstractXtendService {
- protected ExecutionContextAware ctx;
+ private XtendServiceHelper helper;
@Inject
- public void setExecutionContextAware(ExecutionContextAware ctx) {
- this.ctx = ctx;
+ public void setHelper(XtendServiceHelper helper) {
+ this.helper = helper;
+ helper.setMasterXtendFileName(getMasterXtendFileName());
}
-
- /**
- * Returns the fully qualified name of the xtend file containing the
- * extensions to be called.
- *
- * @return
- */
+
protected abstract String getMasterXtendFileName();
- @SuppressWarnings("unchecked")
- protected <T> T invokeExtension(final String extensionName, final List<?> parameterValues)
- throws AbstractXtendExecutionException {
- return ctx.exec(new Function<ExecutionContext,T>(){
-
- public T apply(ExecutionContext ctx) {
- XtendFacade facade = XtendFacade.create(ctx, getMasterXtendFileName());
- if (!facade.hasExtension(extensionName, parameterValues)) {
- throw new NoSuchExtensionException(extensionName, parameterValues);
- }
- Object resultObject = facade.call(extensionName, parameterValues);
- try {
- return (T) resultObject;
- } catch (ClassCastException e) {
- throw new IllegalReturnTypeException(extensionName, parameterValues, e);
- }
- }});
-
+ public XtendServiceHelper getHelper() {
+ return helper;
}
-
- public String toXtendFQName(String fqName) {
- return fqName.replaceAll("\\.", "::");
+
+ protected <T> T invokeExtension(final String extensionName, final List<?> parameterValues)
+ throws AbstractXtendExecutionException {
+ return helper.invokeExtension(extensionName, parameterValues);
}
}
diff --git a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/InjectableResourceManager.java b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/InjectableResourceManager.java
index 06095c5..34659b3 100644
--- a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/InjectableResourceManager.java
+++ b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/InjectableResourceManager.java
@@ -14,7 +14,6 @@ import java.io.Reader;
import org.eclipse.internal.xtend.expression.parser.SyntaxConstants;
import org.eclipse.internal.xtend.util.Cache;
import org.eclipse.xtend.expression.Resource;
-import org.eclipse.xtend.expression.ResourceManager;
import org.eclipse.xtend.expression.ResourceManagerDefaultImpl;
import org.eclipse.xtend.expression.ResourceParser;
import org.eclipse.xtext.util.Pair;
@@ -26,19 +25,18 @@ import com.google.inject.name.Named;
/**
* @author Sven Efftinge - Initial contribution and API
- *
*/
@Singleton
-public class InjectableResourceManager extends ResourceManagerDefaultImpl implements ResourceManager {
+public class InjectableResourceManager extends ResourceManagerDefaultImpl {
- private ClassLoader classLoader;
+ private final ClassLoader classLoader;
@Inject
public InjectableResourceManager(ClassLoader classLoader) {
this.classLoader = classLoader;
}
- private Cache<Pair<String, String>, Resource> resourceCache = new Cache<Pair<String, String>, Resource>() {
+ private final Cache<Pair<String, String>, Resource> resourceCache = new Cache<Pair<String, String>, Resource>() {
@Override
protected Resource createNew(Pair<String, String> resourceName) {
@@ -48,19 +46,19 @@ public class InjectableResourceManager extends ResourceManagerDefaultImpl implem
if (in == null)
return null;
- else {
- Reader reader = createReader(in);
- final ResourceParser parser = registeredParsers.get(resourceName.getSecond());
- if (parser == null)
- throw new RuntimeException("No Parser registered for extension '" + resourceName.getSecond()
- + "'! Known extensions are '" + registeredParsers.keySet() + "'");
- final Resource res = parser.parse(reader, qualifiedResourceName);
- res.setFullyQualifiedName(resourceName.getFirst());
- return res;
- }
+
+ Reader reader = createReader(in);
+ final ResourceParser parser = registeredParsers.get(resourceName.getSecond());
+ if (parser == null)
+ throw new RuntimeException("No Parser registered for extension '" + resourceName.getSecond()
+ + "'! Known extensions are '" + registeredParsers.keySet() + "'");
+ final Resource res = parser.parse(reader, qualifiedResourceName);
+ res.setFullyQualifiedName(resourceName.getFirst());
+ return res;
}
};
+ @Override
public Resource loadResource(String fullyQualifiedName, String extension) {
return resourceCache.get(Tuples.pair(fullyQualifiedName,extension));
}
@@ -71,7 +69,8 @@ public class InjectableResourceManager extends ResourceManagerDefaultImpl implem
public final static String FILE_ENCODING = "fileEncoding";
- @Inject(optional=true)
+ @Override
+ @Inject(optional=true)
public void setFileEncoding(@Named(FILE_ENCODING) String fileEncoding) {
super.setFileEncoding(fileEncoding);
}
diff --git a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/XtendServiceHelper.java b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/XtendServiceHelper.java
new file mode 100644
index 0000000..6fd4bf9
--- /dev/null
+++ b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/XtendServiceHelper.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.xtend;
+
+import java.util.List;
+
+import org.eclipse.xtend.XtendFacade;
+import org.eclipse.xtend.expression.ExecutionContext;
+
+import com.google.common.base.Function;
+import com.google.inject.Inject;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class XtendServiceHelper {
+
+ @Inject
+ private ExecutionContextAware ctx;
+
+ private String masterXtendFileName;
+
+ public ExecutionContextAware getExecutionContextAware() {
+ return ctx;
+ }
+
+ public void setExecutionContextAware(ExecutionContextAware ctx) {
+ this.ctx = ctx;
+ }
+
+ /**
+ * Returns the fully qualified name of the xtend file containing the
+ * extensions to be called.
+ *
+ * @return
+ */
+ public String getMasterXtendFileName() {
+ return masterXtendFileName;
+ }
+
+ public void setMasterXtendFileName(String fileName) {
+ this.masterXtendFileName = fileName;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public <T> T invokeExtension(final String extensionName, final List<?> parameterValues)
+ throws AbstractXtendExecutionException {
+ return ctx.exec(new Function<ExecutionContext,T>(){
+
+ public T apply(ExecutionContext ctx) {
+ XtendFacade facade = XtendFacade.create(ctx, getMasterXtendFileName());
+ if (!facade.hasExtension(extensionName, parameterValues)) {
+ throw new NoSuchExtensionException(extensionName, parameterValues);
+ }
+ Object resultObject = facade.call(extensionName, parameterValues);
+ try {
+ return (T) resultObject;
+ } catch (ClassCastException e) {
+ throw new IllegalReturnTypeException(extensionName, parameterValues, e);
+ }
+ }});
+ }
+
+ public String toXtendFQName(String fqName) {
+ return fqName.replaceAll("\\.", "::");
+ }
+
+}
diff --git a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/AbstractXtendProposalProvider.java b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/AbstractXtendProposalProvider.java
index a539343..3028d6c 100644
--- a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/AbstractXtendProposalProvider.java
+++ b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/AbstractXtendProposalProvider.java
@@ -8,29 +8,25 @@
package org.eclipse.xtext.xtend.contentassist;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import org.apache.log4j.Logger;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContextType;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.Assignment;
import org.eclipse.xtext.GrammarUtil;
import org.eclipse.xtext.Keyword;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.TerminalRule;
-import org.eclipse.xtext.TypeRef;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.ProposalFilterSorterUtil;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.XtextCompletionProposal;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractContentProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
import org.eclipse.xtext.util.Strings;
-import org.eclipse.xtext.xtend.AbstractXtendService;
+import org.eclipse.xtext.xtend.AbstractXtendExecutionException;
import org.eclipse.xtext.xtend.NoSuchExtensionException;
+import org.eclipse.xtext.xtend.XtendServiceHelper;
+
+import com.google.inject.Inject;
/**
* Super class for <code>IProposalProvider</code> implementations that call
@@ -55,63 +51,28 @@ import org.eclipse.xtext.xtend.NoSuchExtensionException;
* @see IProposalProvider
* @see AbstractJavaProposalProvider
*/
-public abstract class AbstractXtendProposalProvider extends AbstractXtendService implements IProposalProvider {
+public abstract class AbstractXtendProposalProvider extends AbstractContentProposalProvider {
- protected final Logger logger = Logger.getLogger(IProposalProvider.class);
+ private static final Logger logger = Logger.getLogger(AbstractXtendProposalProvider.class);
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#completeKeyword(Keyword,
- * IContentAssistContext)
- */
- public List<? extends ICompletionProposal> completeKeyword(Keyword keyword,
- IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKeyword '" + keyword.getValue() + "' for model '" + contentAssistContext.getModel()
- + "' and prefix '" + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections
- .singletonList(new XtextCompletionProposal(keyword, keyword.getValue(), contentAssistContext,null));
- }
+ private XtendServiceHelper helper;
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#completeRuleCall(RuleCall,
- * IContentAssistContext)
- */
- public List<? extends ICompletionProposal> completeRuleCall(RuleCall ruleCall,
- IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeRuleCall '" + ruleCall.getRule().getName() + "' cardinality '"
- + ruleCall.getCardinality() + "' for model '" + contentAssistContext.getModel() + "' and prefix '"
- + contentAssistContext.getMatchString().trim().trim() + "'");
- }
- AbstractRule calledRule = ruleCall.getRule();
- if (calledRule instanceof TerminalRule) {
- return completeTerminalRuleRuleCall((TerminalRule) calledRule, ruleCall, contentAssistContext);
- }
- else if (calledRule.getType() != null) {
- TypeRef typeRef = calledRule.getType();
- return invokeExtension("complete" + Strings.toFirstUpper(typeRef.getMetamodel().getAlias()) + "_"
- + Strings.toFirstUpper(typeRef.getClassifier().getName()), Arrays.asList(contentAssistContext
- .getModel(), ruleCall, contentAssistContext));
- }
- return Collections.emptyList();
+ @Inject
+ public void setHelper(XtendServiceHelper helper) {
+ this.setHelper(helper);
+ helper.setMasterXtendFileName(getMasterXtendFileName());
}
+
+ protected abstract String getMasterXtendFileName();
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#completeAssignment(Assignment,
- * IContentAssistContext)
- */
- public List<? extends ICompletionProposal> completeAssignment(Assignment assignment,
- IContentAssistContext contentAssistContext) {
- ParserRule parserRule = GrammarUtil.containingParserRule(assignment);
- return invokeExtension("complete" + Strings.toFirstUpper(parserRule.getName()) + "_"
- + Strings.toFirstUpper(assignment.getFeature()), Arrays.asList(contentAssistContext.getModel(),
- assignment, contentAssistContext));
+ public XtendServiceHelper getHelper() {
+ return helper;
}
-
- protected List<? extends ICompletionProposal> invokeExtension(String extensionName, List<?> parameterValues) {
+
+ protected List<ICompletionProposal> invokeExtension(final String extensionName, final List<?> parameterValues)
+ throws AbstractXtendExecutionException {
try {
- List<ICompletionProposal> proposals = super.invokeExtension(extensionName, parameterValues);
+ List<ICompletionProposal> proposals = helper.invokeExtension(extensionName, parameterValues);
return proposals;
}
catch (NoSuchExtensionException nsee) {
@@ -123,48 +84,39 @@ public abstract class AbstractXtendProposalProvider extends AbstractXtendService
return null;
}
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#getTemplateContextType(Keyword,
- * IContentAssistContext)
- */
- public TemplateContextType getTemplateContextType(Keyword keyword, IContentAssistContext contentAssistContext) {
- return null;
- }
-
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#getTemplateContextType(RuleCall,
- * IContentAssistContext)
- */
- public TemplateContextType getTemplateContextType(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- return null;
+ @Override
+ public void completeAssignment(Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ ParserRule parserRule = GrammarUtil.containingParserRule(assignment);
+ String extensionName = "complete" + Strings.toFirstUpper(parserRule.getName()) + "_"
+ + Strings.toFirstUpper(assignment.getFeature());
+ List<ICompletionProposal> proposals = invokeExtension(extensionName, Arrays.asList(context.getCurrentModel(),
+ assignment, context));
+ addProposals(acceptor, proposals);
}
- /**
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#getTemplates(String)
- */
- public Template[] getTemplates(String contextTypeId) {
- return new Template[] {};
+ @Override
+ public void completeKeyword(Keyword keyword, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ ICompletionProposal proposal = ContentAssistHelper.newProposal(keyword, keyword.getValue(), context);
+ acceptor.accept(proposal);
}
- protected List<? extends ICompletionProposal> completeTerminalRuleRuleCall(TerminalRule lexerRule, RuleCall ruleCall,
- IContentAssistContext contentAssistContext) {
- return invokeExtension("complete" + lexerRule.getName(), Arrays.asList(ruleCall, contentAssistContext));
+ @Override
+ public void completeRuleCall(RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ AbstractRule calledRule = ruleCall.getRule();
+ String extensionName = "complete_" + calledRule.getName();
+
+ List<ICompletionProposal> proposals = invokeExtension(extensionName, Arrays.asList(context.getCurrentModel(), ruleCall, context));
+ addProposals(acceptor, proposals);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#filter(java.util.List, org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext)
- */
- public List<? extends ICompletionProposal> filter(List<ICompletionProposal> completionProposalList,
- IContentAssistContext contentAssistContext) {
- return ProposalFilterSorterUtil.filter(completionProposalList, contentAssistContext);
+ private void addProposals(ICompletionProposalAcceptor acceptor, List<ICompletionProposal> proposals) {
+ if (proposals != null) {
+ for(ICompletionProposal proposal: proposals) {
+ if (!acceptor.canAcceptMoreProposals())
+ return;
+ acceptor.accept(proposal);
+ }
+ }
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider#sort(java.util.List)
- */
- public List<? extends ICompletionProposal> sort(List<ICompletionProposal> completionProposalList) {
- return ProposalFilterSorterUtil.sort(completionProposalList);
- }
}
diff --git a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssist.ext b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssist.ext
index cfbb502..fdbdf556 100644
--- a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssist.ext
+++ b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssist.ext
@@ -9,16 +9,17 @@ import org::eclipse::xtext;
import org::eclipse::jface::text::contentassist;
import org::eclipse::xtext::crossref;
+import org::eclipse::xtext::ui::core::editor::contentassist;
import org::eclipse::xtext::ui::common::editor::contentassist;
import org::eclipse::xtext::ui::common::xtend::contentassist;
extension org::eclipse::xtext::Extensions reexport;
extension org::eclipse::xtext::xtend::Services reexport;
-ICompletionProposal newProposal(AbstractElement element, String text, IContentAssistContext contentAssistContext) :
- JAVA org.eclipse.xtext.xtend.contentassist.ContentAssistHelper.newProposal(org.eclipse.xtext.AbstractElement, java.lang.String, org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext);
+ICompletionProposal newProposal(AbstractElement element, String text, ContentAssistContext contentAssistContext) :
+ JAVA org.eclipse.xtext.xtend.contentassist.ContentAssistHelper.newProposal(org.eclipse.xtext.AbstractElement, java.lang.String, org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext);
-List[ICompletionProposal] lookupCrossReference(CrossReference crossRef, IContentAssistContext contentAssistContext) :
+List[ICompletionProposal] lookupCrossReference(CrossReference crossRef, ContentAssistContext contentAssistContext) :
scopeProvider() != null
? (
!crossRef.containingParserRule().isDatatypeRule()
@@ -31,14 +32,14 @@ List[ICompletionProposal] lookupCrossReference(CrossReference crossRef, IContent
// Helper extensions
-List[IScopedElement] lookupCandidates(CrossReference crossRef, IContentAssistContext contentAssistContext) :
- let scope = scopeProvider().getScope(contentAssistContext.model, crossRef.eReference()) :
+List[IScopedElement] lookupCandidates(CrossReference crossRef, ContentAssistContext contentAssistContext) :
+ let scope = scopeProvider().getScope(contentAssistContext.currentModel, crossRef.eReference()) :
(scope != null) ? scope.allContents.toList() : {};
-List[IScopedElement] filterMatches(List[IScopedElement] this, IContentAssistContext contentAssistContext) :
- select(e|e.name() != null && e.name().toLowerCase().startsWith(contentAssistContext.matchString.trim().toLowerCase()));
+List[IScopedElement] filterMatches(List[IScopedElement] this, ContentAssistContext contentAssistContext) :
+ select(e|e.name() != null && e.name().toLowerCase().startsWith(contentAssistContext.prefix.toLowerCase()));
-ICompletionProposal newProposal(IScopedElement this, CrossReference crossRef, IContentAssistContext contentAssistContext):
+ICompletionProposal newProposal(IScopedElement this, CrossReference crossRef, ContentAssistContext contentAssistContext):
newProposal(crossRef, name(), contentAssistContext);
IScopeProvider scopeProvider():
diff --git a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssistHelper.java b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssistHelper.java
index 6d76b85..f029fc9 100644
--- a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssistHelper.java
+++ b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/contentassist/ContentAssistHelper.java
@@ -9,22 +9,27 @@ package org.eclipse.xtext.xtend.contentassist;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.crossref.IScope;
import org.eclipse.xtext.crossref.IScopeProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.XtextCompletionProposal;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
/**
* @author Jan Köhnlein - Initial contribution and API
* @author Michael Clay
+ * @author Sebastian Zarnekow
*/
public class ContentAssistHelper {
- public static ICompletionProposal newProposal(AbstractElement element, String text,
- IContentAssistContext contentAssistContext) {
- return new XtextCompletionProposal(element, text, contentAssistContext,null);
+ public static ICompletionProposal newProposal(AbstractElement element, String text, ContentAssistContext context) {
+ if (text.regionMatches(true, 0, context.getPrefix(), 0,context.getPrefix().length())) {
+ int replacementOffset = context.getReplaceRegion().getOffset();
+ int replacementLength = context.getReplaceRegion().getLength();
+ return new CompletionProposal(text, replacementOffset, replacementLength, text.length());
+ }
+ return null;
}
public static IScope getScope(IScopeProvider scopeProvider, Object context, Object reference) {
diff --git a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/Scope.java b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/Scope.java
index 89c7e5f..525fcff 100644
--- a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/Scope.java
+++ b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/Scope.java
@@ -20,9 +20,8 @@ import com.google.common.collect.Collections2;
/**
* @author Sven Efftinge - Initial contribution and API
- *
*/
-public class Scope extends AbstractScope implements IScope {
+public class Scope extends AbstractScope {
private List<IScopedElement> elements;
diff --git a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/XtendScopeProvider.java b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/XtendScopeProvider.java
index 1d80a95..e316f64 100755
--- a/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/XtendScopeProvider.java
+++ b/plugins/org.eclipse.xtext.xtend/src/org/eclipse/xtext/xtend/scoping/XtendScopeProvider.java
@@ -28,14 +28,14 @@ import com.google.inject.name.Named;
*
* IScope scope_<ExpectedTypeName>(<MyContextType> ctx, EReference ref) : ...
*
- * Where
+ * Where
* 1) ExpectedTypeName refers to ref.getEType().getName() and
* 2) MyContextType refers to the type (or any super type) of the source element.
*
* If no such declaration can be found it will sitch the ctx to ctx.eContainer and try again.
* Example:
- * If you have Classes containing Features which have a cross reference to a Class.
- * The implementation will first look for
+ * If you have Classes containing Features which have a cross reference to a Class.
+ * The implementation will first look for
*
* IScope scope_Class(Feature ctx,EReference ref) : ...
*
@@ -50,9 +50,9 @@ import com.google.inject.name.Named;
public class XtendScopeProvider extends AbstractXtendService implements IScopeProvider {
public final static String EXTENSION_FILE = "ScopeExtensions";
- private String extensionFile;
+ private final String extensionFile;
- private DefaultScopeProvider defaultScopeProvider;
+ private final DefaultScopeProvider defaultScopeProvider;
@Inject
public XtendScopeProvider(@Named(EXTENSION_FILE) String name, DefaultScopeProvider defaultScopeProvider) {
@@ -76,11 +76,10 @@ public class XtendScopeProvider extends AbstractXtendService implements IScopePr
}
if (result != null)
return (IScope) result;
- if (context.eContainer() != null) {
+ if (context.eContainer() != null)
return getScope(context.eContainer(), reference);
- } else {
- computeDefaultScope(context, reference);
- }
+
+ computeDefaultScope(context, reference);
}
} catch (Throwable e) {
log.error("Error invoking scope extension", e);
@@ -100,11 +99,10 @@ public class XtendScopeProvider extends AbstractXtendService implements IScopePr
}
if (result != null)
return (IScope) result;
- if (context.eContainer() != null) {
+ if (context.eContainer() != null)
return getScope(context.eContainer(), type);
- } else {
- computeDefaultScope(context, type);
- }
+
+ computeDefaultScope(context, type);
}
} catch (Throwable e) {
log.error("Error invoking scope extension", e);
diff --git a/tests/org.eclipse.xtext.ui.common.tests/plugin.properties b/tests/org.eclipse.xtext.ui.common.tests/plugin.properties
new file mode 100644
index 0000000..815c794
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/plugin.properties
@@ -0,0 +1,8 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id: plugin.properties,v 1.1 2009/04/23 18:06:55 szarnekow Exp $
+
+pluginName = XtextGrammarTestLanguage Model
+providerName = www.example.org
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageProposalProvider.java
new file mode 100644
index 0000000..3c7984f
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageProposalProvider.java
@@ -0,0 +1,690 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractXtextGrammarTestLanguageProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractXtextGrammarTestLanguageProposalProvider.class);
+
+ public void completeGrammar_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGrammar_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeGrammar_UsedGrammars(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGrammar_UsedGrammars feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeGrammar_DefinesHiddenTokens(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGrammar_DefinesHiddenTokens feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeGrammar_HiddenTokens(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGrammar_HiddenTokens feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeGrammar_MetamodelDeclarations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGrammar_MetamodelDeclarations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeGrammar_Rules(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGrammar_Rules feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeGeneratedMetamodel_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGeneratedMetamodel_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeGeneratedMetamodel_EPackage(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGeneratedMetamodel_EPackage feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeGeneratedMetamodel_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGeneratedMetamodel_Alias feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeReferencedMetamodel_EPackage(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeReferencedMetamodel_EPackage feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeReferencedMetamodel_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeReferencedMetamodel_Alias feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeParserRule_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeParserRule_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeParserRule_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeParserRule_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeParserRule_DefinesHiddenTokens(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeParserRule_DefinesHiddenTokens feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeParserRule_HiddenTokens(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeParserRule_HiddenTokens feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeParserRule_Alternatives(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeParserRule_Alternatives feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTypeRef_Metamodel(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTypeRef_Metamodel feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTypeRef_Classifier(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTypeRef_Classifier feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAlternatives_Groups(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAlternatives_Groups feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeGroup_Tokens(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeGroup_Tokens feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAbstractTokenWithCardinality_Cardinality(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAbstractTokenWithCardinality_Cardinality feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ // subclasses may override
+ // subclasses may override
+ }
+ public void completeAction_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAction_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAction_Feature(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAction_Feature feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAction_Operator(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAction_Operator feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ // subclasses may override
+ }
+ public void completeKeyword_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeKeyword_Value feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeRuleCall_Rule(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeRuleCall_Rule feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAssignment_Feature(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAssignment_Feature feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAssignment_Operator(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAssignment_Operator feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ // subclasses may override
+ // subclasses may override
+ }
+ public void completeAssignment_Terminal(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAssignment_Terminal feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAssignableAlternatives_Groups(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAssignableAlternatives_Groups feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeCrossReference_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeCrossReference_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeCrossReference_Terminal(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeCrossReference_Terminal feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeCrossReferenceableAlternatives_Groups(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeCrossReferenceableAlternatives_Groups feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTerminalRule_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTerminalRule_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTerminalRule_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTerminalRule_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTerminalRule_Alternatives(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTerminalRule_Alternatives feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTerminalAlternatives_Groups(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTerminalAlternatives_Groups feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTerminalGroup_Tokens(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTerminalGroup_Tokens feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeTerminalToken_Cardinality(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeTerminalToken_Cardinality feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ // subclasses may override
+ // subclasses may override
+ }
+ public void completeNegatedToken_Terminal(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeNegatedToken_Terminal feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeUntilToken_Terminal(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeUntilToken_Terminal feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeCharacterRange_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeCharacterRange_Right feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEnumRule_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEnumRule_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEnumRule_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEnumRule_Type feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEnumRule_Alternatives(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEnumRule_Alternatives feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEnumLiterals_Groups(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEnumLiterals_Groups feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEnumLiteralDeclaration_EnumLiteral(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEnumLiteralDeclaration_EnumLiteral feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeEnumLiteralDeclaration_Literal(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEnumLiteralDeclaration_Literal feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_Grammar(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Grammar '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_GrammarID(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_GrammarID '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AbstractRule(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AbstractRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AbstractMetamodelDeclaration(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AbstractMetamodelDeclaration '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_GeneratedMetamodel(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_GeneratedMetamodel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ReferencedMetamodel(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ReferencedMetamodel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ParserRule(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ParserRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_TypeRef(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_TypeRef '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Alternatives(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Alternatives '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Group(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Group '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AbstractToken(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AbstractToken '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AbstractTokenWithCardinality(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AbstractTokenWithCardinality '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Action(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Action '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AbstractTerminal(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AbstractTerminal '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Keyword(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Keyword '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_RuleCall(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_RuleCall '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Assignment(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Assignment '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AssignableTerminal(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AssignableTerminal '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ParenthesizedAssignableElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ParenthesizedAssignableElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AssignableAlternatives(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AssignableAlternatives '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_CrossReference(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_CrossReference '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_CrossReferenceableTerminal(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_CrossReferenceableTerminal '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ParenthesizedCrossReferenceableElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ParenthesizedCrossReferenceableElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_CrossReferenceableAlternatives(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_CrossReferenceableAlternatives '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ParenthesizedElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ParenthesizedElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_TerminalRule(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_TerminalRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_TerminalAlternatives(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_TerminalAlternatives '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_TerminalGroup(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_TerminalGroup '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_TerminalToken(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_TerminalToken '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_TerminalTokenElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_TerminalTokenElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ParenthesizedTerminalElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ParenthesizedTerminalElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AbstractNegatedToken(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AbstractNegatedToken '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_NegatedToken(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_NegatedToken '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_UntilToken(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_UntilToken '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Wildcard(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Wildcard '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_CharacterRange(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_CharacterRange '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EnumRule(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EnumRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EnumLiterals(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EnumLiterals '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_EnumLiteralDeclaration(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_EnumLiteralDeclaration '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageUiModule.java
index 9dda139..2493f7d 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageUiModule.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/AbstractXtextGrammarTestLanguageUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractXtextGrammarTestLanguageUiModule extends DefaultUI
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.XtextGrammarTestLanguageProposalProvider.class;
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageProposalProvider.java
deleted file mode 100644
index 8066561..0000000
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageProposalProvider.java
+++ /dev/null
@@ -1,610 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenXtextGrammarTestLanguageProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeGrammar_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGrammar_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeGrammar_UsedGrammars(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGrammar_UsedGrammars feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
-
- public List<? extends ICompletionProposal> completeGrammar_DefinesHiddenTokens(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGrammar_DefinesHiddenTokens feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeGrammar_HiddenTokens(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGrammar_HiddenTokens feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
-
- public List<? extends ICompletionProposal> completeGrammar_MetamodelDeclarations(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGrammar_MetamodelDeclarations feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeGrammar_Rules(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGrammar_Rules feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeGeneratedMetamodel_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGeneratedMetamodel_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "GeneratedMetamodel_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeGeneratedMetamodel_EPackage(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGeneratedMetamodel_EPackage feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeGeneratedMetamodel_Alias(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGeneratedMetamodel_Alias feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "GeneratedMetamodel_Alias", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeReferencedMetamodel_EPackage(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReferencedMetamodel_EPackage feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeReferencedMetamodel_Alias(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReferencedMetamodel_Alias feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "ReferencedMetamodel_Alias", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeParserRule_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParserRule_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "ParserRule_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeParserRule_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParserRule_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeParserRule_DefinesHiddenTokens(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParserRule_DefinesHiddenTokens feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeParserRule_HiddenTokens(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParserRule_HiddenTokens feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
-
- public List<? extends ICompletionProposal> completeParserRule_Alternatives(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParserRule_Alternatives feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeTypeRef_Metamodel(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTypeRef_Metamodel feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeTypeRef_Classifier(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTypeRef_Classifier feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeAlternatives_Groups(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAlternatives_Groups feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeGroup_Tokens(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGroup_Tokens feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeAbstractTokenWithCardinality_Cardinality(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAbstractTokenWithCardinality_Cardinality feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeAction_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAction_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeAction_Feature(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAction_Feature feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Action_Feature", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeAction_Operator(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAction_Operator feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeKeyword_Value(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKeyword_Value feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"Keyword_Value\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeRuleCall_Rule(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeRuleCall_Rule feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeAssignment_Feature(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAssignment_Feature feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Assignment_Feature", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeAssignment_Operator(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAssignment_Operator feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeAssignment_Terminal(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAssignment_Terminal feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeAssignableAlternatives_Groups(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAssignableAlternatives_Groups feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeCrossReference_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCrossReference_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeCrossReference_Terminal(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCrossReference_Terminal feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeCrossReferenceableAlternatives_Groups(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCrossReferenceableAlternatives_Groups feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeTerminalRule_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTerminalRule_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "TerminalRule_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeTerminalRule_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTerminalRule_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeTerminalRule_Alternatives(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTerminalRule_Alternatives feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeTerminalAlternatives_Groups(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTerminalAlternatives_Groups feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeTerminalGroup_Tokens(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTerminalGroup_Tokens feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeTerminalToken_Cardinality(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTerminalToken_Cardinality feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeNegatedToken_Terminal(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeNegatedToken_Terminal feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeUntilToken_Terminal(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeUntilToken_Terminal feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeCharacterRange_Right(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCharacterRange_Right feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEnumRule_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEnumRule_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "EnumRule_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeEnumRule_Type(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEnumRule_Type feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEnumRule_Alternatives(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEnumRule_Alternatives feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEnumLiterals_Groups(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEnumLiterals_Groups feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeEnumLiteralDeclaration_EnumLiteral(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEnumLiteralDeclaration_EnumLiteral feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeEnumLiteralDeclaration_Literal(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEnumLiteralDeclaration_Literal feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeGrammar(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGrammar '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEcore_EString(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEcore_EString '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAbstractRule(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAbstractRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAbstractMetamodelDeclaration(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAbstractMetamodelDeclaration '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeGeneratedMetamodel(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeGeneratedMetamodel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeReferencedMetamodel(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeReferencedMetamodel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeParserRule(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeParserRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeTypeRef(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTypeRef '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAbstractElement(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAbstractElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAction(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAction '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeKeyword(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKeyword '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeRuleCall(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeRuleCall '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAssignment(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAssignment '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeCrossReference(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeCrossReference '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeTerminalRule(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeTerminalRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAbstractNegatedToken(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAbstractNegatedToken '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeNegatedToken(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeNegatedToken '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeUntilToken(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeUntilToken '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeWildcard(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeWildcard '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEnumRule(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEnumRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeEnumLiteralDeclaration(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeEnumLiteralDeclaration '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageProposalProvider.java
new file mode 100644
index 0000000..f041263
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageProposalProvider.java
@@ -0,0 +1,63 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractEnumRulesTestLanguageProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractEnumRulesTestLanguageProposalProvider.class);
+
+ public void completeModel_Existing(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Existing feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeModel_Generated(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Generated feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_Model(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Model '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_ExistingEnum(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_ExistingEnum '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_GeneratedEnum(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_GeneratedEnum '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java
index e6ed2a7..e875a72 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractEnumRulesTestLanguageUiModule extends DefaultUIMod
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.enumrules.EnumRulesTestLanguageProposalProvider.class;
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.java
deleted file mode 100644
index 8799901..0000000
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.enumrules;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenEnumRulesTestLanguageProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeModel_Existing(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel_Existing feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeModel_Generated(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel_Generated feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
-
- public List<? extends ICompletionProposal> completeModel(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageProposalProvider.java
new file mode 100644
index 0000000..a333faf
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageProposalProvider.java
@@ -0,0 +1,65 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractKeywordsTestLanguageProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractKeywordsTestLanguageProposalProvider.class);
+
+ public void completeModel_First(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_First feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeModel_Second(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Second feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeModel_Third(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Third feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void completeModel_Forth(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Forth feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+
+ public void complete_Model(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Model '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java
index 071b849..3d8d9d9 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractKeywordsTestLanguageUiModule extends DefaultUIModu
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.parser.keywords.KeywordsTestLanguageProposalProvider.class;
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.java
deleted file mode 100644
index 4ec0fdf..0000000
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.parser.keywords;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenKeywordsTestLanguageProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeModel_First(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel_First feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeModel_Second(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel_Second feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeModel_Third(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel_Third feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeModel_Forth(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel_Forth feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeModel(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageProposalProvider.java
new file mode 100644
index 0000000..1d34117
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageProposalProvider.java
@@ -0,0 +1,109 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.testlanguages;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractContentAssistTestLanguageProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractContentAssistTestLanguageProposalProvider.class);
+
+ public void completeStart_Rules(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeStart_Rules feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFirstAbstractRuleChild_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFirstAbstractRuleChild_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFirstAbstractRuleChild_Elements(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFirstAbstractRuleChild_Elements feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSecondAbstractRuleChild_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSecondAbstractRuleChild_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSecondAbstractRuleChild_Rule(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSecondAbstractRuleChild_Rule feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAbstractRuleCall_Rule(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAbstractRuleCall_Rule feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_Start(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Start '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AbstractRule(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AbstractRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_FirstAbstractRuleChild(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_FirstAbstractRuleChild '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_SecondAbstractRuleChild(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_SecondAbstractRuleChild '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AbstractRuleCall(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AbstractRuleCall '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageUiModule.java
index 547e322..4764e87 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageUiModule.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractContentAssistTestLanguageUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractContentAssistTestLanguageUiModule extends DefaultU
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.testlanguages.ContentAssistTestLanguageProposalProvider.class;
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageProposalProvider.java
new file mode 100644
index 0000000..b365e5b
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageProposalProvider.java
@@ -0,0 +1,205 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.testlanguages;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractReferenceGrammarTestLanguageProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractReferenceGrammarTestLanguageProposalProvider.class);
+
+ public void completeSpielplatz_Groesse(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Groesse feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Beschreibung(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Beschreibung feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Kinder(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Kinder feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Erzieher(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Erzieher feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Spielzeuge(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Spielzeuge feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielplatz_Familie(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielplatz_Familie feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeKind_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeKind_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeKind_Age(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeKind_Age feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeErwachsener_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeErwachsener_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeErwachsener_Age(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeErwachsener_Age feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielzeug_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielzeug_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeSpielzeug_Farbe(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSpielzeug_Farbe feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFamilie_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFamilie_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getGroups().get(1)), context, acceptor);
+ completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getGroups().get(2)), context, acceptor);
+ }
+ public void completeFamilie_Mutter(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFamilie_Mutter feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFamilie_Vater(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFamilie_Vater feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeFamilie_Kinder(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeFamilie_Kinder feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_Spielplatz(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Spielplatz '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Person(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Person '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Kind(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Kind '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Erwachsener(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Erwachsener '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Spielzeug(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Spielzeug '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Farbe(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Farbe '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Familie(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Familie '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageUiModule.java
index 5064f4c..93829c1 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageUiModule.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractReferenceGrammarTestLanguageUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractReferenceGrammarTestLanguageUiModule extends Defau
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.testlanguages.ReferenceGrammarTestLanguageProposalProvider.class;
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageProposalProvider.java
new file mode 100644
index 0000000..1db3f2b
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageProposalProvider.java
@@ -0,0 +1,72 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.testlanguages;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractTreeTestLanguageProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractTreeTestLanguageProposalProvider.class);
+
+ public void completeModel_Children(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Children feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeNode_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeNode_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeNode_Attrib(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeNode_Attrib feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeNode_Children(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeNode_Children feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_Model(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Model '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_Node(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_Node '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageUiModule.java
index f444635..fb5fcb4 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageUiModule.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractTreeTestLanguageUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractTreeTestLanguageUiModule extends DefaultUIModule {
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.testlanguages.TreeTestLanguageProposalProvider.class;
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenContentAssistTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenContentAssistTestLanguageProposalProvider.java
deleted file mode 100644
index 954e6bf..0000000
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenContentAssistTestLanguageProposalProvider.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.testlanguages;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenContentAssistTestLanguageProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeStart_Rules(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeStart_Rules feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeFirstAbstractRuleChild_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFirstAbstractRuleChild_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "FirstAbstractRuleChild_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeFirstAbstractRuleChild_Elements(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFirstAbstractRuleChild_Elements feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSecondAbstractRuleChild_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSecondAbstractRuleChild_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "SecondAbstractRuleChild_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSecondAbstractRuleChild_Rule(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSecondAbstractRuleChild_Rule feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeAbstractRuleCall_Rule(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAbstractRuleCall_Rule feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeStart(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeStart '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAbstractRule(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAbstractRule '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeFirstAbstractRuleChild(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFirstAbstractRuleChild '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeSecondAbstractRuleChild(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSecondAbstractRuleChild '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAbstractRuleCall(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAbstractRuleCall '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageProposalProvider.java
deleted file mode 100644
index 0892f86..0000000
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageProposalProvider.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.testlanguages;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenReferenceGrammarTestLanguageProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeSpielplatz_Groesse(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Groesse feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Beschreibung(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Beschreibung feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"Spielplatz_Beschreibung\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Kinder(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Kinder feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Erzieher(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Erzieher feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Spielzeuge(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Spielzeuge feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeSpielplatz_Familie(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz_Familie feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeKind_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKind_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Kind_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeKind_Age(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKind_Age feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeErwachsener_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeErwachsener_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Erwachsener_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeErwachsener_Age(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeErwachsener_Age feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielzeug_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielzeug_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Spielzeug_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeSpielzeug_Farbe(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielzeug_Farbe feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeFamilie_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeFamilie_Mutter(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie_Mutter feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeFamilie_Vater(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie_Vater feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeFamilie_Kinder(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie_Kinder feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
-
- public List<? extends ICompletionProposal> completeSpielplatz(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielplatz '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completePerson(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completePerson '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeKind(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeKind '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeErwachsener(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeErwachsener '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeSpielzeug(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeSpielzeug '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeFarbe(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFarbe '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeFamilie(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeFamilie '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenTreeTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenTreeTestLanguageProposalProvider.java
deleted file mode 100644
index e3704d9..0000000
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenTreeTestLanguageProposalProvider.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.testlanguages;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenTreeTestLanguageProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeModel_Children(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel_Children feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeNode_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeNode_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "Node_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeNode_Attrib(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeNode_Attrib feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "\"Node_Attrib\"", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeNode_Children(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeNode_Children feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeModel(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeModel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeNode(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeNode '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageProposalProvider.java
new file mode 100644
index 0000000..f89fb69
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageProposalProvider.java
@@ -0,0 +1,64 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.common.TerminalsProposalProvider;
+import org.eclipse.xtext.ui.core.editor.contentassist.ICompletionProposalAcceptor;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Methods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ */
+public class AbstractTwoContextsTestLanguageProposalProvider extends TerminalsProposalProvider {
+
+ private final static Logger logger = Logger.getLogger(AbstractTwoContextsTestLanguageProposalProvider.class);
+
+ public void completeMainModel_Elements(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeMainModel_Elements feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAnElement_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAnElement_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
+ }
+ public void completeAnElement_Referred(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeAnElement_Referred feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + context.getPrefix() + "'");
+ }
+ lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
+ }
+
+ public void complete_MainModel(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_MainModel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+ public void complete_AnElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete_AnElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + context.getCurrentModel() + "' and prefix '" + context.getPrefix() + "'");
+ }
+ // subclasses may override
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageUiModule.java
index 5b8cfae..e4d2244 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageUiModule.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractTwoContextsTestLanguageUiModule.java
@@ -28,7 +28,7 @@ public abstract class AbstractTwoContextsTestLanguageUiModule extends DefaultUIM
}
- public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ public Class<? extends org.eclipse.xtext.ui.core.editor.contentassist.IContentProposalProvider> bindIContentProposalProvider() {
return org.eclipse.xtext.ui.common.editor.contentassist.impl.TwoContextsTestLanguageProposalProvider.class;
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/GenTwoContextsTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/GenTwoContextsTestLanguageProposalProvider.java
deleted file mode 100644
index cf9ab6e..0000000
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/editor/contentassist/impl/GenTwoContextsTestLanguageProposalProvider.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import java.util.Collections;
-import java.util.List;
-
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.xtext.Assignment;
-import org.eclipse.xtext.CrossReference;
-import org.eclipse.xtext.RuleCall;
-import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
-
-/**
- * Represents a generated, default implementation of interface {@link IProposalProvider}.
- * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
- * with a more concrete subtype.
- *
- * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
- */
-public class GenTwoContextsTestLanguageProposalProvider extends AbstractJavaProposalProvider {
-
- public List<? extends ICompletionProposal> completeMainModel_Elements(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeMainModel_Elements feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.emptyList();
- }
-
- public List<? extends ICompletionProposal> completeAnElement_Name(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAnElement_Name feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return Collections.singletonList(createCompletionProposal(assignment, "AnElement_Name", contentAssistContext));
- }
-
- public List<? extends ICompletionProposal> completeAnElement_Referred(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAnElement_Referred feature '" + assignment.getFeature() + "' terminal '"
- + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
- + contentAssistContext.getMatchString().trim() + "'");
- }
- return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
- }
-
- public List<? extends ICompletionProposal> completeMainModel(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeMainModel '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
- public List<? extends ICompletionProposal> completeAnElement(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
- if (logger.isDebugEnabled()) {
- logger.debug("completeAnElement '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
- + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
- }
- return Collections.emptyList();
- }
-}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/XtextGrammarTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/XtextGrammarTestLanguageProposalProvider.java
index 8113e91..032c799 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/XtextGrammarTestLanguageProposalProvider.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/XtextGrammarTestLanguageProposalProvider.java
@@ -1,6 +1,6 @@
package org.eclipse.xtext;
-public class XtextGrammarTestLanguageProposalProvider extends org.eclipse.xtext.GenXtextGrammarTestLanguageProposalProvider {
+public class XtextGrammarTestLanguageProposalProvider extends org.eclipse.xtext.AbstractXtextGrammarTestLanguageProposalProvider {
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java
index 0f9a102..d9640db 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java
@@ -1,6 +1,6 @@
package org.eclipse.xtext.enumrules;
-public class EnumRulesTestLanguageProposalProvider extends org.eclipse.xtext.enumrules.GenEnumRulesTestLanguageProposalProvider {
+public class EnumRulesTestLanguageProposalProvider extends org.eclipse.xtext.enumrules.AbstractEnumRulesTestLanguageProposalProvider {
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageProposalProvider.java
index feae984..2d279d2 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageProposalProvider.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageProposalProvider.java
@@ -1,6 +1,6 @@
package org.eclipse.xtext.parser.keywords;
-public class KeywordsTestLanguageProposalProvider extends org.eclipse.xtext.parser.keywords.GenKeywordsTestLanguageProposalProvider {
+public class KeywordsTestLanguageProposalProvider extends org.eclipse.xtext.parser.keywords.AbstractKeywordsTestLanguageProposalProvider {
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ContentAssistTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ContentAssistTestLanguageProposalProvider.java
index 8e969a0..92223ec 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ContentAssistTestLanguageProposalProvider.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ContentAssistTestLanguageProposalProvider.java
@@ -1,6 +1,6 @@
package org.eclipse.xtext.testlanguages;
-public class ContentAssistTestLanguageProposalProvider extends org.eclipse.xtext.testlanguages.GenContentAssistTestLanguageProposalProvider {
+public class ContentAssistTestLanguageProposalProvider extends org.eclipse.xtext.testlanguages.AbstractContentAssistTestLanguageProposalProvider {
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ReferenceGrammarTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ReferenceGrammarTestLanguageProposalProvider.java
index 144e29f..a8d0a83 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ReferenceGrammarTestLanguageProposalProvider.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/ReferenceGrammarTestLanguageProposalProvider.java
@@ -1,6 +1,6 @@
package org.eclipse.xtext.testlanguages;
-public class ReferenceGrammarTestLanguageProposalProvider extends org.eclipse.xtext.testlanguages.GenReferenceGrammarTestLanguageProposalProvider {
+public class ReferenceGrammarTestLanguageProposalProvider extends org.eclipse.xtext.testlanguages.AbstractReferenceGrammarTestLanguageProposalProvider {
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/TreeTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/TreeTestLanguageProposalProvider.java
index d320b36..254655e 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/TreeTestLanguageProposalProvider.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/testlanguages/TreeTestLanguageProposalProvider.java
@@ -1,6 +1,6 @@
package org.eclipse.xtext.testlanguages;
-public class TreeTestLanguageProposalProvider extends org.eclipse.xtext.testlanguages.GenTreeTestLanguageProposalProvider {
+public class TreeTestLanguageProposalProvider extends org.eclipse.xtext.testlanguages.AbstractTreeTestLanguageProposalProvider {
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentAssistProcessorTest.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentAssistProcessorTest.java
index 3a22dc6..b3c4e56 100755
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentAssistProcessorTest.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/AbstractContentAssistProcessorTest.java
@@ -54,31 +54,31 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
public void testComputeCompletionProposalsCount() throws Exception {
newBuilder(setup.getRefGrammarSetup()).assertCount(1)
.append("spielplatz ").assertCount(1)
- .append("1 ").assertCount(2)
+ .append("1 ").assertCount(3)
.append("\"JUNIT\" ").assertCount(1)
.append("{ ").assertCount(5)
.append("kind ").assertCount(1)
.append("(k1 0) erwachsener(e1 0) erwachsener(e2 0) familie( f1 ").assertCount(2)
.append("e1 ").assertCount(2)
- .append("e2").assertCount(1);
+ .append("e2").assertCount(2);
}
public void testComputeCompletionProposalsText() throws Exception {
newBuilder(setup.getRefGrammarSetup()).assertText("spielplatz")
- .applyText().assertText("1")
- .applyText().assertText("\"Spielplatz_Beschreibung\"","{")
+ .applyText().assertText("1 - Groesse")
+ .applyText().assertText("\"Beschreibung\"", "'Beschreibung'", "{")
.applyText().assertText("{")
.applyText().assertText("erwachsener", "familie", "spielzeug", "kind", "}")
.append("erwachsener ").assertText("(")
- .applyText().assertText("Erwachsener_Name")
- .append("e1 ").assertText("1")
+ .applyText().assertText("Name")
+ .append("e1 ").assertText("1 - Age")
.applyText().assertText(")")
.applyText().append("erwachsener (e2 0) kind ").assertText("(")
- .applyText().assertText("Kind_Name")
- .append("k1 ").assertText("1")
+ .applyText().assertText("Name")
+ .append("k1 ").assertText("1 - Age")
.applyText().assertText(")")
.applyText().append("kind (k2 0) familie ").assertText("(")
- .applyText().assertText("keyword")
+ .applyText().assertText("keyword", "'Name'", "\"Name\"", "Name")
.append("keyword ").assertText("e1","e2")
.applyText().assertText("e1","e2")
.append("e2 ").assertText("k1","k2")
@@ -86,14 +86,12 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
.append("1 ").assertText(",",")")
.append("k2 ").assertText(",",")")
;
-
-
}
public void testBetweenContext() throws Exception {
newBuilder(setup.getRefGrammarSetup())
.append("spielplatz 1 \"1\" {kind")
- .assertTextAtCursorPosition(18,"kind","erwachsener","spielzeug","familie","}");
+ .assertTextAtCursorPosition(18,"kind","erwachsener","spielzeug","familie","{", "}");
}
public void testComputeCompletionProposalsIgnoreCase() throws Exception {
@@ -103,13 +101,13 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
builder.append(" ER").assertText("erwachsener");
builder.append(" SP").assertText("spielzeug");
builder.append(" FA").assertText("familie");
- builder.append(" familie ( KEY").assertText("keyword","e1","e2");
- builder.append(" familie ( K").assertText("keyword","e1","e2");
+ builder.append(" familie ( KEY").assertText("keyword", "e1", "e2");
+ builder.append(" familie ( K").assertText("keyword", "e1", "e2");
builder.append(" familie ( keyword E").assertText("e1", "e2");
- builder.append(" familie ( keyword e1 E").assertText("e1", "e2","k1","k2");
+ builder.append(" familie ( keyword e1 E").assertText("e1", "e2", "k1", "k2");
builder.append(" familie ( keyword e1 e2 K").assertText("k1", "k2", ",", ")");
builder.append(" familie ( keyword e1 e2 k1,K").assertText("k1", "k2",",", ")");
- builder.append(" familie ( keyword e1 e2 k1,k2").assertText(",", ")");
+ builder.append(" familie ( keyword e1 e2 k1,k2").assertText("k2", ",", ")");
}
/**
@@ -156,9 +154,11 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
"R1",
"R2",
"R3",
- "\"Keyword_Value\"",
+ "\"Value\"",
+ "'Value'",
"(",
- "["
+ "[",
+ "+=" // current node is always a suggestion
);
}
@@ -168,7 +168,8 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
.appendNl("R1 ();")
.append("R2 rule :").assertText(
"R1",
- "R2"
+ "R2",
+ ":" // current is always a suggestion
);
}
@@ -188,7 +189,7 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
.appendNl("grammar foo")
.appendNl("generate foo \"foo\"")
.appendNl("MyRule : 'foo' name=ID; ").assertText(
- "ParserRule_Name", "terminal", "enum"
+ "Name", "terminal", "enum"
);
}
@@ -199,7 +200,7 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
.appendNl("")
.appendNl("MyRule : 'foo' name=ID; ")
.assertTextAtCursorPosition("MyRule",
- "ParserRule_Name",
+ "Name",
"terminal",
"enum",
"as",
@@ -214,7 +215,7 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
.appendNl("")
.appendNl(" MyRule : 'foo' name=ID; ")
.assertTextAtCursorPosition(" MyRule",
- "ParserRule_Name",
+ "Name",
"terminal",
"enum",
"as",
@@ -240,7 +241,7 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
.appendNl("R1 : (attr+=R2)*;")
.appendNl("R2 : (attr=INT)? prop=R3;")
.assertTextAtCursorPosition("R1",
- "ParserRule_Name",
+ "Name",
"as",
"generate",
"import",
@@ -262,7 +263,8 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
"R1",
"R2",
"R3",
- "\"Keyword_Value\"",
+ "\"Value\"",
+ "'Value'",
"(",
"["
);
@@ -303,8 +305,20 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
newBuilder(setup.getXtextGrammarTestSetup())
.appendNl("grammar foo with org.eclipse.xtext.common.Terminals")
.appendNl("generate foo \"foo\"")
- .append("MyRule : 'foo' name").assertText("\"Keyword_Value\"", "(", "*", "+", "+=", ";", "=", "?", "?=",
- "Assignment_Feature", "MyRule", "{")
+ .append("MyRule : 'foo' name").assertText(
+ "\"Value\"",
+ "'Value'",
+ "(",
+ "*",
+ "+",
+ "+=",
+ ";",
+ "=",
+ "?",
+ "?=",
+ "Feature",
+ "MyRule",
+ "{")
.appendNl(";")
.append("terminal Other_Id").assertText(":","returns");
@@ -357,7 +371,7 @@ public abstract class AbstractContentAssistProcessorTest extends AbstractXtextTe
}
public void testEnumCompletion_04() throws Exception {
- newBuilder(setup.getEnumsLangSetup()).append("existing").assertText("SameName", "DifferentLiteral", "overridden");
+ newBuilder(setup.getEnumsLangSetup()).append("existing").assertText("SameName", "DifferentLiteral", "overridden", "existing");
}
public void testEnumCompletion_05() throws Exception {
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java
index d7df948..8f5b42a 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java
@@ -13,29 +13,27 @@
*******************************************************************************/
package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import junit.framework.Assert;
-import org.easymock.EasyMock;
+import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.xtext.ISetup;
import org.eclipse.xtext.junit.AbstractXtextTests;
import org.eclipse.xtext.resource.XtextResource;
-import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
+import org.eclipse.xtext.ui.core.editor.contentassist.ContentAssistContext;
import org.eclipse.xtext.ui.core.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.core.editor.model.UnitOfWork;
import org.eclipse.xtext.util.StringInputStream;
@@ -50,7 +48,6 @@ import org.eclipse.xtext.util.Strings;
public class ContentAssistProcessorTestBuilder {
private final IContentAssistProcessor contentAssistProcessor;
- private final ITextViewer textViewerMock;
private String model;
private int cursorPosition;
private final ISetup setupClazz;
@@ -61,7 +58,6 @@ public class ContentAssistProcessorTestBuilder {
this.tests = tests;
tests.with(setupClazz);
this.contentAssistProcessor = tests.get(IContentAssistProcessor.class);
- this.textViewerMock = EasyMock.createMock(ITextViewer.class);
}
public ContentAssistProcessorTestBuilder reset() throws Exception {
@@ -94,7 +90,12 @@ public class ContentAssistProcessorTestBuilder {
}
public ContentAssistProcessorTestBuilder applyText(int index, boolean appendSpace) throws Exception {
- ContentAssistProcessorTestBuilder ret = append(computeCompletionProposals(getModel(), this.cursorPosition)[index].getDisplayString());
+ ICompletionProposal proposal = computeCompletionProposals(getModel(), this.cursorPosition)[index];
+ String text = proposal.getDisplayString();
+ if (proposal instanceof ConfigurableCompletionProposal) {
+ text = ((ConfigurableCompletionProposal) proposal).getReplacementString();
+ }
+ ContentAssistProcessorTestBuilder ret = append(text);
if (appendSpace) {
return ret.append(" ");
}
@@ -127,14 +128,19 @@ public class ContentAssistProcessorTestBuilder {
ICompletionProposal[] computeCompletionProposals = computeCompletionProposals(currentModelToParse,
cursorPosition);
+ if (computeCompletionProposals == null)
+ computeCompletionProposals = new ICompletionProposal[0];
+
+ String expectation = Strings.concat(", ", Arrays.asList(expectedText));
Assert.assertEquals("expect " + expectedText.length + " CompletionProposal item for model '"
- + currentModelToParse + "': expectation was:\n" + Strings.concat(", ", Arrays.asList(expectedText))
+ + currentModelToParse + "': expectation was:\n" + expectation
+ "\nbut actual was:\n" + Strings.concat(", ", toString(computeCompletionProposals)),
expectedText.length, computeCompletionProposals.length);
+
for (int i = 0; i < computeCompletionProposals.length; i++) {
ICompletionProposal completionProposal = computeCompletionProposals[i];
- Assert.assertTrue("expect completionProposal text '" + completionProposal.getDisplayString() + "', but got " +
+ Assert.assertTrue("expect completionProposal text '" + expectation + "', but got " +
Strings.concat(", ", toString(computeCompletionProposals)),
Arrays.asList(expectedText).contains(completionProposal.getDisplayString()));
}
@@ -145,17 +151,23 @@ public class ContentAssistProcessorTestBuilder {
public ContentAssistProcessorTestBuilder assertMatchString(String matchString)
throws Exception {
String currentModelToParse = getModel();
- final XtextResource xtextResource = tests.getResource(new StringInputStream(currentModelToParse));
- List<IContentAssistContext> contentAssistContextList = new DefaultContentAssistProcessor() {
+ ITextViewer textViewer = new MockableTextViewer() {
@Override
- public List<IContentAssistContext> createContextList(XtextResource resource, String text, final int offset) {
- return super.createContextList(xtextResource, text, offset);
+ public ISelectionProvider getSelectionProvider() {
+ return new MockableSelectionProvider() {
+ @Override
+ public ISelection getSelection() {
+ return TextSelection.emptySelection();
+ }
+ };
}
- }.createContextList(xtextResource, currentModelToParse,cursorPosition);
-
- for (IContentAssistContext contentAssistContext : contentAssistContextList) {
- Assert.assertEquals(matchString, contentAssistContext.getMatchString());
- break;
+ };
+ final XtextResource xtextResource = tests.getResource(new StringInputStream(currentModelToParse));
+ ContentAssistContext.Factory factory = tests.get(ContentAssistContext.Factory.class);
+ ContentAssistContext[] contexts = factory.create(textViewer, currentModelToParse.length(), xtextResource);
+ for(ContentAssistContext context: contexts) {
+ Assert.assertTrue("matchString = '" + matchString + "', actual: '" + context.getPrefix() + "'",
+ "".equals(context.getPrefix()) || matchString.equals(context.getPrefix()));
}
return this;
}
@@ -165,6 +177,8 @@ public class ContentAssistProcessorTestBuilder {
}
private List<String> toString(ICompletionProposal[] proposals) {
+ if (proposals == null)
+ return Collections.emptyList();
List<String> res = new ArrayList<String>(proposals.length);
for (ICompletionProposal proposal : proposals) {
res.add(proposal.getDisplayString());
@@ -227,11 +241,23 @@ public class ContentAssistProcessorTestBuilder {
}
private ITextViewer resetTextViewerMock(final String currentModelToParse, final IXtextDocument xtextDocument) {
- EasyMock.reset(textViewerMock);
- expect(textViewerMock.getDocument()).andReturn(xtextDocument);
- expect(textViewerMock.getTextWidget()).andReturn(newStyledTextWidgetMock(currentModelToParse)).times(2);
- replay(textViewerMock);
- return textViewerMock;
+ ITextViewer result = new MockableTextViewer() {
+ @Override
+ public IDocument getDocument() {
+ return xtextDocument;
+ }
+
+ @Override
+ public ISelectionProvider getSelectionProvider() {
+ return new MockableSelectionProvider() {
+ @Override
+ public ISelection getSelection() {
+ return TextSelection.emptySelection();
+ }
+ };
+ }
+ };
+ return result;
}
private ContentAssistProcessorTestBuilder clone(String model, int offset) throws Exception {
@@ -241,25 +267,6 @@ public class ContentAssistProcessorTestBuilder {
return builder;
}
- private StyledText newStyledTextWidgetMock(final String testDslModel) {
- return new StyledText(new Shell(), SWT.NONE) {
- @Override
- public int getCharCount() {
- return testDslModel.length();
- }
-
- @Override
- public String getText(int start, int end) {
- return testDslModel.substring(start, end + 1);
- }
-
- @Override
- public String getText() {
- return testDslModel;
- }
- };
- }
-
public <T> T get(Class<T> clazz) {
return tests.get(clazz);
}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java
deleted file mode 100644
index 73fc713..0000000
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DynamicDispatchTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.eclipse.xtext.ui.common.editor.contentassist.impl;
-
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-
-public class DynamicDispatchTest extends TestCase{
-
- private static final String FOO = "foo";
- private static final List<ICompletionProposal> STRING = Arrays.<ICompletionProposal>asList(new CompletionProposal());
- private static final List<ICompletionProposal> OBJECT = Arrays.<ICompletionProposal>asList(new CompletionProposal());
-
- private static final List<Class<?>> objectType = Arrays.<Class<?>>asList(Object.class);
- private static final List<Class<?>> stringType = Arrays.<Class<?>>asList(String.class);
-
- private static final List<Object> object = Arrays.asList(new Object());
- private static final List<String> string = Arrays.asList("dummdidumm");
-
- public void testDynamicDispatch() throws Exception {
- JavaReflectiveMethodInvoker invoker = new JavaReflectiveMethodInvoker(new Example1());
- assertEquals(OBJECT, invoker.invoke(FOO, objectType, object));
- assertEquals(STRING, invoker.invoke(FOO, stringType, string));
- JavaReflectiveMethodInvoker invoker1 = new JavaReflectiveMethodInvoker(new Example2());
- assertEquals(OBJECT, invoker1.invoke(FOO, objectType, object));
- assertEquals(STRING, invoker1.invoke(FOO, stringType, string));
- }
-
- private class Example1 {
- @SuppressWarnings("unused")
- private List<ICompletionProposal> foo(Object o) {
- return OBJECT;
- }
-
- @SuppressWarnings("unused")
- protected List<ICompletionProposal> foo(String s) {
- return STRING;
- }
- }
-
- class Example2 {
- public List<ICompletionProposal> foo(String s) {
- return STRING;
- }
-
- List<ICompletionProposal> foo(Object o) {
- return OBJECT;
- }
- }
-
- static class CompletionProposal implements ICompletionProposal {
-
- public void apply(IDocument document) {
- }
-
- public String getAdditionalProposalInfo() {
- return null;
- }
-
- public IContextInformation getContextInformation() {
- return null;
- }
-
- public String getDisplayString() {
- return null;
- }
-
- public Image getImage() {
- return null;
- }
-
- public Point getSelection(IDocument document) {
- return null;
- }
-
- }
-}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/MockableSelectionProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/MockableSelectionProvider.java
new file mode 100644
index 0000000..af7a0b8
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/MockableSelectionProvider.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class MockableSelectionProvider implements ISelectionProvider {
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public ISelection getSelection() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setSelection(ISelection selection) {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/MockableTextViewer.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/MockableTextViewer.java
new file mode 100644
index 0000000..d3e6eea
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/MockableTextViewer.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.ui.common.editor.contentassist.impl;
+
+import org.eclipse.jface.text.IAutoIndentStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IEventConsumer;
+import org.eclipse.jface.text.IFindReplaceTarget;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextInputListener;
+import org.eclipse.jface.text.ITextListener;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.IUndoManager;
+import org.eclipse.jface.text.IViewportListener;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Point;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+@SuppressWarnings("deprecation")
+public class MockableTextViewer implements ITextViewer {
+
+ public void activatePlugins() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addTextInputListener(ITextInputListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addTextListener(ITextListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addViewportListener(IViewportListener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void changeTextPresentation(TextPresentation presentation, boolean controlRedraw) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int getBottomIndex() {
+ throw new UnsupportedOperationException();
+ }
+
+ public int getBottomIndexEndOffset() {
+ throw new UnsupportedOperationException();
+ }
+
+ public IDocument getDocument() {
+ throw new UnsupportedOperationException();
+ }
+
+ public IFindReplaceTarget getFindReplaceTarget() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Point getSelectedRange() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ISelectionProvider getSelectionProvider() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ITextOperationTarget getTextOperationTarget() {
+ throw new UnsupportedOperationException();
+ }