@Override public boolean isVisible() { Object key = TableUtil.getCurrentRowKey(); return getRowModeKey(key) == RowMode.EDIT; } };
@Override public boolean isVisible() { List<Integer> index = TableUtil.getCurrentRowIndex(TravelDocPanel.this); // On expanded row, so check the index of the expanded level return index.get(1) > 0; }
List<Integer> rowIndex = TableUtil.rowIndexStringToList(expandedRow); Object key = pageRowKeys.get(rowIndex); if (key != null) {
boolean rowExpanded = rowExpandable && table.getExpandedRows().contains(wrapper.getRowKey()); String rowIndexAsString = TableUtil.rowIndexListToString(rowIndex);
List<Integer> rowIndex = TableUtil.rowIndexStringToList(selectedRow); Object key = pageRowKeys.get(rowIndex); if (key == null) {
@Override public RowMode getCurrentRowMode() { Object key = TableUtil.getCurrentRowKey(); if (key == null) { return RowMode.READ; } return getRowMode(key); }
/** * Calculates the sort order for the data, using the given column and comparator. * * @param comparator the comparator to use for sorting * @param col the column to sort on * @param ascending true for an ascending sort, false for descending. * @return the row indices in sort order. */ protected int[] sort(final Comparator<Object> comparator, final int col, final boolean ascending) { // We cache the column data to avoid repeated and potentially expensive lookups int rowCount = getRowCount(); Object[] columnData = new Object[rowCount]; for (int i = rowCount - 1; i >= 0; i--) { List<Integer> row = new ArrayList<>(); row.add(i); columnData[i] = getValueAt(row, col); } int[] sortIndices = new int[rowCount]; for (int i = 0; i < sortIndices.length; i++) { sortIndices[i] = i; } TableUtil.sortData(columnData, comparator, ascending, 0, columnData.length - 1, sortIndices); return sortIndices; } }
@Override public boolean isVisible() { List<Integer> index = TableUtil.getCurrentRowIndex(TravelDocPanel.this); // On expanded row, so check the index of the expanded level return index.get(1) > 0; }
/** * Handle the edit button action. */ protected void handleEditButtonAction() { Object key = TableUtil.getCurrentRowKey(); addRowModeKey(key, RowMode.EDIT); }
/** * Calculates the sort order for the data, using the given column and comparator. * * @param comparator the comparator to use for sorting * @param col the column to sort on * @param ascending true for an ascending sort, false for descending. * @return the row indices in sort order. */ protected int[] sort(final Comparator<Object> comparator, final int col, final boolean ascending) { // We cache the column data to avoid repeated and potentially expensive lookups Object[] columnData = new Object[getRowCount()]; for (int i = getRowCount() - 1; i >= 0; i--) { columnData[i] = getValueAt(i, col); } int[] sortIndices = new int[getRowCount()]; for (int i = 0; i < sortIndices.length; i++) { sortIndices[i] = i; } TableUtil.sortData(columnData, comparator, ascending, 0, columnData.length - 1, sortIndices); return sortIndices; } }
@Override public boolean isVisible() { List<Integer> index = TableUtil.getCurrentRowIndex(TravelDocPanel.this); // On expanded row, so check the index of the expanded level return index.get(1) > 0; }
@Override public void execute(final ActionEvent event) { Object key = TableUtil.getCurrentRowKey(); addEditRow(key); } });
/** * Calculates the sort order for the data, using the given column and comparator. * * @param comparator the comparator to use for sorting * @param col the column to sort on * @param ascending true for an ascending sort, false for descending. * * @return the row indices in sort order. */ protected int[] sort(final Comparator<Object> comparator, final int col, final boolean ascending) { // We cache the column data to avoid repeated and potentially expensive lookups Object[] columnData = new Object[getRowCount()]; for (int i = getRowCount() - 1; i >= 0; i--) { columnData[i] = getValueAt(i, col); } int[] sortIndices = new int[getRowCount()]; for (int i = 0; i < sortIndices.length; i++) { sortIndices[i] = i; } TableUtil.sortData(columnData, comparator, ascending, 0, columnData.length - 1, sortIndices); return sortIndices; } }
@Override public boolean isVisible() { Object key = TableUtil.getCurrentRowKey(); return !isEditRow(key); } };
@Override public boolean isVisible() { Object key = TableUtil.getCurrentRowKey(); return isEditRow(key); } };
@Override public boolean isVisible() { Object key = TableUtil.getCurrentRowKey(); return !isEditRow(key); } };
@Override public boolean isVisible() { Object key = TableUtil.getCurrentRowKey(); return isAllowEdit() && getRowModeKey(key) != RowMode.EDIT; } };
@Override public boolean isVisible() { Object key = TableUtil.getCurrentRowKey(); return isAllowEdit() && getRowModeKey(key) == RowMode.READ; } };
/** * Handle the cancel button action. */ protected void handleCancelButtonAction() { Object key = TableUtil.getCurrentRowKey(); removeRowModeKey(key); for (AjaxTarget target : getColumnAjaxTargets()) { target.reset(); } }