Search in sources :

Example 1 with JSONFileTableViewerProvider

use of org.talend.repository.json.ui.wizards.view.JSONFileTableViewerProvider in project tdi-studio-se by Talend.

the class JSONFileOutputStep2Form method addSchemaViewer.

private void addSchemaViewer(final Composite mainComposite, final int width, final int height) {
    final Group group = Form.createGroup(mainComposite, 1, "Linker Source", height);
    // group.setBackgroundMode(SWT.INHERIT_FORCE);
    schemaButton = new Button(group, SWT.PUSH);
    schemaButton.setText("Schema Management");
    schemaButton.setToolTipText("You can add or edit schema and save in 'Schema List' viewer");
    schemaViewer = new TableViewer(group);
    JSONFileTableViewerProvider provider = new JSONFileTableViewerProvider();
    schemaViewer.setContentProvider(provider);
    schemaViewer.setLabelProvider(provider);
    GridData gridData = new GridData(GridData.FILL_BOTH);
    Table table = schemaViewer.getTable();
    if (isReadOnly()) {
        table.setEnabled(false);
    }
    table.setHeaderVisible(true);
    org.eclipse.swt.widgets.TableColumn column = new org.eclipse.swt.widgets.TableColumn(table, SWT.LEFT);
    column.setText("Schema List");
    column.setWidth(100);
    table.setLayoutData(gridData);
}
Also used : Group(org.eclipse.swt.widgets.Group) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) Table(org.eclipse.swt.widgets.Table) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) Button(org.eclipse.swt.widgets.Button) MoveUpTreeNodeButton(org.talend.repository.json.ui.wizards.buttons.MoveUpTreeNodeButton) MoveDownTreeNodeButton(org.talend.repository.json.ui.wizards.buttons.MoveDownTreeNodeButton) RemoveTreeNodeButton(org.talend.repository.json.ui.wizards.buttons.RemoveTreeNodeButton) AddTreeNodeButton(org.talend.repository.json.ui.wizards.buttons.AddTreeNodeButton) GridData(org.eclipse.swt.layout.GridData) JSONFileTableViewerProvider(org.talend.repository.json.ui.wizards.view.JSONFileTableViewerProvider) TableViewer(org.eclipse.jface.viewers.TableViewer)

Aggregations

TableViewer (org.eclipse.jface.viewers.TableViewer)1 GridData (org.eclipse.swt.layout.GridData)1 Button (org.eclipse.swt.widgets.Button)1 Group (org.eclipse.swt.widgets.Group)1 Table (org.eclipse.swt.widgets.Table)1 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)1 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)1 AddTreeNodeButton (org.talend.repository.json.ui.wizards.buttons.AddTreeNodeButton)1 MoveDownTreeNodeButton (org.talend.repository.json.ui.wizards.buttons.MoveDownTreeNodeButton)1 MoveUpTreeNodeButton (org.talend.repository.json.ui.wizards.buttons.MoveUpTreeNodeButton)1 RemoveTreeNodeButton (org.talend.repository.json.ui.wizards.buttons.RemoveTreeNodeButton)1 JSONFileTableViewerProvider (org.talend.repository.json.ui.wizards.view.JSONFileTableViewerProvider)1