Search in sources :

Example 11 with MetadataColumn

use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.

the class CompleteDropTargetTableListener method insertOutpuEntryCopyToOtherOutput.

private void insertOutpuEntryCopyToOtherOutput(ArrayList<ITableEntry> sources, ArrayList<IMetadataColumn> metadataColumnsBeingAdded, // MetadataEditorEvent metadataEditorEvent,
ITableEntry tableEntrySource, IMetadataColumn metadataColumnDragged, String columnName) {
    MetadataColumn metadataColumn = new MetadataColumn(metadataColumnDragged);
    metadataColumn.setLabel(columnName);
    metadataColumnsBeingAdded.add(metadataColumn);
    // metadataEditorEvent.entries.add(metadataColumn);
    sources.add(tableEntrySource);
}
Also used : IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn) MetadataColumn(org.talend.core.model.metadata.MetadataColumn)

Example 12 with MetadataColumn

use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.

the class CompleteDropTargetTableListener method insertNewInOutEntryFromInputEntry.

private void insertNewInOutEntryFromInputEntry(ArrayList<ITableEntry> sources, ArrayList<IMetadataColumn> metadataColumnsBeingAdded, // MetadataEditorEvent metadataEditorEvent,
ITableEntry tableEntrySource, IMetadataColumn metadataColumnDragged, String columnName) {
    MetadataColumn metadataColumn = new MetadataColumn(metadataColumnDragged);
    metadataColumn.setLabel(columnName);
    metadataColumnsBeingAdded.add(metadataColumn);
    // metadataEditorEvent.entries.add(metadataColumn);
    sources.add(tableEntrySource);
}
Also used : IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn) MetadataColumn(org.talend.core.model.metadata.MetadataColumn)

Example 13 with MetadataColumn

use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.

the class ShadowNode method getMetadataList.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.core.model.process.INode#getMetaDataList()
     */
@Override
public List<IMetadataTable> getMetadataList() {
    List<IMetadataTable> metadataList = super.getMetadataList();
    if (metadataList != null) {
        return metadataList;
    }
    List<IMetadataTable> metadatas = new ArrayList<IMetadataTable>();
    MetadataTable metadata = new MetadataTable();
    metadata.setTableName(this.getUniqueName());
    List<IMetadataColumn> columns = new ArrayList<IMetadataColumn>();
    for (int i = 0; i < columnNumber; i++) {
        MetadataColumn col = new MetadataColumn();
        //$NON-NLS-1$
        col.setLabel("row" + i);
        //$NON-NLS-1$
        col.setTalendType("id_String");
        //$NON-NLS-1$
        col.setType("String");
        columns.add(col);
    }
    metadata.setListColumns(columns);
    metadatas.add(metadata);
    return metadatas;
}
Also used : IMetadataTable(org.talend.core.model.metadata.IMetadataTable) IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn) MetadataColumn(org.talend.core.model.metadata.MetadataColumn) ArrayList(java.util.ArrayList) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) MetadataTable(org.talend.core.model.metadata.MetadataTable) IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn)

Example 14 with MetadataColumn

use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.

the class CompleteDropTargetListener method insertNewInOutEntryFromInputEntry.

private void insertNewInOutEntryFromInputEntry(ArrayList<ITableEntry> sources, ArrayList<IMetadataColumn> metadataColumnsBeingAdded, // MetadataEditorEvent metadataEditorEvent,
ITableEntry tableEntrySource, IMetadataColumn metadataColumnDragged, String columnName) {
    MetadataColumn metadataColumn = new MetadataColumn(metadataColumnDragged);
    metadataColumn.setLabel(columnName);
    metadataColumnsBeingAdded.add(metadataColumn);
    // metadataEditorEvent.entries.add(metadataColumn);
    sources.add(tableEntrySource);
}
Also used : IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn) MetadataColumn(org.talend.core.model.metadata.MetadataColumn)

Example 15 with MetadataColumn

use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.

the class CompleteDropTargetListener method insertNewOutputEntryFromVarEntry.

private void insertNewOutputEntryFromVarEntry(ArrayList<ITableEntry> sources, ArrayList<IMetadataColumn> metadataColumnsBeingAdded, ITableEntry tableEntrySource, String columnName) {
    MetadataColumn metadataColumn = new MetadataColumn();
    metadataColumn.setLabel(columnName);
    metadataColumn.setTalendType(((VarTableEntry) tableEntrySource).getType());
    metadataColumn.setNullable(((VarTableEntry) tableEntrySource).isNullable());
    metadataColumnsBeingAdded.add(metadataColumn);
    sources.add(tableEntrySource);
}
Also used : IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn) MetadataColumn(org.talend.core.model.metadata.MetadataColumn)

Aggregations

MetadataColumn (org.talend.core.model.metadata.MetadataColumn)44 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)35 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)20 ArrayList (java.util.ArrayList)14 MetadataTable (org.talend.core.model.metadata.MetadataTable)13 Test (org.junit.Test)6 MetadataColumnExt (org.talend.designer.rowgenerator.ui.editor.MetadataColumnExt)6 IElementParameter (org.talend.core.model.process.IElementParameter)4 Node (org.talend.designer.core.ui.editor.nodes.Node)4 IComponent (org.talend.core.model.components.IComponent)3 IConnection (org.talend.core.model.process.IConnection)3 ChangeMetadataCommand (org.talend.designer.core.ui.editor.cmd.ChangeMetadataCommand)3 OutputTreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode)3 List (java.util.List)2 Schema (org.apache.avro.Schema)2 Command (org.eclipse.gef.commands.Command)2 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)2 DisposeEvent (org.eclipse.swt.events.DisposeEvent)2 DisposeListener (org.eclipse.swt.events.DisposeListener)2 Point (org.eclipse.swt.graphics.Point)2