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);
}
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();
}
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);
}
}
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;
}
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);
}
Aggregations