public class SpreadsheetView
extends javafx.scene.control.Control
TableView
control but with different functionalities and use cases. The aim is to have
a powerful grid where data can be written and retrieved.
SpreadsheetView so that they
are always visible on screen.SpreadsheetView so that
they are always visible on screen.Picker can be placed above column header or to the side of the
row header.Comparator.getFixedRows() and getFixedColumns(). But you
are strongly advised to check if it's possible to do so with
SpreadsheetColumn.isColumnFixable() for the frozen columns and with
isRowFixable(int) for the frozen rows.
areRowsFixable(java.util.List) or areSpreadsheetColumnsFixable(java.util.List)
to verify if you can freeze them. Be sure to add them all in once otherwise the
system will detect that a span is going out of bounds and will throw an
exception.
Calling those methods prior
every move will ensure that no exception will be thrown.
setShowRowHeader(boolean) or setShowColumnHeader(boolean).
getRowPickers() and getColumnPickers() along with an
instance of Picker. You can override the Picker.onClick()
method in order to react when the user click on the picker.


Picker picker = new Picker() {
@Override
public void onClick() {
//If my details are hidden
if (getHiddenRows().get(3)) {
showRow(3);
showRow(4);
showRow(5);
showRow(6);
} else {
hideRow(3);
hideRow(4);
hideRow(5);
hideRow(6);
}
}
};
getRowPickers().put(2, picker);
SpreadsheetCellType of the receiving cell. Pasting a Double into a
String will work but the reverse operation will not.
SpreadsheetCellType Value Verification documentation for more
information.
Rows and columns can be hidden if you need to. Simply call showRow(int) or hideRow(int) in order to toggle the visibility of a row. Same
for the column.
Note that the span of the cell (in row or column) will automatically adapt
based on the visible rows or columns. You have nothing to do.
Because toggling visibility have an impact on the Grid, if you have a lot of
rows/columns to show or hide, you may consider setting them all directly by
using setHiddenRows(java.util.BitSet). The BitSet represent
all your rows/columns and the bit associated to it represent its visibility.
setZoomFactor(java.lang.Double). We recommend using value between 2 and 0.1.
TableView, you instantiate the
underlying model, a Grid. You will create some rows filled with SpreadsheetCell.
int rowCount = 15;
int columnCount = 10;
GridBase grid = new GridBase(rowCount, columnCount);
ObservableList<ObservableList<SpreadsheetCell>> rows = FXCollections.observableArrayList();
for (int row = 0; row < grid.getRowCount(); ++row) {
final ObservableList<SpreadsheetCell> list = FXCollections.observableArrayList();
for (int column = 0; column < grid.getColumnCount(); ++column) {
list.add(SpreadsheetCellType.STRING.createCell(row, column, 1, 1,"value"));
}
rows.add(list);
}
grid.setRows(rows);
SpreadsheetView spv = new SpreadsheetView(grid);
At that moment you can span some of the cells with the convenient method
provided by the grid. Then you just need to instantiate the SpreadsheetView. 
SpreadsheetCell,
SpreadsheetCellBase,
SpreadsheetColumn,
Grid,
GridBase,
Picker| Type | Property and Description |
|---|---|
javafx.beans.property.ObjectProperty<java.util.Comparator<? super javafx.collections.ObservableList<SpreadsheetCell>>> |
comparator
Return an ObjectProperty wrapping the comparator used in the
SpreadsheetView.
|
javafx.beans.property.BooleanProperty |
editable
Specifies whether this SpreadsheetView is editable - only if the
SpreadsheetView, and the
SpreadsheetCell within it are both
editable will a SpreadsheetCell be able to go into its editing
state. |
javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.control.TablePosition<javafx.collections.ObservableList<SpreadsheetCell>,?>> |
editingCell
Represents the current cell being edited, or null if there is no cell
being edited.
|
javafx.beans.property.ReadOnlyBooleanProperty |
fixingColumnsAllowed
Return the Boolean property associated with the allowance of freezing or
unfreezing some columns.
|
javafx.beans.property.ReadOnlyBooleanProperty |
fixingRowsAllowed
Return the Boolean property associated with the allowance of freezing or
unfreezing some rows.
|
javafx.beans.property.ReadOnlyObjectProperty<Grid> |
grid
Return a
ReadOnlyObjectProperty containing the current Grid
used in the SpreadsheetView. |
javafx.beans.property.ObjectProperty<java.util.BitSet> |
hiddenColumns
Return the Objectproperty wrapping the hidden columns.
|
javafx.beans.property.ObjectProperty<java.util.BitSet> |
hiddenRows
Return the Objectproperty wrapping the hidden rows..
|
javafx.beans.property.ObjectProperty<javafx.scene.Node> |
placeholder
This Node is shown to the user when the SpreadsheetView has no content to show.
|
javafx.beans.property.DoubleProperty |
rowHeaderWidth
This DoubleProperty represents the with of the rowHeader.
|
javafx.beans.property.BooleanProperty |
showColumnHeader
BooleanProperty associated with the column Header.
|
javafx.beans.property.BooleanProperty |
showRowHeader
BooleanProperty associated with the row Header.
|
javafx.beans.property.DoubleProperty |
zoomFactor
Return the zoomFactor used for the SpreadsheetView.
|
contextMenu, skinClassName, skin, tooltipbackground, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, impl_showMnemonics, impl_treeVisible, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, visible| Modifier and Type | Class and Description |
|---|---|
static class |
SpreadsheetView.ColumnWidthEvent
This event is thrown on the SpreadsheetView when the user resize a column
with its mouse.
|
static class |
SpreadsheetView.RowHeightEvent
This event is thrown on the SpreadsheetView when the user resize a row
with its mouse.
|
static class |
SpreadsheetView.SpanType
The SpanType describes in which state each cell can be.
|
| Constructor and Description |
|---|
SpreadsheetView()
This constructor will generate sample Grid with 100 rows and 15 columns.
|
SpreadsheetView(Grid grid)
Creates a SpreadsheetView control with the
Grid specified. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areColumnsFixable(java.util.List<? extends java.lang.Integer> list)
This method is the same as
areSpreadsheetColumnsFixable(java.util.List) but is using a List of SpreadsheetColumn indexes. |
boolean |
areRowsFixable(java.util.List<? extends java.lang.Integer> list)
Indicates whether a List of rows can be frozen or not.
|
boolean |
areSpreadsheetColumnsFixable(java.util.List<? extends SpreadsheetColumn> list)
Indicates whether a List of
SpreadsheetColumn can be fixed or
not. |
javafx.beans.property.ObjectProperty<java.util.Comparator<? super javafx.collections.ObservableList<SpreadsheetCell>>> |
comparatorProperty()
Return an ObjectProperty wrapping the comparator used in the
SpreadsheetView.
|
void |
copyClipboard()
Put the current selection into the ClipBoard.
|
void |
decrementZoom()
Decrement the level of zoom by 0.10.
|
void |
deleteSelectedCells()
This method is called when pressing the "delete" key on the
SpreadsheetView.
|
void |
edit(int row,
SpreadsheetColumn column)
Causes the cell at the given row/column view indexes to switch into
its editing state, if it is not already in it, and assuming that the
SpreadsheetView and column are also editable.
|
javafx.beans.property.BooleanProperty |
editableProperty()
Specifies whether this SpreadsheetView is editable - only if the
SpreadsheetView, and the
SpreadsheetCell within it are both
editable will a SpreadsheetCell be able to go into its editing
state. |
javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.control.TablePosition<javafx.collections.ObservableList<SpreadsheetCell>,?>> |
editingCellProperty()
Represents the current cell being edited, or null if there is no cell
being edited.
|
javafx.beans.property.ReadOnlyBooleanProperty |
fixingColumnsAllowedProperty()
Return the Boolean property associated with the allowance of freezing or
unfreezing some columns.
|
javafx.beans.property.ReadOnlyBooleanProperty |
fixingRowsAllowedProperty()
Return the Boolean property associated with the allowance of freezing or
unfreezing some rows.
|
CellGraphicFactory |
getCellGraphicFactory()
Returns the CellGraphicFactory if set that provide implementation for
browser in
SpreadsheetCell. |
javafx.collections.ObservableMap<java.lang.Integer,Picker> |
getColumnPickers() |
javafx.collections.ObservableList<SpreadsheetColumn> |
getColumns()
Return an ObservableList of the
SpreadsheetColumn used. |
int |
getColumnSpan(SpreadsheetCell cell)
Return the current column span of a Cell considering all hidden columns.
|
java.util.Comparator |
getComparator()
Return the comparator used in the
SortedList for the
SpreadsheetView. |
javafx.scene.control.TablePosition<javafx.collections.ObservableList<SpreadsheetCell>,?> |
getEditingCell()
Return a
TablePosition of cell being currently edited. |
java.util.Optional<SpreadsheetCellEditor> |
getEditor(SpreadsheetCellType<?> cellType)
Return the editor associated with the CellType.
|
int |
getFilteredRow()
Return the row where the
Filter will be shown. |
int |
getFilteredRow(int modelRow)
Given a row index base on the
Grid, return the index used in the
SpreadsheetView. |
int |
getFilteredSourceIndex(int viewRow)
Given an index on the SpreadsheetView, it will return the model row by
simply considering the hidden rows (and not the actual sort if any).
|
javafx.collections.ObservableList<SpreadsheetColumn> |
getFixedColumns()
You can freeze or unfreeze a column by modifying this list.
|
javafx.collections.ObservableList<java.lang.Integer> |
getFixedRows()
You can freeze or unfreeze a row by modifying this list.
|
Grid |
getGrid()
Return the model Grid used by the SpreadsheetView
|
double |
getHBarValue()
Return the value of the horizontal scrollbar.
|
java.util.BitSet |
getHiddenColumns()
Return a BitSet of the Hidden columns, where true means the column is
hidden.
|
java.util.BitSet |
getHiddenRows()
Return a BitSet of the Hidden rows, where true means the row is hidden.
|
javafx.collections.ObservableList<javafx.collections.ObservableList<SpreadsheetCell>> |
getItems()
Return the current list of rows set in the SpreadsheetView as they appear
on the screen.
|
int |
getModelColumn(int viewColumn)
Given a column index based on the visible column list, for example when
dealing with
TablePosition.getColumn(). |
int |
getModelRow(int viewRow)
Given an index on the
SpreadsheetView, return a Grid
index it is related to. |
javafx.scene.Node |
getPlaceholder()
Gets the value of the placeholder property.
|
int |
getReverseRowSpan(SpreadsheetCell cell,
int index)
Return the exact opposite of
getRowSpan(org.controlsfx.control.spreadsheet.SpreadsheetCell, int). |
double |
getRowHeaderWidth() |
double |
getRowHeight(int row) |
javafx.collections.ObservableMap<java.lang.Integer,Picker> |
getRowPickers() |
int |
getRowSpan(SpreadsheetCell cell,
int index)
Return the current row span for the given cell at the given position in
the Table.
|
int |
getRowSpanFilter(SpreadsheetCell cell)
Return the row span for the given cell without considering the actual
sort.
|
SpreadsheetViewSelectionModel |
getSelectionModel()
Return the selectionModel used by the SpreadsheetView.
|
SpreadsheetView.SpanType |
getSpanType(int rowIndex,
int modelColumn)
Return the
SpreadsheetView.SpanType of a cell. |
javafx.scene.control.ContextMenu |
getSpreadsheetViewContextMenu()
Create a menu on rightClick with two options: Copy/Paste This can be
overridden by developers for custom behavior.
|
double |
getVBarValue()
Return the value of the vertical scrollbar.
|
int |
getViewColumn(int modelColumn)
Given a column index based on the
getColumns() list, return an
index based on the visible columns in the SpreadsheetView. |
int |
getViewRow(int modelRow)
Given the row of a
SpreadsheetCell, returns the actual row as displayed
in the SpreadsheetView. |
java.lang.Double |
getZoomFactor()
Return the zoomFactor used for the SpreadsheetView.
|
javafx.beans.property.ReadOnlyObjectProperty<Grid> |
gridProperty()
Return a
ReadOnlyObjectProperty containing the current Grid
used in the SpreadsheetView. |
javafx.beans.property.ObjectProperty<java.util.BitSet> |
hiddenColumnsProperty()
Return the Objectproperty wrapping the hidden columns.
|
javafx.beans.property.ObjectProperty<java.util.BitSet> |
hiddenRowsProperty()
Return the Objectproperty wrapping the hidden rows..
|
void |
hideColumn(SpreadsheetColumn column)
Hide the specified
SpreadsheetColumn. |
void |
hideRow(int row)
Hide the specified row.
|
void |
incrementZoom()
Increment the level of zoom by 0.10.
|
boolean |
isColumnFixable(int columnIndex)
Indicate whether this column can be frozen or not.
|
boolean |
isColumnHidden(int column)
Return true if this column index (regarding to
getColumns() is
hidden. |
boolean |
isEditable()
Gets the value of the property editable.
|
boolean |
isFixingColumnsAllowed()
Return whether change to frozen columns are allowed.
|
boolean |
isFixingRowsAllowed()
Return whether change to frozen rows are allowed.
|
boolean |
isRowFixable(int row)
Indicate whether a row can be frozen or not.
|
boolean |
isRowHidden(int row)
Return true is this row is hidden.
|
boolean |
isShowColumnHeader()
Return if the Column Header is showing.
|
boolean |
isShowRowHeader()
Return if the row Header is showing.
|
protected void |
layoutChildren()
* Public Methods * *
|
void |
pasteClipboard()
Try to paste the clipBoard to the specified position.
|
javafx.beans.property.ObjectProperty<javafx.scene.Node> |
placeholderProperty()
This Node is shown to the user when the SpreadsheetView has no content to show.
|
void |
resizeRowsToDefault()
This method will wipe all changes made to the row's height and set all row's
height back to their default height defined in the model Grid.
|
void |
resizeRowsToFitContent()
This method will compute the best height for each line.
|
void |
resizeRowsToMaximum()
This method will first apply
resizeRowsToFitContent() and then
take the highest height and apply it to every row.\n
Just as resizeRowsToFitContent(), this method can be degrading
your performance on great grid. |
javafx.beans.property.DoubleProperty |
rowHeaderWidthProperty()
This DoubleProperty represents the with of the rowHeader.
|
void |
scrollToColumn(SpreadsheetColumn column)
Scrolls the SpreadsheetView so that the given
SpreadsheetColumn is visible. |
void |
scrollToColumnIndex(int modelColumn)
Scrolls the SpreadsheetView so that the given column index is visible.
|
void |
scrollToRow(int row)
Scrolls the
SpreadsheetView so that the given row is visible. |
void |
setCellGraphicFactory(CellGraphicFactory cellGraphicFactory)
Sets the CellGraphicFactory that will provide an implementation for cell
that have
SpreadsheetCell.isCellGraphic() set to true. |
void |
setComparator(java.util.Comparator<javafx.collections.ObservableList<SpreadsheetCell>> comparator)
Sets a new Comparator for the SpreadsheetView in order to sort the rows.
|
void |
setEditable(boolean b)
Sets the value of the property editable.
|
void |
setFilteredRow(java.lang.Integer row)
|
void |
setFixingColumnsAllowed(boolean b)
If set to true, user will be allowed to freeze and unfreeze the columns.
|
void |
setFixingRowsAllowed(boolean b)
If set to true, user will be allowed to freeze and unfreeze the rows.
|
void |
setGrid(Grid grid)
Set a new Grid for the SpreadsheetView.
|
void |
setHBarValue(double value)
Same method as
ScrollBar.setValue(double) on the verticalBar. |
void |
setHiddenColumns(java.util.BitSet hiddenColumns)
Give a complete new BitSet of the hidden columns.
|
void |
setHiddenRows(java.util.BitSet hiddenRows)
Give a complete new BitSet of the hidden rows.
|
void |
setPlaceholder(javafx.scene.Node placeholder)
Sets the value of the placeholder property
|
void |
setRowHeaderWidth(double value)
Specify a new width for the row header.
|
void |
setShowColumnHeader(boolean b)
Activate and deactivate the Column Header
|
void |
setShowRowHeader(boolean b)
Activate and deactivate the Row Header.
|
void |
setVBarValue(double value)
Same method as
ScrollBar.setValue(double) on the verticalBar. |
void |
setZoomFactor(java.lang.Double zoomFactor)
Set a new zoomFactor for the SpreadsheetView.
|
void |
showColumn(SpreadsheetColumn column)
Show the specified
SpreadsheetColumn. |
javafx.beans.property.BooleanProperty |
showColumnHeaderProperty()
BooleanProperty associated with the column Header.
|
void |
showRow(int row)
Show the specified row.
|
javafx.beans.property.BooleanProperty |
showRowHeaderProperty()
BooleanProperty associated with the row Header.
|
javafx.beans.property.DoubleProperty |
zoomFactorProperty()
Return the zoomFactor used for the SpreadsheetView.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getSkin, getTooltip, impl_cssGetFocusTraversableInitialValue, impl_processCSS, isResizable, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipPropertybackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthPropertygetChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBoundsaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visiblePropertypublic final javafx.beans.property.ObjectProperty<java.util.BitSet> hiddenRowsProperty
getHiddenRows(),
setHiddenRows(BitSet)public final javafx.beans.property.ObjectProperty<java.util.BitSet> hiddenColumnsProperty
getHiddenColumns(),
setHiddenColumns(BitSet)public final javafx.beans.property.DoubleProperty zoomFactorProperty
getZoomFactor(),
setZoomFactor(Double)public javafx.beans.property.ObjectProperty<java.util.Comparator<? super javafx.collections.ObservableList<SpreadsheetCell>>> comparatorProperty
getComparator(),
setComparator(Comparator)public javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.control.TablePosition<javafx.collections.ObservableList<SpreadsheetCell>,?>> editingCellProperty
getEditingCell()public final javafx.beans.property.ReadOnlyObjectProperty<Grid> gridProperty
ReadOnlyObjectProperty containing the current Grid
used in the SpreadsheetView.getGrid(),
setGrid(Grid)public javafx.beans.property.ReadOnlyBooleanProperty fixingRowsAllowedProperty
public javafx.beans.property.ReadOnlyBooleanProperty fixingColumnsAllowedProperty
public final javafx.beans.property.BooleanProperty showColumnHeaderProperty
isShowColumnHeader(),
setShowColumnHeader(boolean)public final javafx.beans.property.BooleanProperty showRowHeaderProperty
isShowRowHeader(),
setShowRowHeader(boolean)public final javafx.beans.property.DoubleProperty rowHeaderWidthProperty
public final javafx.beans.property.BooleanProperty editableProperty
SpreadsheetCell within it are both
editable will a SpreadsheetCell be able to go into its editing
state.isEditable(),
setEditable(boolean)public final javafx.beans.property.ObjectProperty<javafx.scene.Node> placeholderProperty
getPlaceholder(),
setPlaceholder(Node)public SpreadsheetView()
SpreadsheetCellType.STRING).public void setCellGraphicFactory(CellGraphicFactory cellGraphicFactory)
SpreadsheetCell.isCellGraphic() set to true.cellGraphicFactory - the CellGraphicFactorypublic CellGraphicFactory getCellGraphicFactory()
SpreadsheetCell.protected void layoutChildren()
layoutChildren in class javafx.scene.control.Controlpublic boolean isRowHidden(int row)
row - public java.util.BitSet getHiddenRows()
public final javafx.beans.property.ObjectProperty<java.util.BitSet> hiddenRowsProperty()
getHiddenRows(),
setHiddenRows(BitSet)public void setHiddenRows(java.util.BitSet hiddenRows)
Grid.getRowCount().hiddenRows - public void setHiddenColumns(java.util.BitSet hiddenColumns)
() .hiddenColumns - public boolean isColumnHidden(int column)
getColumns() is
hidden.column - getColumns() is
hidden.public java.util.BitSet getHiddenColumns()
public final javafx.beans.property.ObjectProperty<java.util.BitSet> hiddenColumnsProperty()
getHiddenColumns(),
setHiddenColumns(BitSet)public int getFilteredRow()
Filter will be shown. The row is based
on the Grid indexes.
Return -1 if no row is set for the filters.Filter will be shown.public void setFilteredRow(java.lang.Integer row)
row - public void hideRow(int row)
row - public void hideColumn(SpreadsheetColumn column)
SpreadsheetColumn.column - public void showRow(int row)
row - public void showColumn(SpreadsheetColumn column)
SpreadsheetColumn.column - public int getFilteredRow(int modelRow)
Grid, return the index used in the
SpreadsheetView. Beware ,if the row is hidden, the returned index is not
relevant because no row is assigned to it.modelRow - public int getViewColumn(int modelColumn)
getColumns() list, return an
index based on the visible columns in the SpreadsheetView.modelColumn - public int getModelColumn(int viewColumn)
TablePosition.getColumn(). It returns an index
based on the getColumns() list of the SpreadsheetView.viewColumn - getColumns() list of the
SpreadsheetView.public int getViewRow(int modelRow)
SpreadsheetCell, returns the actual row as displayed
in the SpreadsheetView. Beware as it can be a time-consuming operation.
Also, calling this method on a row that it hidden will return incoherent
information.modelRow - the row retrieved in SpreadsheetCell.getRow()public int getModelRow(int viewRow)
SpreadsheetView, return a Grid
index it is related to.viewRow - a row index based on the SpreadsheetViewGrid index it is related to.public int getFilteredSourceIndex(int viewRow)
Grid. Thus calling this
method with the number 2 will give you the number 3.viewRow - public int getRowSpan(SpreadsheetCell cell, int index)
SpreadsheetCell.getRowSpan().cell - the considered SpreadsheetCellindex - the current row position of this cellpublic int getReverseRowSpan(SpreadsheetCell cell, int index)
getRowSpan(org.controlsfx.control.spreadsheet.SpreadsheetCell, int). If a cell is spanned on rows, and the index given is the last one of
the spanned zone, it's rowSpan will be 1 and its reverse rowspan will be SpreadsheetCell.getRowSpan().cell - the considered SpreadsheetCellindex - the current row position of this cellpublic int getRowSpanFilter(SpreadsheetCell cell)
cell - public javafx.collections.ObservableList<javafx.collections.ObservableList<SpreadsheetCell>> getItems()
public int getColumnSpan(SpreadsheetCell cell)
cell - public final java.lang.Double getZoomFactor()
public final void setZoomFactor(java.lang.Double zoomFactor)
zoomFactor - public final javafx.beans.property.DoubleProperty zoomFactorProperty()
getZoomFactor(),
setZoomFactor(Double)public void incrementZoom()
public void decrementZoom()
public void edit(int row,
SpreadsheetColumn column)
Note: This method will cancel editing if the given row value is less than zero and the given column is null.
row - column - public java.util.Comparator getComparator()
SortedList for the
SpreadsheetView.SortedList for the
SpreadsheetView.public javafx.beans.property.ObjectProperty<java.util.Comparator<? super javafx.collections.ObservableList<SpreadsheetCell>>> comparatorProperty()
getComparator(),
setComparator(Comparator)public void setComparator(java.util.Comparator<javafx.collections.ObservableList<SpreadsheetCell>> comparator)
comparator - the comparator that will sort the rows.public final void setGrid(Grid grid)
SpreadsheetView(Grid). So this is useful when you want to
refresh your SpreadsheetView with a new model. This will keep the state
of your SpreadsheetView (position of the bar, number of frozen rows etc).grid - the new Gridpublic javafx.scene.control.TablePosition<javafx.collections.ObservableList<SpreadsheetCell>,?> getEditingCell()
TablePosition of cell being currently edited.TablePosition of cell being currently edited.public javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.control.TablePosition<javafx.collections.ObservableList<SpreadsheetCell>,?>> editingCellProperty()
getEditingCell()public final javafx.collections.ObservableList<SpreadsheetColumn> getColumns()
SpreadsheetColumn used. This list
is filled automatically by the SpreadsheetView. Adding and removing
columns should be done in the model Grid.SpreadsheetColumnpublic final Grid getGrid()
public final javafx.beans.property.ReadOnlyObjectProperty<Grid> gridProperty()
ReadOnlyObjectProperty containing the current Grid
used in the SpreadsheetView.getGrid(),
setGrid(Grid)public javafx.collections.ObservableList<java.lang.Integer> getFixedRows()
isRowFixable(int) before trying to freeze a row. See
SpreadsheetView description for information.public boolean isRowFixable(int row)
getFixedRows() .
A row cannot be frozen alone if any cell inside the row has a row span
superior to one.row - public boolean areRowsFixable(java.util.List<? extends java.lang.Integer> list)
list - public boolean isFixingRowsAllowed()
public void setFixingRowsAllowed(boolean b)
b - public javafx.beans.property.ReadOnlyBooleanProperty fixingRowsAllowedProperty()
public javafx.collections.ObservableList<SpreadsheetColumn> getFixedColumns()
SpreadsheetColumn.isColumnFixable() on the column before adding
an item.public boolean isColumnFixable(int columnIndex)
SpreadsheetColumn, call
SpreadsheetColumn.isColumnFixable() on it directly. Call that
method before adding an item with getFixedColumns() .columnIndex - public boolean areSpreadsheetColumnsFixable(java.util.List<? extends SpreadsheetColumn> list)
SpreadsheetColumn can be fixed or
not.
A set of columns cannot be frozen if any cell inside these columns has a
column span superior to the number of frozen columns.list - public boolean areColumnsFixable(java.util.List<? extends java.lang.Integer> list)
areSpreadsheetColumnsFixable(java.util.List) but is using a List of SpreadsheetColumn indexes.
A set of columns cannot be frozen if any cell inside these columns has a
column span superior to the number of frozen columns.list - public boolean isFixingColumnsAllowed()
public void setFixingColumnsAllowed(boolean b)
b - public javafx.beans.property.ReadOnlyBooleanProperty fixingColumnsAllowedProperty()
public final void setShowColumnHeader(boolean b)
b - public final boolean isShowColumnHeader()
public final javafx.beans.property.BooleanProperty showColumnHeaderProperty()
isShowColumnHeader(),
setShowColumnHeader(boolean)public final void setShowRowHeader(boolean b)
b - public final boolean isShowRowHeader()
public final javafx.beans.property.BooleanProperty showRowHeaderProperty()
isShowRowHeader(),
setShowRowHeader(boolean)public final javafx.beans.property.DoubleProperty rowHeaderWidthProperty()
public final void setRowHeaderWidth(double value)
value - public final double getRowHeaderWidth()
public javafx.collections.ObservableMap<java.lang.Integer,Picker> getRowPickers()
public javafx.collections.ObservableMap<java.lang.Integer,Picker> getColumnPickers()
public void resizeRowsToFitContent()
public void resizeRowsToMaximum()
resizeRowsToFitContent() and then
take the highest height and apply it to every row.\n
Just as resizeRowsToFitContent(), this method can be degrading
your performance on great grid.public void resizeRowsToDefault()
public double getRowHeight(int row)
row - public SpreadsheetViewSelectionModel getSelectionModel()
SpreadsheetViewSelectionModelpublic void scrollToRow(int row)
SpreadsheetView so that the given row is visible.
Beware, you must call getViewRow(int) before if you are using SpreadsheetCell.getRow() and the grid is sorted/filtered.row - the row to scroll topublic void setVBarValue(double value)
ScrollBar.setValue(double) on the verticalBar.value - public void setHBarValue(double value)
ScrollBar.setValue(double) on the verticalBar.value - public double getVBarValue()
ScrollBar.getValue()public double getHBarValue()
ScrollBar.getValue()public void scrollToColumn(SpreadsheetColumn column)
SpreadsheetColumn is visible.column - public void scrollToColumnIndex(int modelColumn)
modelColumn - public final java.util.Optional<SpreadsheetCellEditor> getEditor(SpreadsheetCellType<?> cellType)
SpreadsheetCellType.createEditor(SpreadsheetView). FIXME Maybe
keep the editor references inside the SpreadsheetCellTypecellType - public final void setEditable(boolean b)
b - public final boolean isEditable()
public final javafx.beans.property.BooleanProperty editableProperty()
SpreadsheetCell within it are both
editable will a SpreadsheetCell be able to go into its editing
state.isEditable(),
setEditable(boolean)public final javafx.beans.property.ObjectProperty<javafx.scene.Node> placeholderProperty()
getPlaceholder(),
setPlaceholder(Node)public final void setPlaceholder(javafx.scene.Node placeholder)
placeholder - the node to show when the SpreadsheetView has no content to show.public final javafx.scene.Node getPlaceholder()
public void copyClipboard()
public void pasteClipboard()
public javafx.scene.control.ContextMenu getSpreadsheetViewContextMenu()
public void deleteSelectedCells()
public SpreadsheetView.SpanType getSpanType(int rowIndex, int modelColumn)
SpreadsheetView.SpanType of a cell. This is used internally by the
SpreadsheetView but some users may find it useful.rowIndex - modelColumn - SpreadsheetView.SpanType of a cell