Search in sources :

Example 26 with OutputTable

use of org.talend.designer.mapper.model.table.OutputTable in project tdi-studio-se by Talend.

the class OutputDataMapTableView method refreshCondensedImage.

@Override
protected void refreshCondensedImage(AbstractInOutTable absTable, String option) {
    OutputTable table = (OutputTable) absTable;
    if (OUTPUT_REJECT.equals(option)) {
        if (mapperManager.getDefaultSetting().get(OUTPUT_REJECT).equals(table.isReject())) {
            if (changedOptions > 0) {
                changedOptions--;
            }
        } else {
            if (changedOptions < 6) {
                changedOptions++;
            }
        }
    } else if (LOOK_UP_INNER_JOIN_REJECT.equals(option)) {
        if (mapperManager.getDefaultSetting().get(LOOK_UP_INNER_JOIN_REJECT).equals(table.isRejectInnerJoin())) {
            if (changedOptions > 0) {
                changedOptions--;
            }
        } else {
            if (changedOptions < 6) {
                changedOptions++;
            }
        }
    } else if (SCHEMA_TYPE.equals(option)) {
        if (mapperManager.getDefaultSetting().get(SCHEMA_TYPE).equals(table.isRepository())) {
            if (changedOptions > 0) {
                changedOptions--;
            }
        } else {
            if (changedOptions < 6) {
                changedOptions++;
            }
        }
    } else if (SCHEMA_ID.equals(option)) {
        if (mapperManager.getDefaultSetting().get(SCHEMA_ID) == table.getId()) {
            if (changedOptions > 0) {
                changedOptions--;
            }
        } else {
            if (changedOptions < 6) {
                changedOptions++;
            }
        }
    }
    condensedItem.setImage(ImageProviderMapper.getImage(getCondencedItemImage(changedOptions)));
}
Also used : OutputTable(org.talend.designer.mapper.model.table.OutputTable)

Example 27 with OutputTable

use of org.talend.designer.mapper.model.table.OutputTable in project tdi-studio-se by Talend.

the class UIManager method removeOutputTableView.

/**
     * Call mapperManager.removeSelectedOutput() to remove a table view.
     * 
     * @param dataMapTableViewToRemove
     */
public void removeOutputTableView(DataMapTableView dataMapTableViewToRemove) {
    List<DataMapTableView> outputsTablesView = mapperManager.getUiManager().getOutputsTablesView();
    int sizeList = outputsTablesView.size();
    for (int i = 0; i < sizeList; i++) {
        Control control = outputsTablesView.get(i);
        if (control == dataMapTableViewToRemove && i < sizeList - 1 && i > 0) {
            FormData formData = (FormData) outputsTablesView.get(i + 1).getLayoutData();
            formData.top = new FormAttachment(outputsTablesView.get(i - 1));
            break;
        }
    }
    mapperManager.removeTablePair(dataMapTableViewToRemove);
    MetadataTableEditorView outputMetaEditorView = getOutputMetaEditorView();
    if (outputMetaEditorView.getMetadataTableEditor() != null && outputMetaEditorView.getMetadataTableEditor().getMetadataTable() == ((OutputTable) dataMapTableViewToRemove.getDataMapTable()).getMetadataTable()) {
        getOutputMetaEditorView().setMetadataTableEditor(null);
    }
    dataMapTableViewToRemove.dispose();
    dataMapTableViewToRemove = null;
    getTablesZoneViewOutputs().layout();
    refreshBackground(true, false);
    this.currentSelectedOutputTableView = null;
}
Also used : FormData(org.eclipse.swt.layout.FormData) Control(org.eclipse.swt.widgets.Control) InputDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.InputDataMapTableView) OutputDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.OutputDataMapTableView) VarsDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.VarsDataMapTableView) DataMapTableView(org.talend.designer.mapper.ui.visualmap.table.DataMapTableView) AbstractMetadataTableEditorView(org.talend.core.ui.metadata.editor.AbstractMetadataTableEditorView) MetadataTableEditorView(org.talend.core.ui.metadata.editor.MetadataTableEditorView) Point(org.eclipse.swt.graphics.Point) FormAttachment(org.eclipse.swt.layout.FormAttachment) OutputTable(org.talend.designer.mapper.model.table.OutputTable)

Example 28 with OutputTable

use of org.talend.designer.mapper.model.table.OutputTable in project tdi-studio-se by Talend.

the class UIManager method updateToolbarButtonsStates.

/**
     * DOC amaumont Comment method "updateToolbarButtonsStates".
     * 
     * @param currentZone
     */
public void updateToolbarButtonsStates(Zone currentZone) {
    ToolbarZone toolbar = null;
    if (currentZone == Zone.INPUTS) {
        toolbar = getInputsZone().getToolbar();
        toolbar.setEnabledMinimizeTablesButton(mapperManager.getUiManager().getInputsTablesView().size() > 0);
    } else if (currentZone == Zone.OUTPUTS) {
        toolbar = getOutputsZone().getToolbar();
        ((ToolbarOutputZone) toolbar).setEnabledRemoveTableButton(currentSelectedOutputTableView != null && currentSelectedOutputTableView.getDataMapTable() instanceof OutputTable && !((OutputTable) currentSelectedOutputTableView.getDataMapTable()).isErrorRejectTable());
        toolbar.setEnabledMinimizeTablesButton(mapperManager.getUiManager().getOutputsTablesView().size() > 0);
    }
    toolbar.setEnabledMoveTableButton(true, isTableViewMoveable(currentZone, true));
    toolbar.setEnabledMoveTableButton(false, isTableViewMoveable(currentZone, false));
}
Also used : ToolbarZone(org.talend.designer.mapper.ui.visualmap.zone.toolbar.ToolbarZone) OutputTable(org.talend.designer.mapper.model.table.OutputTable)

Example 29 with OutputTable

use of org.talend.designer.mapper.model.table.OutputTable in project tdi-studio-se by Talend.

the class MapperManager method replacePreviousLocationInAllExpressions.

/**
     * DOC amaumont Comment method "replacePreviousLocationInAllExpressions".
     */
public void replacePreviousLocationInAllExpressions(final TableEntryLocation previousLocation, final TableEntryLocation newLocation) {
    DataMapExpressionParser dataMapExpressionParser = new DataMapExpressionParser(LanguageProvider.getCurrentLanguage());
    Collection<IDataMapTable> tablesData = getTablesData();
    for (IDataMapTable table : tablesData) {
        List<IColumnEntry> columnEntries = table.getColumnEntries();
        if (table instanceof AbstractInOutTable) {
            replaceLocation(previousLocation, newLocation, dataMapExpressionParser, table, ((AbstractInOutTable) table).getExpressionFilter());
        }
        for (IColumnEntry entry : columnEntries) {
            replaceLocation(previousLocation, newLocation, dataMapExpressionParser, table, entry);
        }
        if (table instanceof OutputTable) {
            List<FilterTableEntry> constraintEntries = ((OutputTable) table).getFilterEntries();
            for (FilterTableEntry entry : constraintEntries) {
                replaceLocation(previousLocation, newLocation, dataMapExpressionParser, table, entry);
            }
        }
    }
    uiManager.refreshBackground(false, false);
}
Also used : DataMapExpressionParser(org.talend.designer.mapper.utils.DataMapExpressionParser) AbstractInOutTable(org.talend.designer.mapper.model.table.AbstractInOutTable) FilterTableEntry(org.talend.designer.mapper.model.tableentry.FilterTableEntry) IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) IColumnEntry(org.talend.designer.abstractmap.model.tableentry.IColumnEntry) OutputTable(org.talend.designer.mapper.model.table.OutputTable)

Example 30 with OutputTable

use of org.talend.designer.mapper.model.table.OutputTable in project tdi-studio-se by Talend.

the class TableManager method addTable.

/**
     * DOC amaumont Comment method "addTable".
     * 
     * @param view
     * @param tableData
     */
//$NON-NLS-1$
@SuppressWarnings("unchecked")
void addTable(DataMapTableView view, IDataMapTable tableData) {
    if (tableData instanceof AbstractInOutTable) {
        AbstractInOutTable data = (AbstractInOutTable) tableData;
        metadataTableToAbstractDataMapTable.put(data.getMetadataTable(), data);
    }
    if (tableData.getMapperManager() != null)
        if (tableData instanceof OutputTable && ((OutputTable) tableData).isErrorRejectTable()) {
            getMatchedList(tableData).add(0, tableData);
        } else {
            getMatchedList(tableData).add(tableData);
        }
    if (view.getZone() == Zone.INPUTS || view.getZone() == Zone.OUTPUTS) {
        swtTableToView.put(view.getExpressionFilterText(), view);
        swtTableToView.put(view.getColumnNameFilterText(), view);
    }
    swtTableToView.put(view.getTableViewerCreatorForColumns().getTable(), view);
    if (view.getTableViewerCreatorForFilters() != null) {
        swtTableToView.put(view.getTableViewerCreatorForFilters().getTable(), view);
    }
    if (view.getTableViewerCreatorForGlobalMap() != null) {
        swtTableToView.put(view.getTableViewerCreatorForGlobalMap().getTable(), view);
    }
    abstractDataMapTableToView.put(tableData, view);
}
Also used : AbstractInOutTable(org.talend.designer.mapper.model.table.AbstractInOutTable) OutputTable(org.talend.designer.mapper.model.table.OutputTable)

Aggregations

OutputTable (org.talend.designer.mapper.model.table.OutputTable)30 IDataMapTable (org.talend.designer.abstractmap.model.table.IDataMapTable)11 DataMapTableView (org.talend.designer.mapper.ui.visualmap.table.DataMapTableView)10 AbstractInOutTable (org.talend.designer.mapper.model.table.AbstractInOutTable)8 IColumnEntry (org.talend.designer.abstractmap.model.tableentry.IColumnEntry)6 ArrayList (java.util.ArrayList)5 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)5 IProcess (org.talend.core.model.process.IProcess)5 InputTable (org.talend.designer.mapper.model.table.InputTable)5 FilterTableEntry (org.talend.designer.mapper.model.tableentry.FilterTableEntry)5 OutputDataMapTableView (org.talend.designer.mapper.ui.visualmap.table.OutputDataMapTableView)5 Point (org.eclipse.swt.graphics.Point)4 TableItem (org.eclipse.swt.widgets.TableItem)4 ExternalMapperTable (org.talend.designer.mapper.external.data.ExternalMapperTable)4 GlobalMapEntry (org.talend.designer.mapper.model.tableentry.GlobalMapEntry)4 InputDataMapTableView (org.talend.designer.mapper.ui.visualmap.table.InputDataMapTableView)4 VarsDataMapTableView (org.talend.designer.mapper.ui.visualmap.table.VarsDataMapTableView)4 HashMap (java.util.HashMap)3 TableViewer (org.eclipse.jface.viewers.TableViewer)3 GridData (org.eclipse.swt.layout.GridData)3