Search in sources :

Example 1 with UIManager

use of org.talend.designer.rowgenerator.managers.UIManager in project tdi-studio-se by Talend.

the class TabFolderEditors method getItemsByRunJob.

/**
     * qzhang Comment method "getItemsByRunJob".
     */
public List<List<String>> getItemsByRunJob(String number) {
    List<List<String>> items = new ArrayList<List<String>>();
    UIManager uiManager = generatorUI.getGeneratorManager().getUiManager();
    FunParaTableView2 editor = uiManager.getGeneratorUI().getTabFolderEditors().getParameterEditor();
    editor.notifyOkPressed();
    items = generatorUI.getGeneratorManager().getRowGeneratorComponent().getCodeGenMain().run(refreshButton, number);
    return items;
}
Also used : ArrayList(java.util.ArrayList) UIManager(org.talend.designer.rowgenerator.managers.UIManager) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with UIManager

use of org.talend.designer.rowgenerator.managers.UIManager in project tdi-studio-se by Talend.

the class RowGeneratorDialog method cancelPressed.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.dialogs.Dialog#cancelPressed()
     */
@Override
protected void cancelPressed() {
    UIManager uiManager = rowGenMain.getRowGenManager().getUiManager();
    uiManager.closeRowGenerator(SWT.CANCEL, true);
    if (uiManager.getRowGenResponse() == SWT.CANCEL) {
        rowGenMain.buildExternalData();
        super.cancelPressed();
    }
}
Also used : UIManager(org.talend.designer.rowgenerator.managers.UIManager)

Example 3 with UIManager

use of org.talend.designer.rowgenerator.managers.UIManager in project tdi-studio-se by Talend.

the class FooterComposite method createComponents.

/**
     * amaumont Comment method "createComponents".
     */
private void createComponents() {
    final UIManager uiManager = generatorManager.getUiManager();
    GridData footerCompositeGridData = new GridData(GridData.FILL_HORIZONTAL);
    this.setLayoutData(footerCompositeGridData);
    FormLayout formLayout = new FormLayout();
    this.setLayout(formLayout);
    Button okButton = new Button(this, SWT.NONE);
    //$NON-NLS-1$
    okButton.setText(Messages.getString("FooterComposite.OkButton.Text"));
    FormData okFormData = new FormData();
    Point minSize = okButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    okFormData.width = Math.max(IDialogConstants.BUTTON_WIDTH, minSize.x);
    okButton.setLayoutData(okFormData);
    okButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            FunParaTableView2 editor = uiManager.getGeneratorUI().getTabFolderEditors().getParameterEditor();
            editor.notifyOkPressed();
            uiManager.closeRowGenerator(SWT.OK, false);
        }
    });
    Button cancelButton = new Button(this, SWT.NONE);
    //$NON-NLS-1$
    cancelButton.setText(Messages.getString("FooterComposite.CancelButton.Text"));
    cancelButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            uiManager.closeRowGenerator(SWT.CANCEL, false);
        }
    });
    FormData cancelFormData = new FormData();
    minSize = cancelButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    cancelFormData.width = Math.max(IDialogConstants.BUTTON_WIDTH, minSize.x);
    cancelButton.setLayoutData(cancelFormData);
    cancelFormData.right = new FormAttachment(100, -5);
    okFormData.right = new FormAttachment(cancelButton, -5);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) FunParaTableView2(org.talend.designer.rowgenerator.ui.tabs.FunParaTableView2) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) UIManager(org.talend.designer.rowgenerator.managers.UIManager) Point(org.eclipse.swt.graphics.Point) FormAttachment(org.eclipse.swt.layout.FormAttachment) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 4 with UIManager

use of org.talend.designer.rowgenerator.managers.UIManager in project tdi-studio-se by Talend.

the class RowGeneratorDialog method okPressed.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.dialogs.Dialog#okPressed()
     */
@Override
protected void okPressed() {
    UIManager uiManager = rowGenMain.getRowGenManager().getUiManager();
    FunParaTableView2 editor = uiManager.getGeneratorUI().getTabFolderEditors().getParameterEditor();
    editor.notifyOkPressed();
    uiManager.closeRowGenerator(SWT.OK, true);
    rowGenMain.buildExternalData();
    super.okPressed();
    // bug 20749
    String componentName = "";
    IComponent iComponent = rowGenMain.getRowGenManager().getRowGeneratorComponent().getComponent();
    if (iComponent != null && iComponent instanceof IComponent) {
        componentName = iComponent.getName();
    }
    if (!"tRowGenerator".equals(componentName)) {
        // see bug 7471
        List<? extends IConnection> connection = rowGenMain.getRowGenManager().getRowGeneratorComponent().getOutgoingConnections();
        IConnection curConnection = null;
        for (IConnection conn : connection) {
            IMetadataTable metadataTable = conn.getMetadataTable();
            if (metadataTable != null) {
                String tabName = metadataTable.getTableName();
                if (tabName.equals(metadataTable.getTableName())) {
                    curConnection = conn;
                }
            }
        }
        if (curConnection != null) {
            Set<String> addedColumns = new HashSet<String>();
            changedNameColumns = rowGenMain.getGeneratorUI().getChangedNameColumns();
            for (String changedColName : changedNameColumns.keySet()) {
                String columnName = changedNameColumns.get(changedColName);
                if (preOutputColumnSet.contains(columnName)) {
                    preOutputColumnSet.remove(columnName);
                    preOutputColumnSet.add(changedColName);
                }
            }
            for (IMetadataColumn curColumn : metadataTable.getListColumns()) {
                if (!(preOutputColumnSet.contains(curColumn.getLabel()))) {
                    addedColumns.add(curColumn.getLabel());
                }
            }
            CorePlugin.getDefault().getDesignerCoreService().updateTraceColumnValues(curConnection, changedNameColumns, addedColumns);
        }
    }
}
Also used : FunParaTableView2(org.talend.designer.rowgenerator.ui.tabs.FunParaTableView2) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) IComponent(org.talend.core.model.components.IComponent) UIManager(org.talend.designer.rowgenerator.managers.UIManager) IConnection(org.talend.core.model.process.IConnection) IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn) HashSet(java.util.HashSet)

Example 5 with UIManager

use of org.talend.designer.rowgenerator.managers.UIManager in project tdi-studio-se by Talend.

the class RowGeneratorDialog method close.

@Override
public boolean close() {
    UIManager uiManager = rowGenMain.getRowGenManager().getUiManager();
    if (uiManager.getRowGenResponse() == SWT.NONE) {
        uiManager.closeRowGenerator(SWT.CANCEL, true);
        if (uiManager.getRowGenResponse() == SWT.NONE) {
            return false;
        }
        rowGenMain.buildExternalData();
    }
    boolean returnValue = super.close();
    return returnValue;
}
Also used : UIManager(org.talend.designer.rowgenerator.managers.UIManager)

Aggregations

UIManager (org.talend.designer.rowgenerator.managers.UIManager)5 FunParaTableView2 (org.talend.designer.rowgenerator.ui.tabs.FunParaTableView2)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 SelectionListener (org.eclipse.swt.events.SelectionListener)1 Point (org.eclipse.swt.graphics.Point)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 GridData (org.eclipse.swt.layout.GridData)1 Button (org.eclipse.swt.widgets.Button)1 IComponent (org.talend.core.model.components.IComponent)1 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)1 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)1 IConnection (org.talend.core.model.process.IConnection)1