Search in sources :

Example 6 with MetadataEmfTableEditorView

use of org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView in project tdi-studio-se by Talend.

the class JSONFileSchemaDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayout(new FillLayout());
    tableEditor = new MetadataEmfTableEditor("");
    MetadataTable metadataTable = form.getMetadataTable();
    tableEditor.setMetadataTable(metadataTable);
    // tableEditor.removeAll();
    List<MetadataColumn> list = (List<MetadataColumn>) form.getSchemaViewer().getInput();
    tableEditor.addAll(list);
    // if (list.size() > 0) {
    // for (MetadataColumn column : list) {
    // boolean toAdd = true;
    // for (int i = 0; i < currentColumnList.size(); i++) {
    // String label = column.getLabel();
    // String curLabel = currentColumnList.get(i).getLabel();
    // if (label.equals(curLabel)) {
    // toAdd = false;
    // break;
    // }
    // }
    // if (toAdd) {
    // tableEditor.add(column);
    // }
    // }
    // }
    tableEditorView = new MetadataEmfTableEditorView(composite, SWT.NONE);
    tableEditorView.setMetadataEditor(tableEditor);
    addListeners();
    return composite;
}
Also used : MetadataEmfTableEditorView(org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView) MetadataColumn(org.talend.core.model.metadata.builder.connection.MetadataColumn) Composite(org.eclipse.swt.widgets.Composite) MetadataEmfTableEditor(org.talend.core.ui.metadata.editor.MetadataEmfTableEditor) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) List(java.util.List) FillLayout(org.eclipse.swt.layout.FillLayout)

Aggregations

FillLayout (org.eclipse.swt.layout.FillLayout)6 Composite (org.eclipse.swt.widgets.Composite)6 MetadataEmfTableEditor (org.talend.core.ui.metadata.editor.MetadataEmfTableEditor)6 MetadataEmfTableEditorView (org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView)6 Group (org.eclipse.swt.widgets.Group)3 LabelledText (org.talend.commons.ui.swt.formtools.LabelledText)3 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)2 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)2 List (java.util.List)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Label (org.eclipse.swt.widgets.Label)1 UtilsButton (org.talend.commons.ui.swt.formtools.UtilsButton)1