This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git commit 05086db30659ec5d26951b3c600a2154401d7053 Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Aug 21 15:20:11 2014 +0200 fixes #3455: Add more useful method on org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel --- .../swing/table/AbstractApplicationTableModel.java | 42 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java b/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java index 569fad4..e1e82b4 100644 --- a/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java +++ b/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java @@ -312,7 +312,7 @@ public abstract class AbstractApplicationTableModel<R extends Serializable> exte return Iterables.indexOf(identifiers, new Predicate<ColumnIdentifier<R>>() { @Override public boolean apply(ColumnIdentifier<R> input) { - return ObjectUtils.equals(propertyName,input.getPropertyName()); + return ObjectUtils.equals(propertyName, input.getPropertyName()); } }); } @@ -326,4 +326,44 @@ public abstract class AbstractApplicationTableModel<R extends Serializable> exte return cell; } + + public void moveUp(R row) { + + int rowIndex = getRowIndex(row); + + if (log.isInfoEnabled()) { + log.info("Will move up row of index: " + rowIndex); + } + rows.remove(rowIndex); + rows.add(rowIndex - 1, row); + fireTableRowsUpdated(rowIndex - 1, rowIndex); + + } + + public void moveDown(R row) { + + int rowIndex = getRowIndex(row); + + if (log.isInfoEnabled()) { + log.info("Will move down row of index: " + rowIndex); + } + rows.remove(rowIndex); + rows.add(rowIndex + 1, row); + fireTableRowsUpdated(rowIndex, rowIndex + 1); + + } + + public boolean isFirstRow(R row) { + + int rowIndex = getRowIndex(row); + return rowIndex == 0; + + } + + public boolean isLastRow(R row) { + + int rowIndex = getRowIndex(row); + return rowIndex == getRowCount() - 1; + + } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.