4 package org.opendaylight.nemo.tool.eclipse.plugin.ui.contentassist.antlr;
6 import java.util.Collection;
7 import java.util.Collections;
9 import org.eclipse.xtext.AbstractRule;
10 import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser;
11 import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement;
12 import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
13 import org.eclipse.xtext.util.PolymorphicDispatcher;
16 * Template CodetemplatesGeneratorFragment.xpt
18 public class PartialEditorContentAssistParser extends EditorParser implements IPartialContentAssistParser {
20 private AbstractRule rule;
23 public void initializeFor(AbstractRule rule) {
28 protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
29 if (rule == null || rule.eIsProxy())
30 return Collections.emptyList();
31 String methodName = "entryRule" + rule.getName();
32 PolymorphicDispatcher<Collection<FollowElement>> dispatcher =
33 new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser));
35 return parser.getFollowElements();