qx.ui.table.selection
Class Model

java.lang.Object
  extended by qx.core.Object
      extended by qx.core.Target
          extended by qx.ui.table.selection.Model
Direct Known Subclasses:
RecursiveSelectionModel

public class Model
extends Target

A selection model.


Constructor Summary
Model()
           
 
Method Summary
 void _addSelectionInterval(java.lang.Integer fromIndex, java.lang.Integer toIndex)
          Adds a selection interval to the current selection, but doesn’t inform the listeners.
 void _applySelectionMode(java.lang.Object selectionMode, java.lang.Object old)
          Applies changes of the property value of the property selectionMode.
 void _clearSelection()
          Clears the selection, but doesn’t inform the listeners.
 void _dumpRanges()
          Logs the current ranges for debug perposes.
 void _fireChangeSelection()
          Fires the “changeSelection” event to all registered listeners.
 void addSelectionInterval(java.lang.Integer fromIndex, java.lang.Integer toIndex)
          Adds a selection interval to the current selection.
 void clearSelection()
          Clears the selection.
 java.lang.Integer getAnchorSelectionIndex()
          Returns the first argument of the last call to #setSelectionInterval(), #addSelectionInterval() or #removeSelectionInterval().
 java.lang.Integer getLeadSelectionIndex()
          Returns the second argument of the last call to #setSelectionInterval(), #addSelectionInterval() or #removeSelectionInterval().
 java.lang.Integer getSelectedCount()
          Returns the number of selected items.
 java.lang.Object getSelectedRanges()
          Returns the selected ranges as an array.
 java.lang.Object getSelectionMode()
          Returns the (computed) value of the property selectionMode.
 boolean hasBatchMode()
          Returns whether batch mode is active.
 void initSelectionMode(java.lang.Object arg)
          Calls the apply method and dispatches the change event of the property selectionMode with the default value defined by the class developer.
 boolean isSelectedIndex(java.lang.Integer index)
          Returns whether a index is selected.
 boolean isSelectionEmpty()
          Returns whether the selection is empty.
 void iterateSelection(java.lang.Object iterator, java.lang.Object object)
          Calls a iterator function for each selected index.
 void removeSelectionInterval(java.lang.Integer fromIndex, java.lang.Integer toIndex)
          Removes a interval from the current selection.
 void resetSelectionMode()
          Resets the user value of the property selectionMode.
 boolean setBatchMode(boolean batchMode)
          Activates / Deactivates batch mode.
 void setSelectionInterval(java.lang.Integer fromIndex, java.lang.Integer toIndex)
          Sets the selected interval.
 void setSelectionMode(java.lang.Object arg)
          Sets the user value of the property selectionMode.
 
Methods inherited from class qx.core.Target
_dispatchEvent, addChangeSelectionListener, addChangeValueListener, addEventListener, addExecuteListener, addJavaEventListener, createDispatchChangeEvent, createDispatchDataEvent, createDispatchEvent, dispatchEvent, hasEventListeners, removeEventListener
 
Methods inherited from class qx.core.Object
_disposeFields, _disposeObjectDeep, _disposeObjects, base, dispose, get, getDisposed, isDisposed, reset, self, set, toHashCode, toString_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model()
Method Detail

_addSelectionInterval

public void _addSelectionInterval(java.lang.Integer fromIndex,
                                  java.lang.Integer toIndex)

Adds a selection interval to the current selection, but doesn’t inform the listeners.


_applySelectionMode

public void _applySelectionMode(java.lang.Object selectionMode,
                                java.lang.Object old)

Applies changes of the property value of the property selectionMode.

For further details take a look at the property definition: _applySelectionMode(java.lang.Object, java.lang.Object).


_clearSelection

public void _clearSelection()

Clears the selection, but doesn’t inform the listeners.


_dumpRanges

public void _dumpRanges()

Logs the current ranges for debug perposes.


_fireChangeSelection

public void _fireChangeSelection()

Fires the “changeSelection” event to all registered listeners. If the selection model currently is in batch mode, only one event will be thrown when batch mode is ended.


addSelectionInterval

public void addSelectionInterval(java.lang.Integer fromIndex,
                                 java.lang.Integer toIndex)

Adds a selection interval to the current selection.


clearSelection

public void clearSelection()

Clears the selection.


getAnchorSelectionIndex

public java.lang.Integer getAnchorSelectionIndex()

Returns the first argument of the last call to #setSelectionInterval(), #addSelectionInterval() or #removeSelectionInterval().


getLeadSelectionIndex

public java.lang.Integer getLeadSelectionIndex()

Returns the second argument of the last call to #setSelectionInterval(), #addSelectionInterval() or #removeSelectionInterval().


getSelectedCount

public java.lang.Integer getSelectedCount()

Returns the number of selected items.


getSelectedRanges

public java.lang.Object getSelectedRanges()

Returns the selected ranges as an array. Each array element has a minIndex and a maxIndex property.


getSelectionMode

public java.lang.Object getSelectionMode()

Returns the (computed) value of the property selectionMode.

For further details take a look at the property definition: selectionMode.


hasBatchMode

public boolean hasBatchMode()

Returns whether batch mode is active. See setter for a description of batch mode.


initSelectionMode

public void initSelectionMode(java.lang.Object arg)

Calls the apply method and dispatches the change event of the property selectionMode with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: selectionMode.


isSelectedIndex

public boolean isSelectedIndex(java.lang.Integer index)

Returns whether a index is selected.


isSelectionEmpty

public boolean isSelectionEmpty()

Returns whether the selection is empty.


iterateSelection

public void iterateSelection(java.lang.Object iterator,
                             java.lang.Object object)

Calls a iterator function for each selected index.

Usage Example:

var selectedRowData = [];
mySelectionModel.iterateSelection(function(index) {
  selectedRowData.push(myTableModel.getRowData(index));
});


removeSelectionInterval

public void removeSelectionInterval(java.lang.Integer fromIndex,
                                    java.lang.Integer toIndex)

Removes a interval from the current selection.


resetSelectionMode

public void resetSelectionMode()

Resets the user value of the property selectionMode.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: selectionMode.


setBatchMode

public boolean setBatchMode(boolean batchMode)

Activates / Deactivates batch mode. In batch mode, no change events will be thrown but will be collected instead. When batch mode is turned off again and any events have been collected, one event is thrown to inform the listeners.

This method supports nested calling, i. e. batch mode can be turned more than once. In this case, batch mode will not end until it has been turned off once for each turning on.


setSelectionInterval

public void setSelectionInterval(java.lang.Integer fromIndex,
                                 java.lang.Integer toIndex)

Sets the selected interval. This will clear the former selection.


setSelectionMode

public void setSelectionMode(java.lang.Object arg)

Sets the user value of the property selectionMode.

For further details take a look at the property definition: selectionMode.



Copyright © 2008 1&1. All Rights Reserved.