Search in sources :

Example 41 with Table

use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.

the class DataMapTableView method showTableConstraints.

protected void showTableConstraints(boolean visible, TableViewerCreator _tableViewerCreatorForFilters) {
    Table _tableForConstraints = _tableViewerCreatorForFilters.getTable();
    GridData _tableForConstraintsGridData = (GridData) _tableForConstraints.getLayoutData();
    if (visible) {
        _tableForConstraintsGridData.exclude = false;
        _tableForConstraints.setVisible(true);
        if (WindowSystem.isGTK()) {
            updateGridDataHeightForTableConstraints(_tableForConstraints);
        }
    } else {
        _tableForConstraintsGridData.exclude = true;
        _tableForConstraints.setVisible(false);
    }
    _tableViewerCreatorForFilters.getTableViewer().refresh();
    resizeAtExpandedSize(_tableViewerCreatorForFilters);
}
Also used : IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) AbstractInOutTable(org.talend.designer.dbmap.model.table.AbstractInOutTable) OutputTable(org.talend.designer.dbmap.model.table.OutputTable) Table(org.eclipse.swt.widgets.Table) GridData(org.eclipse.swt.layout.GridData)

Example 42 with Table

use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.

the class DataMapTableView method onFiltersToolItemsSelected.

protected synchronized void onFiltersToolItemsSelected(SelectionEvent e, TableViewerCreator _tableViewerCreatorForFilters, String filterKind) {
    Table tableConstraints = _tableViewerCreatorForFilters.getTable();
    int index = tableConstraints.getItemCount();
    int[] selection = _tableViewerCreatorForFilters.getTable().getSelectionIndices();
    if (selection.length > 0) {
        index = selection[selection.length - 1] + 1;
    }
    //$NON-NLS-1$
    mapperManager.addNewFilterEntry(DataMapTableView.this, "newFilter" + ++constraintCounter, index, filterKind);
    updateGridDataHeightForTableConstraints();
    changeSize(getPreferredSize(false, true, true), true, true);
    _tableViewerCreatorForFilters.getTableViewer().refresh();
    mapperManager.getUiManager().refreshBackground(true, false);
    showTableConstraints(true, _tableViewerCreatorForFilters);
    changeMinimizeState(false);
    _tableViewerCreatorForFilters.layout();
}
Also used : IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) AbstractInOutTable(org.talend.designer.dbmap.model.table.AbstractInOutTable) OutputTable(org.talend.designer.dbmap.model.table.OutputTable) Table(org.eclipse.swt.widgets.Table) Point(org.eclipse.swt.graphics.Point)

Example 43 with Table

use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.

the class DataMapTableView method resizeTextEditor.

private void resizeTextEditor(Text textEditor, TableViewerCreator tableViewerCreator) {
    Point currentSize = textEditor.getSize();
    Rectangle currentBounds = textEditor.getBounds();
    String text = textEditor.getText();
    Table currentTable = tableViewerCreator.getTable();
    int itemHeight = currentTable.getItemHeight();
    int minHeight = itemHeight + 3;
    int maxHeight = 2 * itemHeight + 4;
    int newHeight = 0;
    if ((text.contains("\n") || text.contains("\r")) && currentBounds.y + maxHeight < currentTable.getBounds().height) {
        //$NON-NLS-1$ //$NON-NLS-2$
        newHeight = maxHeight;
    } else {
        newHeight = minHeight;
    }
    if (currentSize.y != newHeight) {
        textEditor.setSize(textEditor.getSize().x, newHeight);
    }
}
Also used : IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) AbstractInOutTable(org.talend.designer.dbmap.model.table.AbstractInOutTable) OutputTable(org.talend.designer.dbmap.model.table.OutputTable) Table(org.eclipse.swt.widgets.Table) Rectangle(org.eclipse.swt.graphics.Rectangle) Point(org.eclipse.swt.graphics.Point) Point(org.eclipse.swt.graphics.Point)

Example 44 with Table

use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.

the class MapperManager method isTableOfInputMetadataEditor.

/**
     * DOC amaumont Comment method "isTableOfInputMetadataEditor".
     * 
     * @param table
     * @return
     */
public boolean isTableOfInputMetadataEditor(Table table) {
    MetadataTableEditorView inputEditorView = uiManager.getInputMetaEditorView();
    Table tableEditorView = inputEditorView.getTable();
    return tableEditorView == table;
}
Also used : IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) InputTable(org.talend.designer.mapper.model.table.InputTable) VarsTable(org.talend.designer.mapper.model.table.VarsTable) Table(org.eclipse.swt.widgets.Table) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) AbstractInOutTable(org.talend.designer.mapper.model.table.AbstractInOutTable) MetadataTable(org.talend.core.model.metadata.MetadataTable) OutputTable(org.talend.designer.mapper.model.table.OutputTable) MetadataTableEditorView(org.talend.core.ui.metadata.editor.MetadataTableEditorView)

Example 45 with Table

use of org.eclipse.swt.widgets.Table 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

Table (org.eclipse.swt.widgets.Table)770 GridData (org.eclipse.swt.layout.GridData)368 Composite (org.eclipse.swt.widgets.Composite)325 TableColumn (org.eclipse.swt.widgets.TableColumn)324 TableViewer (org.eclipse.jface.viewers.TableViewer)303 GridLayout (org.eclipse.swt.layout.GridLayout)255 TableItem (org.eclipse.swt.widgets.TableItem)210 SelectionEvent (org.eclipse.swt.events.SelectionEvent)204 Label (org.eclipse.swt.widgets.Label)179 Button (org.eclipse.swt.widgets.Button)161 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)145 Point (org.eclipse.swt.graphics.Point)138 Text (org.eclipse.swt.widgets.Text)102 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)96 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)95 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)89 FillLayout (org.eclipse.swt.layout.FillLayout)87 Shell (org.eclipse.swt.widgets.Shell)82 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)81 Event (org.eclipse.swt.widgets.Event)80