blob: 07955ebb8d64756847d1e9b20c902fe092180f36 [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* 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
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*
* This copyright notice shows up in the generated Java code
*/
package org.eclipse.osbp.xtext.functionlibrarydsl.ui.contentassist;
import com.google.inject.Inject;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.osbp.xtext.basic.ui.BasicDSLDocumentationTranslator;
import org.eclipse.osbp.xtext.basic.ui.contentassist.BasicDSLProposalProviderHelper;
import org.eclipse.osbp.xtext.functionlibrarydsl.ui.FunctionLibraryDSLDocumentationTranslator;
import org.eclipse.osbp.xtext.functionlibrarydsl.ui.contentassist.AbstractFunctionLibraryDslProposalProvider;
import org.eclipse.xtext.Keyword;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider;
import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor;
/**
* see http://www.eclipse.org/Xtext/documentation.html#contentAssist on how to customize content assistant
*/
@SuppressWarnings("all")
public class FunctionLibraryDslProposalProvider extends AbstractFunctionLibraryDslProposalProvider {
@Inject
private TerminalsProposalProvider provider;
@Inject
private BasicDSLProposalProviderHelper providerHelper;
/**
* This override will enable 1 length non letter characters as keyword.
*/
protected boolean isKeywordWorthyToPropose(final Keyword keyword) {
return true;
}
protected StyledString getKeywordDisplayString(final Keyword keyword) {
BasicDSLDocumentationTranslator _instance = FunctionLibraryDSLDocumentationTranslator.instance();
return BasicDSLProposalProviderHelper.getKeywordDisplayString(keyword, _instance);
}
public void complete_QualifiedName(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
this.providerHelper.complete_PackageName(model, ruleCall, context, acceptor, this);
}
public void complete_ValidID(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
this.provider.complete_ID(model, ruleCall, context, acceptor);
}
}