Search in sources :

Example 1 with QueryImpl

use of org.talend.core.model.metadata.builder.connection.impl.QueryImpl in project tdi-studio-se by Talend.

the class ContextModeSessionSwitcher method createControl.

@Override
protected Control createControl(Composite parent) {
    button = new Button(parent, SWT.CHECK);
    //$NON-NLS-1$
    button.setText(Messages.getString("ContextModeSessionSwitcher.buttonText"));
    final Query query = (QueryImpl) contextmodeaction.getQuery();
    // judge from repository node
    if (query != null) {
        button.setSelection(query.isContextMode());
    // judge from designer built-in
    } else {
        button.setSelection(contextmodeaction.getParameters().getIfContextButtonCheckedFromBuiltIn());
    }
    button.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            contextmodeaction.setChecked(button.getSelection());
            contextmodeaction.getParameters().setIfContextButtonCheckedFromBuiltIn(button.getSelection());
            // judge dirty
            MultiPageSqlBuilderEditor m = editor.getMultiPageEditor();
            m.updateEditorTitle(null);
        }
    });
    return button;
}
Also used : QueryImpl(org.talend.core.model.metadata.builder.connection.impl.QueryImpl) Query(org.talend.core.model.metadata.builder.connection.Query) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) MultiPageSqlBuilderEditor(org.talend.sqlbuilder.editors.MultiPageSqlBuilderEditor)

Aggregations

SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 Button (org.eclipse.swt.widgets.Button)1 Query (org.talend.core.model.metadata.builder.connection.Query)1 QueryImpl (org.talend.core.model.metadata.builder.connection.impl.QueryImpl)1 MultiPageSqlBuilderEditor (org.talend.sqlbuilder.editors.MultiPageSqlBuilderEditor)1