- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- org.controlsfx.control.spreadsheet.SpreadsheetView
-
- All Implemented Interfaces:
Styleable
,EventTarget
,Skinnable
public class SpreadsheetView extends Control
The SpreadsheetView is a control similar to the JavaFXTableView
control but with different functionalities and use cases. The aim is to have a powerful grid where data can be written and retrieved.Features
- Cells can span in row and in column.
- Rows can be frozen to the top of the
SpreadsheetView
so that they are always visible on screen. - Columns can be frozen to the left of the
SpreadsheetView
so that they are always visible on screen. - A row header can be switched on in order to display the row number.
- Rows can be resized just like columns with click & drag.
- Both row and column header can be visible or invisible.
- Selection of several cells can be made with a click and drag.
- A copy/paste context menu is accessible with a right-click. The usual shortcuts are also working.
Picker
can be placed above column header or to the side of the row header.- Rows and columns can be hidden (like Excel grouping).
- Zoom in and out in order for the SpreadsheetView to fit on a monitor.
- Rows can be sorted using a
Comparator
.
Freezing Rows and Columns
You can freeze some rows and some columns by right-clicking on their header. A context menu will appear if it's possible to freeze them. When frozen, the label header will then be in italic and the background will turn to dark grey.
You have also the possibility to freeze them manually by adding and removing items fromgetFixedRows()
andgetFixedColumns()
. But you are strongly advised to check if it's possible to do so withSpreadsheetColumn.isColumnFixable()
for the frozen columns and withisRowFixable(int)
for the frozen rows.
A set of rows cannot be frozen if any cell inside these rows has a row span superior to the number of frozen rows. Likewise, a set of columns cannot be frozen if any cell inside these columns has a column span superior to the number of frozen columns.
If you want to freeze several rows or columns together, and they have a span inside, you can callareRowsFixable(java.util.List)
orareSpreadsheetColumnsFixable(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.
You have also the possibility to deactivate these possibilities. For example, you force some row/column to be frozen and then the user cannot change the settings.
Headers
You can also access and toggle header's visibility by using the methods provided likesetShowRowHeader(boolean)
orsetShowColumnHeader(boolean)
.
Users can double-click on a column header will resize the column to the best size in order to fully see each cell in it. Same rule apply for row header. Also note that double-clicking on the little space between two row or two columns (when resizable) will also work just like Excel.Pickers
You can show some little images next to the headers. They will appear on the left of the VerticalHeader and on top on the HorizontalHeader. They are called "picker" because they were used originally for picking a row or a column to insert in the SpreadsheetView.
But you can do anything you want with it. Simply put a row or a column index ingetRowPickers()
andgetColumnPickers()
along with an instance ofPicker
. You can override thePicker.onClick()
method in order to react when the user click on the picker.
The pickers will appear on the top of the column's header and on the left of the row's header.
For example, here is a picker displayed for a row that allow to group rows like Excel:
Once we clicked on the picker (minus sign), the rows are hidden.
Here is the code related to the images :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);
Copy pasting
You can copy any cell you want and paste it elsewhere. Be aware that only the value inside will be pasted, not the style nor the type. Thus the value you're trying to paste must be compatible with theSpreadsheetCellType
of the receiving cell. Pasting a Double into a String will work but the reverse operation will not.
SeeSpreadsheetCellType
Value Verification documentation for more information.
A unique cell or a selection can be copied and pasted.
Hiding rows and columns
Rows and columns can be hidden if you need to. Simply call
showRow(int)
orhideRow(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 usingsetHiddenRows(java.util.BitSet)
. TheBitSet
represent all your rows/columns and the bit associated to it represent its visibility.Zoom
The SpreadsheetView offers the possibility to zoom in or out. This is useful when you have a second monitor and you want your whole grid to fit in. Or when you want to draw the attention on a particular portion of the grid.
You can modify the zoom factor by playing withsetZoomFactor(java.lang.Double)
. We recommend using value between 2 and 0.1.
Also note that the SpreadsheetView is configured to react when CTRL + and CTRL - are triggered by, respectively, zooming in and zooming out by 10%. Also CTRL 0 will bring the zoom back to default (1).Code Samples
Just like theTableView
, you instantiate the underlying model, aGrid
. You will create some rows filled withSpreadsheetCell
.
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.
Visual:
- See Also:
SpreadsheetCell
,SpreadsheetCellBase
,SpreadsheetColumn
,Grid
,GridBase
,Picker
-
-
Property Summary
Properties Type Property Description ObjectProperty<Comparator<? super ObservableList<SpreadsheetCell>>>
comparator
Return an ObjectProperty wrapping the comparator used in the SpreadsheetView.BooleanProperty
editable
Specifies whether this SpreadsheetView is editable - only if the SpreadsheetView, and theSpreadsheetCell
within it are both editable will aSpreadsheetCell
be able to go into its editing state.ReadOnlyObjectProperty<TablePosition<ObservableList<SpreadsheetCell>,?>>
editingCell
Represents the current cell being edited, or null if there is no cell being edited.ReadOnlyBooleanProperty
fixingColumnsAllowed
Return the Boolean property associated with the allowance of freezing or unfreezing some columns.ReadOnlyBooleanProperty
fixingRowsAllowed
Return the Boolean property associated with the allowance of freezing or unfreezing some rows.ReadOnlyObjectProperty<Grid>
grid
Return aReadOnlyObjectProperty
containing the current Grid used in the SpreadsheetView.ObjectProperty<BitSet>
hiddenColumns
Return the Objectproperty wrapping the hidden columns.ObjectProperty<BitSet>
hiddenRows
Return the Objectproperty wrapping the hidden rows..ObjectProperty<Node>
placeholder
This Node is shown to the user when the SpreadsheetView has no content to show.DoubleProperty
rowHeaderWidth
This DoubleProperty represents the width of the rowHeader.BooleanProperty
showColumnHeader
BooleanProperty associated with the column Header.BooleanProperty
showRowHeader
BooleanProperty associated with the row Header.DoubleProperty
zoomFactor
Return the zoomFactor used for the SpreadsheetView.-
Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltip
-
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
-
Properties inherited from class javafx.scene.Parent
needsLayout
-
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, 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, viewOrder, visible
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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.
-
Field Summary
-
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
-
Constructor Summary
Constructors Constructor Description SpreadsheetView()
This constructor will generate sample Grid with 100 rows and 15 columns.SpreadsheetView(Grid grid)
Creates a SpreadsheetView control with theGrid
specified.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areColumnsFixable(List<? extends Integer> list)
This method is the same asareSpreadsheetColumnsFixable(java.util.List)
but is using a List ofSpreadsheetColumn
indexes.boolean
areRowsFixable(List<? extends Integer> list)
Indicates whether a List of rows can be frozen or not.boolean
areSpreadsheetColumnsFixable(List<? extends SpreadsheetColumn> list)
Indicates whether a List ofSpreadsheetColumn
can be fixed or not.ObjectProperty<Comparator<? super 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.BooleanProperty
editableProperty()
Specifies whether this SpreadsheetView is editable - only if the SpreadsheetView, and theSpreadsheetCell
within it are both editable will aSpreadsheetCell
be able to go into its editing state.ReadOnlyObjectProperty<TablePosition<ObservableList<SpreadsheetCell>,?>>
editingCellProperty()
Represents the current cell being edited, or null if there is no cell being edited.ReadOnlyBooleanProperty
fixingColumnsAllowedProperty()
Return the Boolean property associated with the allowance of freezing or unfreezing some columns.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 inSpreadsheetCell
.ObservableMap<Integer,Picker>
getColumnPickers()
ObservableList<SpreadsheetColumn>
getColumns()
Return an ObservableList of theSpreadsheetColumn
used.int
getColumnSpan(SpreadsheetCell cell)
Return the current column span of a Cell considering all hidden columns.Comparator
getComparator()
Return the comparator used in theSortedList
for the SpreadsheetView.TablePosition<ObservableList<SpreadsheetCell>,?>
getEditingCell()
Return aTablePosition
of cell being currently edited.Optional<SpreadsheetCellEditor>
getEditor(SpreadsheetCellType<?> cellType)
Return the editor associated with the CellType.int
getFilteredRow()
Return the row where theFilter
will be shown.int
getFilteredRow(int modelRow)
Given a row index base on theGrid
, 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).ObservableList<SpreadsheetColumn>
getFixedColumns()
You can freeze or unfreeze a column by modifying this list.ObservableList<Integer>
getFixedRows()
You can freeze or unfreeze a row by modifying this list.Grid
getGrid()
Return the model Grid used by the SpreadsheetViewdouble
getHBarValue()
Return the value of the horizontal scrollbar.BitSet
getHiddenColumns()
Return a BitSet of the Hidden columns, where true means the column is hidden.BitSet
getHiddenRows()
Return a BitSet of the Hidden rows, where true means the row is hidden.ObservableList<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 withTablePosition.getColumn()
.int
getModelRow(int viewRow)
Given an index on theSpreadsheetView
, return aGrid
index it is related to.Node
getPlaceholder()
Gets the value of the placeholder property.int
getReverseRowSpan(SpreadsheetCell cell, int index)
Return the exact opposite ofgetRowSpan(org.controlsfx.control.spreadsheet.SpreadsheetCell, int)
.double
getRowHeaderWidth()
double
getRowHeight(int row)
ObservableMap<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 theSpreadsheetView.SpanType
of a cell.ContextMenu
getSpreadsheetViewContextMenu()
Create a menu on rightClick with two options: Copy/Paste This can be overridden by developers for custom behavior.String
getUserAgentStylesheet()
double
getVBarValue()
Return the value of the vertical scrollbar.int
getViewColumn(int modelColumn)
Given a column index based on thegetColumns()
list, return an index based on the visible columns in the SpreadsheetView.int
getViewRow(int modelRow)
Given the row of aSpreadsheetCell
, returns the actual row as displayed in theSpreadsheetView
.Double
getZoomFactor()
Return the zoomFactor used for the SpreadsheetView.ReadOnlyObjectProperty<Grid>
gridProperty()
Return aReadOnlyObjectProperty
containing the current Grid used in the SpreadsheetView.ObjectProperty<BitSet>
hiddenColumnsProperty()
Return the Objectproperty wrapping the hidden columns.ObjectProperty<BitSet>
hiddenRowsProperty()
Return the Objectproperty wrapping the hidden rows..void
hideColumn(SpreadsheetColumn column)
Hide the specifiedSpreadsheetColumn
.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 togetColumns()
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.ObjectProperty<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 applyresizeRowsToFitContent()
and then take the highest height and apply it to every row.\n Just asresizeRowsToFitContent()
, this method can be degrading your performance on great grid.DoubleProperty
rowHeaderWidthProperty()
This DoubleProperty represents the width of the rowHeader.void
scrollToColumn(SpreadsheetColumn column)
Scrolls the SpreadsheetView so that the givenSpreadsheetColumn
is visible.void
scrollToColumnIndex(int modelColumn)
Scrolls the SpreadsheetView so that the given column index is visible.void
scrollToRow(int row)
Scrolls theSpreadsheetView
so that the given row is visible.void
setCellGraphicFactory(CellGraphicFactory cellGraphicFactory)
Sets the CellGraphicFactory that will provide an implementation for cell that haveSpreadsheetCell.isCellGraphic()
set totrue
.void
setComparator(Comparator<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(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 asScrollBar.setValue(double)
on the verticalBar.void
setHiddenColumns(BitSet hiddenColumns)
Give a complete new BitSet of the hidden columns.void
setHiddenRows(BitSet hiddenRows)
Give a complete new BitSet of the hidden rows.void
setPlaceholder(Node placeholder)
Sets the value of the placeholder propertyvoid
setRowHeaderWidth(double value)
Specify a new width for the row header.void
setShowColumnHeader(boolean b)
Activate and deactivate the Column Headervoid
setShowRowHeader(boolean b)
Activate and deactivate the Row Header.void
setVBarValue(double value)
Same method asScrollBar.setValue(double)
on the verticalBar.void
setZoomFactor(Double zoomFactor)
Set a new zoomFactor for the SpreadsheetView.void
showColumn(SpreadsheetColumn column)
Show the specifiedSpreadsheetColumn
.BooleanProperty
showColumnHeaderProperty()
BooleanProperty associated with the column Header.void
showRow(int row)
Show the specified row.BooleanProperty
showRowHeaderProperty()
BooleanProperty associated with the row Header.DoubleProperty
zoomFactorProperty()
Return the zoomFactor used for the SpreadsheetView.-
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, 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, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
-
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, 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, getInitialCursor, 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, getViewOrder, hasProperties, hoverProperty, idProperty, 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, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
-
-
-
Property Detail
-
hiddenRows
public final ObjectProperty<BitSet> hiddenRowsProperty
Return the Objectproperty wrapping the hidden rows..- See Also:
getHiddenRows()
,setHiddenRows(BitSet)
-
hiddenColumns
public final ObjectProperty<BitSet> hiddenColumnsProperty
Return the Objectproperty wrapping the hidden columns.- See Also:
getHiddenColumns()
,setHiddenColumns(BitSet)
-
zoomFactor
public final DoubleProperty zoomFactorProperty
Return the zoomFactor used for the SpreadsheetView.- See Also:
getZoomFactor()
,setZoomFactor(Double)
-
comparator
public ObjectProperty<Comparator<? super ObservableList<SpreadsheetCell>>> comparatorProperty
Return an ObjectProperty wrapping the comparator used in the SpreadsheetView.- See Also:
getComparator()
,setComparator(Comparator)
-
editingCell
public ReadOnlyObjectProperty<TablePosition<ObservableList<SpreadsheetCell>,?>> editingCellProperty
Represents the current cell being edited, or null if there is no cell being edited.- See Also:
getEditingCell()
-
grid
public final ReadOnlyObjectProperty<Grid> gridProperty
Return aReadOnlyObjectProperty
containing the current Grid used in the SpreadsheetView.- See Also:
getGrid()
,setGrid(Grid)
-
fixingRowsAllowed
public ReadOnlyBooleanProperty fixingRowsAllowedProperty
Return the Boolean property associated with the allowance of freezing or unfreezing some rows.
-
fixingColumnsAllowed
public ReadOnlyBooleanProperty fixingColumnsAllowedProperty
Return the Boolean property associated with the allowance of freezing or unfreezing some columns.
-
showColumnHeader
public final BooleanProperty showColumnHeaderProperty
BooleanProperty associated with the column Header.- See Also:
isShowColumnHeader()
,setShowColumnHeader(boolean)
-
showRowHeader
public final BooleanProperty showRowHeaderProperty
BooleanProperty associated with the row Header.- See Also:
isShowRowHeader()
,setShowRowHeader(boolean)
-
rowHeaderWidth
public final DoubleProperty rowHeaderWidthProperty
This DoubleProperty represents the width of the rowHeader. This is just representing the width of the Labels, not the pickers.- Returns:
- A DoubleProperty.
-
editable
public final BooleanProperty editableProperty
Specifies whether this SpreadsheetView is editable - only if the SpreadsheetView, and theSpreadsheetCell
within it are both editable will aSpreadsheetCell
be able to go into its editing state.- See Also:
isEditable()
,setEditable(boolean)
-
placeholder
public final ObjectProperty<Node> placeholderProperty
This Node is shown to the user when the SpreadsheetView has no content to show.- See Also:
getPlaceholder()
,setPlaceholder(Node)
-
-
Constructor Detail
-
SpreadsheetView
public SpreadsheetView()
This constructor will generate sample Grid with 100 rows and 15 columns. All cells are typed as String (seeSpreadsheetCellType.STRING
).
-
-
Method Detail
-
getUserAgentStylesheet
public String getUserAgentStylesheet()
- Overrides:
getUserAgentStylesheet
in classRegion
-
setCellGraphicFactory
public void setCellGraphicFactory(CellGraphicFactory cellGraphicFactory)
Sets the CellGraphicFactory that will provide an implementation for cell that haveSpreadsheetCell.isCellGraphic()
set totrue
.- Parameters:
cellGraphicFactory
- the CellGraphicFactory
-
getCellGraphicFactory
public CellGraphicFactory getCellGraphicFactory()
Returns the CellGraphicFactory if set that provide implementation for browser inSpreadsheetCell
.- Returns:
- the CellGraphicFactory
-
layoutChildren
protected void layoutChildren()
* Public Methods * *- Overrides:
layoutChildren
in classControl
-
isRowHidden
public boolean isRowHidden(int row)
Return true is this row is hidden.- Parameters:
row
-- Returns:
- true is this row is hidden.
-
getHiddenRows
public BitSet getHiddenRows()
Return a BitSet of the Hidden rows, where true means the row is hidden.- Returns:
- a BitSet of the Hidden rows, where true means the row is hidden.
-
hiddenRowsProperty
public final ObjectProperty<BitSet> hiddenRowsProperty()
Return the Objectproperty wrapping the hidden rows..- See Also:
getHiddenRows()
,setHiddenRows(BitSet)
-
setHiddenRows
public void setHiddenRows(BitSet hiddenRows)
Give a complete new BitSet of the hidden rows. The BitSet MUST have the size ofGrid.getRowCount()
.- Parameters:
hiddenRows
-
-
setHiddenColumns
public void setHiddenColumns(BitSet hiddenColumns)
Give a complete new BitSet of the hidden columns. The BitSet MUST have the size of()
.- Parameters:
hiddenColumns
-
-
isColumnHidden
public boolean isColumnHidden(int column)
Return true if this column index (regarding togetColumns()
is hidden.- Parameters:
column
-- Returns:
- true if this column index (regarding to
getColumns()
is hidden.
-
getHiddenColumns
public BitSet getHiddenColumns()
Return a BitSet of the Hidden columns, where true means the column is hidden.- Returns:
- a BitSet of the Hidden columns, where true means the column is hidden.
-
hiddenColumnsProperty
public final ObjectProperty<BitSet> hiddenColumnsProperty()
Return the Objectproperty wrapping the hidden columns.- See Also:
getHiddenColumns()
,setHiddenColumns(BitSet)
-
getFilteredRow
public int getFilteredRow()
Return the row where theFilter
will be shown. The row is based on theGrid
indexes. Return -1 if no row is set for the filters.- Returns:
- the row where the
Filter
will be shown.
-
setFilteredRow
public void setFilteredRow(Integer row)
- Parameters:
row
-
-
hideRow
public void hideRow(int row)
Hide the specified row.- Parameters:
row
-
-
hideColumn
public void hideColumn(SpreadsheetColumn column)
Hide the specifiedSpreadsheetColumn
.- Parameters:
column
-
-
showRow
public void showRow(int row)
Show the specified row.- Parameters:
row
-
-
showColumn
public void showColumn(SpreadsheetColumn column)
Show the specifiedSpreadsheetColumn
.- Parameters:
column
-
-
getFilteredRow
public int getFilteredRow(int modelRow)
Given a row index base on theGrid
, 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.- Parameters:
modelRow
-- Returns:
- the index used in the SpreadsheetView.
-
getViewColumn
public int getViewColumn(int modelColumn)
Given a column index based on thegetColumns()
list, return an index based on the visible columns in the SpreadsheetView.- Parameters:
modelColumn
-- Returns:
- an index based on the visible columns in the SpreadsheetView.
-
getModelColumn
public int getModelColumn(int viewColumn)
Given a column index based on the visible column list, for example when dealing withTablePosition.getColumn()
. It returns an index based on thegetColumns()
list of the SpreadsheetView.- Parameters:
viewColumn
-- Returns:
- an index based on the
getColumns()
list of the SpreadsheetView.
-
getViewRow
public int getViewRow(int modelRow)
Given the row of aSpreadsheetCell
, returns the actual row as displayed in theSpreadsheetView
. Beware as it can be a time-consuming operation. Also, calling this method on a row that it hidden will return incoherent information.- Parameters:
modelRow
- the row retrieved inSpreadsheetCell.getRow()
- Returns:
- the ViewRow if possible, -1 or another row if the row is hidden.
-
getModelRow
public int getModelRow(int viewRow)
Given an index on theSpreadsheetView
, return aGrid
index it is related to.- Parameters:
viewRow
- a row index based on theSpreadsheetView
- Returns:
- a
Grid
index it is related to.
-
getFilteredSourceIndex
public 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). If you hide the row 2, it means the row 2 in the SpreadsheetView will actually display the row 3 in the modelGrid
. Thus calling this method with the number 2 will give you the number 3.- Parameters:
viewRow
-- Returns:
- the model row
-
getRowSpan
public int getRowSpan(SpreadsheetCell cell, int index)
Return the current row span for the given cell at the given position in the Table. If a sort is applied to the SpreadsheetView, some spanned cells may be splitted thus explaining why this method can give a different value thanSpreadsheetCell.getRowSpan()
.- Parameters:
cell
- the consideredSpreadsheetCell
index
- the current row position of this cell- Returns:
- the current row span for the given cell
-
getReverseRowSpan
public int getReverseRowSpan(SpreadsheetCell cell, int index)
Return the exact opposite ofgetRowSpan(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 beSpreadsheetCell.getRowSpan()
.- Parameters:
cell
- the consideredSpreadsheetCell
index
- the current row position of this cell- Returns:
- the current reverse row span for the given cell
-
getRowSpanFilter
public int getRowSpanFilter(SpreadsheetCell cell)
Return the row span for the given cell without considering the actual sort. Only the hidden rows are considered.- Parameters:
cell
-- Returns:
- the row span for the given cell.
-
getItems
public ObservableList<ObservableList<SpreadsheetCell>> getItems()
Return the current list of rows set in the SpreadsheetView as they appear on the screen.- Returns:
- the current list of rows.
-
getColumnSpan
public int getColumnSpan(SpreadsheetCell cell)
Return the current column span of a Cell considering all hidden columns.- Parameters:
cell
-- Returns:
- the current column span of a Cell.
-
getZoomFactor
public final Double getZoomFactor()
Return the zoomFactor used for the SpreadsheetView.- Returns:
- the zoomFactor used for the SpreadsheetView.
-
setZoomFactor
public final void setZoomFactor(Double zoomFactor)
Set a new zoomFactor for the SpreadsheetView. Advice is not to go beyond 2 and below 0.1.- Parameters:
zoomFactor
-
-
zoomFactorProperty
public final DoubleProperty zoomFactorProperty()
Return the zoomFactor used for the SpreadsheetView.- See Also:
getZoomFactor()
,setZoomFactor(Double)
-
incrementZoom
public void incrementZoom()
Increment the level of zoom by 0.10. The base is 1 so we will try to stay of the intervals.
-
decrementZoom
public void decrementZoom()
Decrement the level of zoom by 0.10. It will block at 0.20. The base is 1 so we will try to stay of the intervals.
-
edit
public 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.Note: This method will cancel editing if the given row value is less than zero and the given column is null.
- Parameters:
row
-column
-
-
getComparator
public Comparator getComparator()
Return the comparator used in theSortedList
for the SpreadsheetView.- Returns:
- the comparator used in the
SortedList
for the SpreadsheetView.
-
comparatorProperty
public ObjectProperty<Comparator<? super ObservableList<SpreadsheetCell>>> comparatorProperty()
Return an ObjectProperty wrapping the comparator used in the SpreadsheetView.- See Also:
getComparator()
,setComparator(Comparator)
-
setComparator
public void setComparator(Comparator<ObservableList<SpreadsheetCell>> comparator)
Sets a new Comparator for the SpreadsheetView in order to sort the rows.- Parameters:
comparator
- the comparator that will sort the rows.
-
setGrid
public final void setGrid(Grid grid)
Set a new Grid for the SpreadsheetView. This will be called by default bySpreadsheetView(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).- Parameters:
grid
- the new Grid
-
getEditingCell
public TablePosition<ObservableList<SpreadsheetCell>,?> getEditingCell()
Return aTablePosition
of cell being currently edited.- Returns:
- a
TablePosition
of cell being currently edited.
-
editingCellProperty
public ReadOnlyObjectProperty<TablePosition<ObservableList<SpreadsheetCell>,?>> editingCellProperty()
Represents the current cell being edited, or null if there is no cell being edited.- See Also:
getEditingCell()
-
getColumns
public final ObservableList<SpreadsheetColumn> getColumns()
Return an ObservableList of theSpreadsheetColumn
used. This list is filled automatically by the SpreadsheetView. Adding and removing columns should be done in the modelGrid
.- Returns:
- An ObservableList of the
SpreadsheetColumn
-
getGrid
public final Grid getGrid()
Return the model Grid used by the SpreadsheetView- Returns:
- the model Grid used by the SpreadsheetView
-
gridProperty
public final ReadOnlyObjectProperty<Grid> gridProperty()
Return aReadOnlyObjectProperty
containing the current Grid used in the SpreadsheetView.- See Also:
getGrid()
,setGrid(Grid)
-
getFixedRows
public ObservableList<Integer> getFixedRows()
You can freeze or unfreeze a row by modifying this list. CallisRowFixable(int)
before trying to freeze a row. SeeSpreadsheetView
description for information.- Returns:
- an ObservableList of integer representing the frozen rows.
-
isRowFixable
public boolean isRowFixable(int row)
Indicate whether a row can be frozen or not. Call that method before adding an item withgetFixedRows()
. A row cannot be frozen alone if any cell inside the row has a row span superior to one.- Parameters:
row
-- Returns:
- true if the row can be frozen.
-
areRowsFixable
public boolean areRowsFixable(List<? extends Integer> list)
Indicates whether a List of rows can be frozen or not. A set of rows cannot be frozen if any cell inside these rows has a row span superior to the number of frozen rows.- Parameters:
list
-- Returns:
- true if the List of row can be frozen together.
-
isFixingRowsAllowed
public boolean isFixingRowsAllowed()
Return whether change to frozen rows are allowed.- Returns:
- whether change to frozen rows are allowed.
-
setFixingRowsAllowed
public void setFixingRowsAllowed(boolean b)
If set to true, user will be allowed to freeze and unfreeze the rows.- Parameters:
b
-
-
fixingRowsAllowedProperty
public ReadOnlyBooleanProperty fixingRowsAllowedProperty()
Return the Boolean property associated with the allowance of freezing or unfreezing some rows.
-
getFixedColumns
public ObservableList<SpreadsheetColumn> getFixedColumns()
You can freeze or unfreeze a column by modifying this list. CallSpreadsheetColumn.isColumnFixable()
on the column before adding an item.- Returns:
- an ObservableList of the frozen columns.
-
isColumnFixable
public boolean isColumnFixable(int columnIndex)
Indicate whether this column can be frozen or not. If you have aSpreadsheetColumn
, callSpreadsheetColumn.isColumnFixable()
on it directly. Call that method before adding an item withgetFixedColumns()
.- Parameters:
columnIndex
-- Returns:
- true if the column if freezable
-
areSpreadsheetColumnsFixable
public boolean areSpreadsheetColumnsFixable(List<? extends SpreadsheetColumn> list)
Indicates whether a List ofSpreadsheetColumn
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.- Parameters:
list
-- Returns:
- true if the List of columns can be frozen together.
-
areColumnsFixable
public boolean areColumnsFixable(List<? extends Integer> list)
This method is the same asareSpreadsheetColumnsFixable(java.util.List)
but is using a List ofSpreadsheetColumn
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.- Parameters:
list
-- Returns:
- true if the List of columns can be frozen together.
-
isFixingColumnsAllowed
public boolean isFixingColumnsAllowed()
Return whether change to frozen columns are allowed.- Returns:
- whether change to frozen columns are allowed.
-
setFixingColumnsAllowed
public void setFixingColumnsAllowed(boolean b)
If set to true, user will be allowed to freeze and unfreeze the columns.- Parameters:
b
-
-
fixingColumnsAllowedProperty
public ReadOnlyBooleanProperty fixingColumnsAllowedProperty()
Return the Boolean property associated with the allowance of freezing or unfreezing some columns.
-
setShowColumnHeader
public final void setShowColumnHeader(boolean b)
Activate and deactivate the Column Header- Parameters:
b
-
-
isShowColumnHeader
public final boolean isShowColumnHeader()
Return if the Column Header is showing.- Returns:
- a boolean telling whether the column Header is shown
-
showColumnHeaderProperty
public final BooleanProperty showColumnHeaderProperty()
BooleanProperty associated with the column Header.- See Also:
isShowColumnHeader()
,setShowColumnHeader(boolean)
-
setShowRowHeader
public final void setShowRowHeader(boolean b)
Activate and deactivate the Row Header.- Parameters:
b
-
-
isShowRowHeader
public final boolean isShowRowHeader()
Return if the row Header is showing.- Returns:
- a boolean telling if the row Header is being shown
-
showRowHeaderProperty
public final BooleanProperty showRowHeaderProperty()
BooleanProperty associated with the row Header.- See Also:
isShowRowHeader()
,setShowRowHeader(boolean)
-
rowHeaderWidthProperty
public final DoubleProperty rowHeaderWidthProperty()
This DoubleProperty represents the width of the rowHeader. This is just representing the width of the Labels, not the pickers.- Returns:
- A DoubleProperty.
-
setRowHeaderWidth
public final void setRowHeaderWidth(double value)
Specify a new width for the row header.- Parameters:
value
-
-
getRowHeaderWidth
public final double getRowHeaderWidth()
- Returns:
- the current width of the row header.
-
getRowPickers
public ObservableMap<Integer,Picker> getRowPickers()
- Returns:
- An ObservableMap with the row index as key and the Picker as a value.
-
getColumnPickers
public ObservableMap<Integer,Picker> getColumnPickers()
- Returns:
- An ObservableMap with the column index as key and the Picker as a value.
-
resizeRowsToFitContent
public void resizeRowsToFitContent()
This method will compute the best height for each line. That is to say a height where each content of each cell could be fully visible.\n Use this method wisely because it can degrade performance on great grid.
-
resizeRowsToMaximum
public void resizeRowsToMaximum()
This method will first applyresizeRowsToFitContent()
and then take the highest height and apply it to every row.\n Just asresizeRowsToFitContent()
, this method can be degrading your performance on great grid.
-
resizeRowsToDefault
public 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.
-
getRowHeight
public double getRowHeight(int row)
- Parameters:
row
-- Returns:
- the height of a particular row of the SpreadsheetView.
-
getSelectionModel
public SpreadsheetViewSelectionModel getSelectionModel()
Return the selectionModel used by the SpreadsheetView.- Returns:
SpreadsheetViewSelectionModel
-
scrollToRow
public void scrollToRow(int row)
Scrolls theSpreadsheetView
so that the given row is visible. Beware, you must callgetViewRow(int)
before if you are usingSpreadsheetCell.getRow()
and the grid is sorted/filtered.- Parameters:
row
- the row to scroll to
-
setVBarValue
public void setVBarValue(double value)
Same method asScrollBar.setValue(double)
on the verticalBar.- Parameters:
value
-
-
setHBarValue
public void setHBarValue(double value)
Same method asScrollBar.setValue(double)
on the verticalBar.- Parameters:
value
-
-
getVBarValue
public double getVBarValue()
Return the value of the vertical scrollbar. SeeScrollBar.getValue()
- Returns:
- the value of the vertical scrollbar.
-
getHBarValue
public double getHBarValue()
Return the value of the horizontal scrollbar. SeeScrollBar.getValue()
- Returns:
- the value of the horizontal scrollbar.
-
scrollToColumn
public void scrollToColumn(SpreadsheetColumn column)
Scrolls the SpreadsheetView so that the givenSpreadsheetColumn
is visible.- Parameters:
column
-
-
scrollToColumnIndex
public void scrollToColumnIndex(int modelColumn)
Scrolls the SpreadsheetView so that the given column index is visible.- Parameters:
modelColumn
-
-
getEditor
public final Optional<SpreadsheetCellEditor> getEditor(SpreadsheetCellType<?> cellType)
Return the editor associated with the CellType. (defined inSpreadsheetCellType.createEditor(SpreadsheetView)
. FIXME Maybe keep the editor references inside the SpreadsheetCellType- Parameters:
cellType
-- Returns:
- the editor associated with the CellType.
-
setEditable
public final void setEditable(boolean b)
Sets the value of the property editable.- Parameters:
b
-
-
isEditable
public final boolean isEditable()
Gets the value of the property editable.- Returns:
- a boolean telling if the SpreadsheetView is editable.
-
editableProperty
public final BooleanProperty editableProperty()
Specifies whether this SpreadsheetView is editable - only if the SpreadsheetView, and theSpreadsheetCell
within it are both editable will aSpreadsheetCell
be able to go into its editing state.- See Also:
isEditable()
,setEditable(boolean)
-
placeholderProperty
public final ObjectProperty<Node> placeholderProperty()
This Node is shown to the user when the SpreadsheetView has no content to show.- See Also:
getPlaceholder()
,setPlaceholder(Node)
-
setPlaceholder
public final void setPlaceholder(Node placeholder)
Sets the value of the placeholder property- Parameters:
placeholder
- the node to show when the SpreadsheetView has no content to show.
-
getPlaceholder
public final Node getPlaceholder()
Gets the value of the placeholder property.- Returns:
- the Node used as a placeholder that is shown when the SpreadsheetView has no content to show.
-
copyClipboard
public void copyClipboard()
Put the current selection into the ClipBoard. This can be overridden by developers for custom behavior.
-
pasteClipboard
public void pasteClipboard()
Try to paste the clipBoard to the specified position. Try to paste the current selection into the Grid. If the two contents are not matchable, then it's not pasted. This can be overridden by developers for custom behavior.
-
getSpreadsheetViewContextMenu
public ContextMenu getSpreadsheetViewContextMenu()
Create a menu on rightClick with two options: Copy/Paste This can be overridden by developers for custom behavior.- Returns:
- the ContextMenu to use.
-
deleteSelectedCells
public void deleteSelectedCells()
This method is called when pressing the "delete" key on the SpreadsheetView. This will erase the values of selected cells. This can be overridden by developers for custom behavior.
-
getSpanType
public SpreadsheetView.SpanType getSpanType(int rowIndex, int modelColumn)
Return theSpreadsheetView.SpanType
of a cell. This is used internally by the SpreadsheetView but some users may find it useful.- Parameters:
rowIndex
-modelColumn
-- Returns:
- The
SpreadsheetView.SpanType
of a cell
-
-