Search in sources :

Example 1 with ExternalRowGeneratorUiProperties

use of org.talend.designer.rowgenerator.external.data.ExternalRowGeneratorUiProperties in project tdi-studio-se by Talend.

the class RowGeneratorUI method init.

/**
     * yzhang Comment method "init".
     * 
     * @param fromDialog
     */
public void init(boolean fromDialog) {
    uiManager = generatorManager.getUiManager();
    final ExternalRowGeneratorUiProperties uiProperties = uiManager.getUiProperties();
    addParentListeners(uiManager, uiProperties);
    final Display display = rowGenUIParent.getDisplay();
    GridLayout parentLayout = new GridLayout(1, true);
    rowGenUIParent.setLayout(parentLayout);
    addKeyListener(uiManager, display);
    mainSashForm = new SashForm(rowGenUIParent, SWT.SMOOTH | SWT.VERTICAL);
    GridData mainSashFormGridData = new GridData(GridData.FILL_BOTH);
    mainSashForm.setLayoutData(mainSashFormGridData);
    datasFlowViewSashForm = new SashForm(mainSashForm, SWT.SMOOTH | SWT.HORIZONTAL | SWT.BORDER);
    datasFlowViewSashForm.setLayoutData(mainSashFormGridData);
    datasFlowViewSashForm.setBackgroundMode(SWT.INHERIT_FORCE);
    initBackgroundComponents();
    // if (WindowSystem.isGTK()) {
    // datasFlowViewSashForm.setBackground(display.getSystemColor(SWT.COLOR_DARK_GRAY));
    // }
    /* Create Schema Table Editor */
    createSchemaComposite();
    /* Create the tabs */
    tabFolderEditors = new TabFolderEditors(mainSashForm, SWT.BORDER, externalNode, dataTableView);
    tabFolderEditors.setRowGeneratorUI(this);
    tabFolderEditors.getProcessPreview().refreshTablePreview(outputMetaTable.getListColumns(), null, true);
    if (!fromDialog) {
        new FooterComposite(this.rowGenUIParent, SWT.NONE, generatorManager);
    }
    dataTableView.getTable().addSelectionListener(new SelectionAdapter() {

        /*
             * (non-Java)
             * 
             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
             */
        @SuppressWarnings("unchecked")
        @Override
        public void widgetSelected(SelectionEvent e) {
            updateFunParameter((Table) e.getSource());
        }
    });
    dataTableView.getTable().addFocusListener(new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            dataTableView.getTableViewerCreator().refresh();
        }

        @Override
        public void focusLost(FocusEvent e) {
        // TODO Auto-generated method stub
        }
    });
}
Also used : TabFolderEditors(org.talend.designer.rowgenerator.ui.tabs.TabFolderEditors) Table(org.eclipse.swt.widgets.Table) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) FooterComposite(org.talend.designer.rowgenerator.ui.footer.FooterComposite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) FocusEvent(org.eclipse.swt.events.FocusEvent) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) ExternalRowGeneratorUiProperties(org.talend.designer.rowgenerator.external.data.ExternalRowGeneratorUiProperties) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FocusListener(org.eclipse.swt.events.FocusListener) Display(org.eclipse.swt.widgets.Display)

Aggregations

SashForm (org.eclipse.swt.custom.SashForm)1 FocusEvent (org.eclipse.swt.events.FocusEvent)1 FocusListener (org.eclipse.swt.events.FocusListener)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Display (org.eclipse.swt.widgets.Display)1 Table (org.eclipse.swt.widgets.Table)1 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)1 ExternalRowGeneratorUiProperties (org.talend.designer.rowgenerator.external.data.ExternalRowGeneratorUiProperties)1 FooterComposite (org.talend.designer.rowgenerator.ui.footer.FooterComposite)1 TabFolderEditors (org.talend.designer.rowgenerator.ui.tabs.TabFolderEditors)1