/** Moves up. Performs differently according to * immediateReorder property value. */ private void moveUp(final int position) { if (index == null) { return; } if (immediateReorder) { index.moveUp(position); } else { getPermutation(); int temp = permutation[position]; permutation[position] = permutation[position - 1]; permutation[position - 1] = temp; } }
public void moveUp(int i) { indexSupport.moveUp(i); }
/** Moves up. Performs differently according to * immediateReorder property value. */ private void moveUp (final int position) { if (index == null) return; if (immediateReorder) { index.moveUp(position); } else { getPermutation(); int temp = permutation[position]; permutation[position] = permutation[position - 1]; permutation[position - 1] = temp; } }
/** Moves up. Performs differently according to * immediateReorder property value. */ private void moveUp (final int position) { if (index == null) return; if (immediateReorder) { index.moveUp(position); } else { getPermutation(); int temp = permutation[position]; permutation[position] = permutation[position - 1]; permutation[position - 1] = temp; } }
protected void performAction (Node[] activatedNodes) { // we need to check activatedNodes, because there's no // guarantee that they not changed between enable() and // performAction calls Index cookie = getIndexCookie(activatedNodes); if (cookie == null) return; int nodeIndex = cookie.indexOf(activatedNodes[0]); if (nodeIndex > 0) { cookie.moveUp(nodeIndex); } }
protected void performAction (Node[] activatedNodes) { // we need to check activatedNodes, because there's no // guarantee that they not changed between enable() and // performAction calls Index cookie = getIndexCookie(activatedNodes); if (cookie == null) return; int nodeIndex = cookie.indexOf(activatedNodes[0]); if (nodeIndex > 0) { cookie.moveUp(nodeIndex); } }
private void moveUp (Node[] nodes) { assert nodes != null : "Nodes to moveUp cannot be null."; assert nodes.length == 1 : "Only one node can be moveUp, not " + Arrays.asList (nodes); assert nodes [0].isLeaf () : "Only leaf node can be moveUp, not " + nodes [0]; Node n = nodes [0]; Index supp = getIndexSupport (n); int origPos = getNodePosition (n); // workaround issue 62192, don't try to move on broken index if (origPos == -1) { return ; } supp.moveUp (origPos); // getNodePosition() is not really reliable here. // assert origPos - 1 == getNodePosition (n) : "Node " + n + " has been moved from " + origPos + " to pos " + getNodePosition (n); }