use of org.talend.designer.webservice.data.ArrayIndexList in project tdi-studio-se by Talend.
the class AddArrayIndexForParentsDialog method createDialogArea.
protected Control createDialogArea(Composite parent) {
Composite createDialogArea = (Composite) super.createDialogArea(parent);
FillLayout layout = new FillLayout();
// layout.horizontalSpacing = 1;
// layout.numColumns = 1;
GridData data = new GridData(GridData.FILL_BOTH);
createDialogArea.setLayout(layout);
createDialogArea.setLayoutData(data);
table = new TableViewer(createDialogArea, SWT.FULL_SELECTION | SWT.BORDER);
new TableColumn(table.getTable(), SWT.LEFT).setText(COLUMN_NAME[0]);
table.getTable().getColumn(0).pack();
new TableColumn(table.getTable(), SWT.LEFT).setText(COLUMN_NAME[1]);
table.getTable().getColumn(1).pack();
table.getTable().setHeaderVisible(true);
table.getTable().setLinesVisible(true);
table.setContentProvider(new IndexContentProvider());
table.setLabelProvider(new IndexLabelProvider());
table.setInput(arrayIndexList);
table.setColumnProperties(COLUMN_NAME);
CellEditor[] editors = new CellEditor[2];
editors[0] = null;
editors[1] = new TextCellEditor(table.getTable());
table.setCellEditors(editors);
table.setCellModifier(new ICellModifier() {
public boolean canModify(Object element, String property) {
if (property.equals(COLUMN_NAME[0]))
return false;
return true;
}
public Object getValue(Object element, String property) {
ArrayIndexList index = (ArrayIndexList) element;
if (property.equals(COLUMN_NAME[1])) {
if (index.getIndexNum() != null) {
return index.getIndexNum();
} else {
return "";
}
}
return null;
}
public void modify(Object element, String property, Object value) {
if (element instanceof Item)
element = ((Item) element).getData();
ArrayIndexList index = (ArrayIndexList) element;
if (property.equals(COLUMN_NAME[1]))
index.setIndexNum((String) value);
table.refresh();
}
});
return createDialogArea;
}
use of org.talend.designer.webservice.data.ArrayIndexList in project tdi-studio-se by Talend.
the class AddArrayIndexForParentsDialog method createParentsArrayIndexItem.
/**
* DOC gcui Comment method "createParentsArrayIndexItem".
*/
private List<ArrayIndexList> createParentsArrayIndexItem(ParameterInfo itemPara) {
List<ParameterInfo> allArray = getAllArrayFromParents(itemPara, null);
for (int i = 0; i < allArray.size(); i++) {
String name = allArray.get(i).getName();
ArrayIndexList indexItem = new ArrayIndexList(name);
arrayIndexList.add(indexItem);
}
return arrayIndexList;
}
Aggregations