org.jboss.errai.widgets.client
Class DefaultFocusManager

java.lang.Object
  extended by org.jboss.errai.widgets.client.DefaultFocusManager
All Implemented Interfaces:
FocusManager

public class DefaultFocusManager
extends Object
implements FocusManager

A "classic" implementation of FocusManager. A start cell is first selected and corresponding movements from the start cell either extend or diminish the focus range. Left movements relative to the left of the start cell extend the focus range whereas left movements relative to the right of the start cell diminish the focus range. Likewise for the remaining three directions.

Author:
manstis

Constructor Summary
DefaultFocusManager(WSGrid dataGrid)
           
 
Method Summary
 WSGrid.WSCell getStartCell()
          Return the starting cell.
 boolean isInitialised()
          Returns true if the start cell has been set.
 int moveDownwards()
          A move downwards.
 int moveLeft()
          A move left.
 int moveRight()
          A move right.
 int moveUpwards()
          A move upwards.
 void reset()
          Remove the start cell returning the manager to an uninitialised state
 void setStartCell(WSGrid.WSCell cell)
          The start cell represents the initial selection of a single cell in a range from which the edges can be thought to extend to encompass a greater range
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFocusManager

public DefaultFocusManager(WSGrid dataGrid)
Method Detail

moveLeft

public int moveLeft()
Description copied from interface: FocusManager
A move left.

Specified by:
moveLeft in interface FocusManager
Returns:
The number of cells moved (merged cells have their content counted individually)
See Also:
FocusManager.moveLeft()

moveRight

public int moveRight()
Description copied from interface: FocusManager
A move right.

Specified by:
moveRight in interface FocusManager
Returns:
The number of cells moved (merged cells have their content counted individually)
See Also:
FocusManager.moveRight()

moveUpwards

public int moveUpwards()
Description copied from interface: FocusManager
A move upwards.

Specified by:
moveUpwards in interface FocusManager
Returns:
The number of cells moved (merged cells have their content counted individually)
See Also:
FocusManager.moveUpwards()

moveDownwards

public int moveDownwards()
Description copied from interface: FocusManager
A move downwards.

Specified by:
moveDownwards in interface FocusManager
Returns:
The number of cells moved (merged cells have their content counted individually)
See Also:
FocusManager.moveDownwards()

setStartCell

public void setStartCell(WSGrid.WSCell cell)
Description copied from interface: FocusManager
The start cell represents the initial selection of a single cell in a range from which the edges can be thought to extend to encompass a greater range

Specified by:
setStartCell in interface FocusManager
See Also:
FocusManager#setStartCell(WSCell)

getStartCell

public WSGrid.WSCell getStartCell()
Description copied from interface: FocusManager
Return the starting cell.

Specified by:
getStartCell in interface FocusManager
Returns:
See Also:
FocusManager.getStartCell()

isInitialised

public boolean isInitialised()
Description copied from interface: FocusManager
Returns true if the start cell has been set.

Specified by:
isInitialised in interface FocusManager
Returns:
See Also:
FocusManager.isInitialised()

reset

public void reset()
Description copied from interface: FocusManager
Remove the start cell returning the manager to an uninitialised state

Specified by:
reset in interface FocusManager
See Also:
FocusManager.reset()


Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.