use of org.talend.designer.mapper.ui.dialog.ListStringValueDialog in project tdi-studio-se by Talend.
the class InputDataMapTableView method openCustomCellDialog.
@Override
protected Object openCustomCellDialog(Shell shell, CellValueType type) {
if (type == CellValueType.LOOKUP_MODEL) {
IUILookupMode[] availableJoins = { TMAP_LOOKUP_MODE.LOAD_ONCE, TMAP_LOOKUP_MODE.RELOAD, TMAP_LOOKUP_MODE.CACHE_OR_RELOAD };
List<String> names = new ArrayList<String>();
for (IUILookupMode availableJoin : availableJoins) {
names.add(availableJoin.getLabel());
}
ListStringValueDialog<String> dialog = new ListStringValueDialog<String>(shell, names);
if (dialog.open() == IDialogConstants.OK_ID) {
return dialog.getSelectStr();
}
} else if (type == CellValueType.MATCH_MODEL) {
IUIMatchingMode[] matchModel = getMatchModel();
List<String> names = new ArrayList<String>();
for (IUIMatchingMode element : matchModel) {
names.add(element.getLabel());
}
ListStringValueDialog<String> dialog = new ListStringValueDialog<String>(shell, names);
if (dialog.open() == IDialogConstants.OK_ID) {
return dialog.getSelectStr();
}
} else if (type == CellValueType.JOIN_MODEL) {
String[] items = new String[] { INNER_JOIN, LEFT_OUTER_JOIN };
ListStringValueDialog<String> dialog = new ListStringValueDialog<String>(shell, items);
if (dialog.open() == IDialogConstants.OK_ID) {
return dialog.getSelectStr();
}
}
return null;
}
Aggregations