Search in sources :

Example 1 with ContextParameterProposal

use of org.talend.core.ui.proposal.ContextParameterProposal in project tdq-studio-se by Talend.

the class TdqProposalProvider method getProposals.

public IContentProposal[] getProposals(String contents, int position) {
    List<IContentProposal> proposals = new ArrayList<IContentProposal>();
    if (this.getSupportContextEditor() != null && this.getSupportContextEditor().getContextManager() != null) {
        IContextManager contextManager = this.getSupportContextEditor().getContextManager();
        String defaultContextName = contextManager.getDefaultContext().getName();
        EList<ContextType> contexts = new BasicEList<ContextType>();
        contextManager.saveToEmf(contexts);
        List<IContextParameter> ctxParams = new JobContextManager(contexts, defaultContextName).getDefaultContext().getContextParameterList();
        for (IContextParameter ctxParam : ctxParams) {
            proposals.add(new ContextParameterProposal(ctxParam));
        }
    }
    return proposals.toArray(new IContentProposal[proposals.size()]);
}
Also used : IContentProposal(org.eclipse.jface.fieldassist.IContentProposal) ContextType(org.talend.designer.core.model.utils.emf.talendfile.ContextType) BasicEList(org.eclipse.emf.common.util.BasicEList) ContextParameterProposal(org.talend.core.ui.proposal.ContextParameterProposal) ArrayList(java.util.ArrayList) JobContextManager(org.talend.core.model.context.JobContextManager) IContextManager(org.talend.core.model.process.IContextManager) IContextParameter(org.talend.core.model.process.IContextParameter)

Aggregations

ArrayList (java.util.ArrayList)1 BasicEList (org.eclipse.emf.common.util.BasicEList)1 IContentProposal (org.eclipse.jface.fieldassist.IContentProposal)1 JobContextManager (org.talend.core.model.context.JobContextManager)1 IContextManager (org.talend.core.model.process.IContextManager)1 IContextParameter (org.talend.core.model.process.IContextParameter)1 ContextParameterProposal (org.talend.core.ui.proposal.ContextParameterProposal)1 ContextType (org.talend.designer.core.model.utils.emf.talendfile.ContextType)1