Search in sources :

Example 1 with KeyWordProposalProvider

use of org.talend.designer.dbmap.ui.proposal.expression.KeyWordProposalProvider in project tdi-studio-se by Talend.

the class DataMapTableView method initExpressionProposals.

/**
     * 
     * Init proposals of Text control, and StyledText in tab "Expression editor".
     * 
     * @param textControl
     * @param zones
     * @param tableViewerCreator
     * @param currentModifiedEntry
     */
protected void initExpressionProposals(final TextCellEditorWithProposal textCellEditor, Zone[] zones, final TableViewerCreator tableViewerCreator, ITableEntry currentModifiedEntry) {
    if (this.expressionProposalProvider == null) {
        IContentProposalProvider[] contentProposalProviders = new IContentProposalProvider[0];
        if (!MapperMain.isStandAloneMode()) {
            contentProposalProviders = new IContentProposalProvider[] { // new ProcessProposalProvider(mapperManager.getComponent().getProcess())
            new KeyWordProposalProvider("tsql", //$NON-NLS-1$ //$NON-NLS-2$
            "KEYWORD1") };
        }
        this.expressionProposalProvider = new ExpressionProposalProvider(mapperManager, contentProposalProviders);
    }
    this.expressionProposalProvider.init(abstractDataMapTable, zones, currentModifiedEntry);
    textCellEditor.setContentProposalProvider(this.expressionProposalProvider);
    StyledTextHandler styledTextHandler = mapperManager.getUiManager().getTabFolderEditors().getStyledTextHandler();
    styledTextHandler.getStyledText().setEnabled(true);
    ContentProposalAdapterExtended expressionProposalStyledText = styledTextHandler.getContentProposalAdapter();
    expressionProposalStyledText.setContentProposalProvider(this.expressionProposalProvider);
// System.out.println("init expression proposal:"+this.expressionProposal);
}
Also used : IContentProposalProvider(org.eclipse.jface.fieldassist.IContentProposalProvider) ContentProposalAdapterExtended(org.talend.commons.ui.swt.proposal.ContentProposalAdapterExtended) StyledTextHandler(org.talend.designer.dbmap.ui.tabs.StyledTextHandler) KeyWordProposalProvider(org.talend.designer.dbmap.ui.proposal.expression.KeyWordProposalProvider) ExpressionProposalProvider(org.talend.designer.dbmap.ui.proposal.expression.ExpressionProposalProvider)

Aggregations

IContentProposalProvider (org.eclipse.jface.fieldassist.IContentProposalProvider)1 ContentProposalAdapterExtended (org.talend.commons.ui.swt.proposal.ContentProposalAdapterExtended)1 ExpressionProposalProvider (org.talend.designer.dbmap.ui.proposal.expression.ExpressionProposalProvider)1 KeyWordProposalProvider (org.talend.designer.dbmap.ui.proposal.expression.KeyWordProposalProvider)1 StyledTextHandler (org.talend.designer.dbmap.ui.tabs.StyledTextHandler)1