/** * @return - similar to nvl(), but returns replaceWithIfEmpty in case of null and empty, * otherwise just value. */ public static String nonEmpty(String value, String replaceWithIfEmpty) { return Empty.is(value) ? replaceWithIfEmpty : value; }
/** * @return - similar to nvl(), but returns replaceWithIfEmpty in case of null and empty, * otherwise just value. */ public static String nonEmpty(String value, String replaceWithIfEmpty) { return Empty.is(value) ? replaceWithIfEmpty : value; }
/** * @return - similar to nvl(), but returns replaceWithIfEmpty in case of null and empty, * otherwise just value. */ public static String nonEmpty(String value, String replaceWithIfEmpty) { return Empty.is(value) ? replaceWithIfEmpty : value; }
public static <K, V> Map<K, V> nonEmpty(Map<K, V> value, Map<K, V> replaceWithIfEmpty) { return Empty.is(value) ? replaceWithIfEmpty : value; } }
public static <K, V> Map<K, V> nonEmpty(Map<K, V> value, Map<K, V> replaceWithIfEmpty) { return Empty.is(value) ? replaceWithIfEmpty : value; } }
public static <K, V> Map<K, V> nonEmpty(Map<K, V> value, Map<K, V> replaceWithIfEmpty) { return Empty.is(value) ? replaceWithIfEmpty : value; } }
public static <T> Collection<T> nonEmpty(Collection<T> value, Collection<T> replaceWithIfEmpty) { return Empty.is(value) ? replaceWithIfEmpty : value; }
public static <T> Collection<T> nonEmpty(Collection<T> value, Collection<T> replaceWithIfEmpty) { return Empty.is(value) ? replaceWithIfEmpty : value; }
public boolean hasWidgets() { return !Empty.is(widgets); }
public boolean hasWidgets() { return !Empty.is(widgets); }
public int findColumnIndex(ColumnDefEx col) { if (col == null) return -1; if (!Empty.is(datacols)) return datacols.indexOf(col); else return -1; }
public int findColumnIndex(ColumnDefEx col) { if (col == null) return -1; if (!Empty.is(datacols)) return datacols.indexOf(col); else return -1; }
@Override public void onChanged(Element row, boolean opened, JavaScriptObject rowData) { String rowId = getRowId(rowData); if (Empty.is(rowId)) return; if (opened) { if (serverRowDetails == null) serverRowDetails = new HashSet<>(); serverRowDetails.add(rowId); } else { if (!Empty.is(serverRowDetails)) serverRowDetails.remove(rowId); } } });
@Override public void onChanged(Element row, boolean opened, JavaScriptObject rowData) { String rowId = getRowId(rowData); if (Empty.is(rowId)) return; if (opened) { if (serverRowDetails == null) serverRowDetails = new HashSet<>(); serverRowDetails.add(rowId); } else { if (!Empty.is(serverRowDetails)) serverRowDetails.remove(rowId); } } });
@Override public void onRowSelChanged(Element row, boolean selected, JavaScriptObject rowData) { String rowId = getRowId(rowData); if (!Empty.is(rowId)) { if (selected) { if (serverRowSelected == null) serverRowSelected = new HashSet<>(); serverRowSelected.add(rowId); } else { if (!Empty.is(serverRowSelected)) serverRowSelected.remove(rowId); } } fireRowSelChanged(row, selected, rowData); }}); } else {
@Override public void onRowSelChanged(Element row, boolean selected, JavaScriptObject rowData) { String rowId = getRowId(rowData); if (!Empty.is(rowId)) { if (selected) { if (serverRowSelected == null) serverRowSelected = new HashSet<>(); serverRowSelected.add(rowId); } else { if (!Empty.is(serverRowSelected)) serverRowSelected.remove(rowId); } } fireRowSelChanged(row, selected, rowData); }}); } else {
@Override public void onRow(Element row, JavaScriptObject rowData) { if (!Empty.is(serverRowSelected)) { String rowId = getRowId(rowData); if (!Empty.is(rowId) && serverRowSelected.contains(rowId)) { JsDataTable.initRow(row, true); } } }}); JsDataTable.setRowSelChanged(getElement(), new JsRowSelect() {
@Override public void onRow(Element row, JavaScriptObject rowData) { if (!Empty.is(serverRowSelected)) { String rowId = getRowId(rowData); if (!Empty.is(rowId) && serverRowSelected.contains(rowId)) { JsDataTable.initRow(row, true); } } }}); JsDataTable.setRowSelChanged(getElement(), new JsRowSelect() {