Search in sources :

Example 1 with MetadataEmfTableEditorView

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

the class JSONFileOutputStep3Form method addFields.

@Override
protected void addFields() {
    Composite mainComposite = Form.startNewDimensionnedGridLayout(this, 2, WIDTH_GRIDDATA_PIXEL, 60);
    metadataNameText = new LabelledText(mainComposite, "Name");
    metadataCommentText = new LabelledText(mainComposite, "Comment");
    Group groupMetaData = Form.createGroup(this, 1, "Schema", 280);
    Composite compositeMetaData = Form.startNewGridLayout(groupMetaData, 1);
    Composite compositeTable = Form.startNewDimensionnedGridLayout(compositeMetaData, 1, WIDTH_GRIDDATA_PIXEL, 200);
    compositeTable.setLayout(new FillLayout());
    metadataEditor = new MetadataEmfTableEditor("Description of the Schema");
    tableEditorView = new MetadataEmfTableEditorView(compositeTable, SWT.NONE);
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) MetadataEmfTableEditorView(org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) MetadataEmfTableEditor(org.talend.core.ui.metadata.editor.MetadataEmfTableEditor) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 2 with MetadataEmfTableEditorView

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

the class BRMSSchemaOutputDialog method createDialogArea.

protected Control createDialogArea(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(composite);
    // Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayout(new FillLayout());
    tableEditor = new MetadataEmfTableEditor("");
    MetadataTable metadataTable = form.getMetadataOutputTable();
    tableEditor.setMetadataTable(metadataTable);
    tableEditor.removeAll();
    // List<MetadataColumn> list = (List<MetadataColumn>) metadataTable.getColumns();
    // tableEditor.addAll(list);
    // if (list.size() > 0) {
    // for (MetadataColumn column : list) {
    // boolean toAdd = true;
    // for (int i = 0; i < list.size(); i++) {
    // String label = column.getLabel();
    // String curLabel = list.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) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) MetadataEmfTableEditor(org.talend.core.ui.metadata.editor.MetadataEmfTableEditor) GridData(org.eclipse.swt.layout.GridData) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 3 with MetadataEmfTableEditorView

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

the class GenericSchemaForm method addFields.

@Override
protected void addFields() {
    Composite mainComposite = Form.startNewDimensionnedGridLayout(this, 2, WIDTH_GRIDDATA_PIXEL, 60);
    //$NON-NLS-1$
    metadataNameText = new LabelledText(mainComposite, Messages.getString("GenericSchemaForm.metadataName"));
    //$NON-NLS-1$
    metadataCommentText = new LabelledText(mainComposite, Messages.getString("GenericSchemaForm.metadataComment"));
    //$NON-NLS-1$
    Group groupMetaData = Form.createGroup(this, 1, Messages.getString("GenericSchemaForm.groupMetadata"), 280);
    Composite compositeMetaData = Form.startNewGridLayout(groupMetaData, 1);
    Composite compositeTable = Form.startNewDimensionnedGridLayout(compositeMetaData, 1, WIDTH_GRIDDATA_PIXEL, 200);
    compositeTable.setLayout(new FillLayout());
    //$NON-NLS-1$
    metadataEditor = new MetadataEmfTableEditor(Messages.getString("GenericSchemaForm.metadataDescription"));
    tableEditorView = new MetadataEmfTableEditorView(compositeTable, SWT.NONE);
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) MetadataEmfTableEditorView(org.talend.core.ui.metadata.editor.MetadataEmfTableEditorView) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) MetadataEmfTableEditor(org.talend.core.ui.metadata.editor.MetadataEmfTableEditor) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 4 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)

Example 5 with MetadataEmfTableEditorView

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

the class WSDLSchemaDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayout(new FillLayout());
    tableEditor = new MetadataEmfTableEditor("");
    tableEditor.setMetadataTable(metadataTable);
    // (List<MetadataColumn>)
    List<MetadataColumn> list = metadataTable.getColumns();
    // form.getSchemaViewer().getInput();
    tableEditor.addAll(list);
    tableEditorView = new MetadataEmfTableEditorView(composite, SWT.NONE);
    tableEditorView.setMetadataEditor(tableEditor);
    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) 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