use of org.eclipse.swt.widgets.TableItem in project tdi-studio-se by Talend.
the class MultiSchemasShadowProcessPreview method refreshPreviewItem.
@Override
protected void refreshPreviewItem(List<String[]> csvRows, boolean firstRowIsLabel, int... selectedColumnIndex) {
setSelectColumnIndex(selectedColumnIndex[0]);
int existingItemCount = table.getItemCount();
int end = csvRows.size();
if (firstRowIsLabel) {
end--;
}
showCheckImageOnColumn(selectedColumnIndex);
for (int f = 0; f < end; f++) {
String[] csvFields;
if (firstRowIsLabel) {
csvFields = csvRows.get(f + 1);
} else {
csvFields = csvRows.get(f);
}
String[] values = csvFields;
if (f >= existingItemCount) {
// create a new Item
TableItem row = new TableItem(table, SWT.NONE);
row.setText(values);
} else {
// update an existing Item
table.getItem(f).setText(values);
}
}
table.setRedraw(true);
}
use of org.eclipse.swt.widgets.TableItem in project tdi-studio-se by Talend.
the class SchemaXMLLinker method addLink.
/**
* amaumont Comment method "addLink".
*
* @param tableItem
* @param dataItem1
* @param tree
* @param dataItem2
*/
private LinkDescriptor<Item, Object, Tree, Object> addLink(Item tableItem, Object dataItem1, Tree tree, Object dataItem2, boolean lastOne) {
LinkDescriptor<Item, Object, Tree, Object> link = new LinkDescriptor<Item, Object, Tree, Object>(new ItemExtremityDescriptor(tableItem, dataItem1), new ExtremityLink<Tree, Object>(tree, dataItem2));
link.setStyleLink(getUnselectedStyleLink());
getLinksManager().addLink(link);
updateLinksStyleAndControlsSelection(tree, lastOne);
return link;
}
use of org.eclipse.swt.widgets.TableItem in project tdi-studio-se by Talend.
the class SchemaXMLLinker method createLoopLinks.
private void createLoopLinks(List<HL7TreeNode> treeData) {
for (HL7TreeNode treeNode : treeData) {
if (treeNode.getColumn() != null) {
TableItem tableItem = null;
for (TableItem curTableItem : getSource().getItems()) {
if (curTableItem.getText().equals(treeNode.getColumn().getLabel())) {
tableItem = curTableItem;
break;
}
}
if (tableItem == null) {
continue;
}
String path = tableItem.getText();
if (path != null) {
TreeItem treeItem = getTreeItem(treeNode);
if (treeItem != null) {
addLoopLink(tableItem, tableItem.getData(), xmlViewer.getTree(), (HL7TreeNode) treeItem.getData(), false);
}
}
}
createLoopLinks(treeNode.getChildren());
}
}
use of org.eclipse.swt.widgets.TableItem in project tdi-studio-se by Talend.
the class FieldSection method getDragItemsAsText.
/*
* (non-Javadoc)
*
* @see org.talend.designer.scd.ui.IDragDrop#getDragItemsAsText()
*/
public String getDragItemsAsText() {
tableViewer.cancelEditing();
Table table = tableViewer.getTable();
TableItem[] selection = table.getSelection();
StringBuffer buf = new StringBuffer();
// number of selected elements
buf.append(selection.length);
for (TableItem element : selection) {
buf.append('|');
buf.append(element.getText());
}
return buf.toString();
}
use of org.eclipse.swt.widgets.TableItem in project tdi-studio-se by Talend.
the class MultipleSurrogateSection method createNewItem.
public void createNewItem(final SurrogateKey key) {
tableModel.add(key);
table.setRedraw(false);
final TableItem item = new TableItem(table, SWT.NONE);
initTableItem(key, item);
table.setRedraw(true);
}
Aggregations