Search in sources :

Example 6 with ICompletionProposalAcceptor

use of org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor in project statecharts by Yakindu.

the class STextProposalProvider method complete_BOOL.

@Override
public void complete_BOOL(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    ICompletionProposalAcceptor priorityOptimizer = getCustomAcceptor(model, "boolean", acceptor);
    for (String s : new String[] { "true", "false", "yes", "no" }) {
        ICompletionProposal proposal = createCompletionProposal(s, s + " - " + ruleCall.getRule().getName(), null, context);
        priorityOptimizer.accept(proposal);
    }
}
Also used : ICompletionProposal(org.eclipse.jface.text.contentassist.ICompletionProposal) StyledString(org.eclipse.jface.viewers.StyledString) ICompletionProposalAcceptor(org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor)

Aggregations

ICompletionProposalAcceptor (org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor)6 StyledString (org.eclipse.jface.viewers.StyledString)5 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)4 ConfigurableCompletionProposal (org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal)2 ContentAssistContext (org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext)2 CheckConstants (com.avaloq.tools.ddk.check.CheckConstants)1 CheckPackage (com.avaloq.tools.ddk.check.check.CheckPackage)1 CheckImages (com.avaloq.tools.ddk.check.ui.labeling.CheckImages)1 CheckResourceUtil (com.avaloq.tools.ddk.check.ui.util.CheckResourceUtil)1 CharMatcher (com.google.common.base.CharMatcher)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Inject (com.google.inject.Inject)1 ConcurrentModificationException (java.util.ConcurrentModificationException)1 List (java.util.List)1 Objects (java.util.Objects)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 EObject (org.eclipse.emf.ecore.EObject)1