Search in sources :

Example 1 with ListStringValueDialog

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;
}
Also used : IUILookupMode(org.talend.designer.mapper.model.table.IUILookupMode) ArrayList(java.util.ArrayList) IUIMatchingMode(org.talend.designer.mapper.model.table.IUIMatchingMode) List(java.util.List) ArrayList(java.util.ArrayList) ListStringValueDialog(org.talend.designer.mapper.ui.dialog.ListStringValueDialog)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 IUILookupMode (org.talend.designer.mapper.model.table.IUILookupMode)1 IUIMatchingMode (org.talend.designer.mapper.model.table.IUIMatchingMode)1 ListStringValueDialog (org.talend.designer.mapper.ui.dialog.ListStringValueDialog)1