- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- javafx.scene.control.TableView<S>
-
- org.controlsfx.control.tableview2.TableView2<S>
-
- Type Parameters:
S- The type of the objects contained within the TableView2 items list.
- All Implemented Interfaces:
Styleable,EventTarget,Skinnable
- Direct Known Subclasses:
FilteredTableView
public class TableView2<S> extends TableView<S>
The TableView2 is an advanced JavaFXTableViewcontrol, that can be used as drop-in replacement control for the existing TableView, and provides different functionalities and use cases.Features
- Rows can be fixed to the top of the
TableView2so that they are always visible on screen. - Columns can be fixed to the left of the
TableView2so that they are always visible on screen. - A row header can be switched on in order to display any custom content.
- The column header can be extended to provide custom content.
FilteredTableViewis a subclass of TableView2 with extended filtering options
Fixing Rows and Columns
Rows and columns can be fixed using dedicated actions likeColumnFixActionandRowFixAction. When fixed, the header's background will show a darker color. For instance, these actions can be attached to aContextMenuthat can be installed to the row header cells withrowHeaderContextMenuFactory.
You have also the possibility to fix them manually by adding and removing items fromgetFixedRows()andgetFixedColumns(). But you are strongly advised to check if it's possible to do so withisColumnFixable(int)for the fixed columns and withisRowFixable(int)for the fixed rows.
If you want to fix several rows or columns together, you can callareRowsFixable(List)orareTableViewColumnsFixable(List)to verify if you can fix them. Calling those methods prior every move will ensure that no exception will be thrown.
You have also the possibility to deactivate these features.
Row Headers
You can also access and toggle row header's visibility by using the method providedsetRowHeaderVisible(boolean). By default the row header will show the row index, but you can set the content withsetRowHeader(TableColumn).Cell editing
Two specialized cell factories are availableTextField2TableCellandComboBox2TableCell, providing support for commit on focus lost.Filtering options
While filtering can be implemented as in a regular JavaFX TableView control, seeFilteredTableViewfor extended filtering options.Features not supported
Cell spanning is not supported yet.Sample
Let's provide the underlying data model, based on a
Personclass.public class Person { private StringProperty firstName; public void setFirstName(String value) { firstNameProperty().set(value); } public String getFirstName() { return firstNameProperty().get(); } public StringProperty firstNameProperty() { if (firstName == null) firstName = new SimpleStringProperty(this, "firstName"); return firstName; } private StringProperty lastName; public void setLastName(String value) { lastNameProperty().set(value); } public String getLastName() { return lastNameProperty().get(); } public StringProperty lastNameProperty() { if (lastName == null) lastName = new SimpleStringProperty(this, "lastName"); return lastName; } }A TableView2 can be created, and filled with an observable list of people:
TableView2<Person> table = new TableView2<Person>(); ObservableList<Person> people = getPeople(); table.setItems(people);Now we add two
columnsto the table:TableColumn2<Person,String> firstNameCol = new TableColumn2<>("First Name"); firstNameCol.setCellValueFactory(p -> p.getValue().firstNameProperty()); TableColumn2<Person,String> lastNameCol = new TableColumn2<>("Last Name"); lastNameCol.setCellValueFactory(p -> p.getValue().lastNameProperty()); table.getColumns().setAll(firstNameCol, lastNameCol);A cell factory that allows commit on focus lost can be set:
firstName.setCellFactory(TextField2TableCell.forTableColumn());We can fix some row and columns, and also show the row header:
table.getFixedColumns().setAll(firstNameColumn); table.getFixedRows().setAll(0, 1, 2); table.setRowHeaderVisible(true);
-
-
Property Summary
Properties Type Property Description ReadOnlyBooleanPropertycolumnFixingEnabledReturn the Boolean property associated with the allowance of fixing or unfixing some columns.ReadOnlyBooleanPropertyrowFixingEnabledReturn the Boolean property associated with the allowance of fixing or unfixing some rows.ObjectProperty<BiFunction<Integer,S,ContextMenu>>rowHeaderContextMenuFactoryAn object property of aBiFunctionthat can be used to define the context menu of each row of the row header.ObjectProperty<TableColumn<S,?>>rowHeaderThe row header property wraps aTableColumnthat can be used to render the row header.BooleanPropertyrowHeaderVisibleBooleanProperty associated with the row Header.DoublePropertyrowHeaderWidthThis DoubleProperty represents the with of the rowHeader.BooleanPropertysouthHeaderBlendedThis property allows the developer to blend the south table header row with the regular table header row, so for each column, the regular header and the south table column header look like a single one.-
Properties inherited from class javafx.scene.control.TableView
columnResizePolicy, comparator, editable, editingCell, fixedCellSize, focusModel, items, onScrollToColumn, onScrollTo, onSort, placeholder, rowFactory, selectionModel, sortPolicy, tableMenuButtonVisible
-
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 classTableView2.SpanTypeThe SpanType describes in which state each cell can be.-
Nested classes/interfaces inherited from class javafx.scene.control.TableView
TableView.ResizeFeatures<S extends Object>, TableView.TableViewFocusModel<S extends Object>, TableView.TableViewSelectionModel<S extends Object>
-
-
Field Summary
-
Fields inherited from class javafx.scene.control.TableView
CONSTRAINED_RESIZE_POLICY, DEFAULT_SORT_POLICY, UNCONSTRAINED_RESIZE_POLICY
-
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 TableView2()Creates a TableView2 control with no content.TableView2(ObservableList<S> items)Creates a TableView2 with the content provided in the items ObservableList.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareRowsFixable(List<? extends Integer> list)Indicates whether a List of rows can be fixed or not.ReadOnlyBooleanPropertycolumnFixingEnabledProperty()Return the Boolean property associated with the allowance of fixing or unfixing some columns.protected Skin<?>createDefaultSkin()intgetColumnSpan(TablePosition<?,?> pos)Return the current column span.ObservableList<TableColumn>getFixedColumns()You can fix or unfix a column by modifying this list.ObservableList<Integer>getFixedRows()You can fix or unfix a row by modifying this list.TableColumn<S,?>getRowHeader()Gets the value of the property rowHeader.BiFunction<Integer,S,ContextMenu>getRowHeaderContextMenuFactory()Gets the value of the property rowHeaderContextMenuFactory.doublegetRowHeaderWidth()intgetRowSpan(TablePosition<?,?> pos, int index)Return the current row span at the given position in the Table.TableView2.SpanTypegetSpanType(int rowIndex, int modelColumn)Return theTableView2.SpanTypeof a cell.StringgetUserAgentStylesheet()booleanisColumnFixable(int columnIndex)Indicate whether this column can be fixed or not.booleanisColumnFixingEnabled()Return whether changes to Fixed columns are enabled.booleanisRowFixable(int row)Indicate whether a row can be fixed or not.booleanisRowFixingEnabled()Return whether changes to Fixed rows are enabled.booleanisRowHeaderVisible()Return if the row header is showing.booleanisSouthHeaderBlended()Gets the value of the property southHeaderBlended.ReadOnlyBooleanPropertyrowFixingEnabledProperty()Return the Boolean property associated with the allowance of fixing or unfixing some rows.ObjectProperty<BiFunction<Integer,S,ContextMenu>>rowHeaderContextMenuFactoryProperty()An object property of aBiFunctionthat can be used to define the context menu of each row of the row header.ObjectProperty<TableColumn<S,?>>rowHeaderProperty()The row header property wraps aTableColumnthat can be used to render the row header.BooleanPropertyrowHeaderVisibleProperty()BooleanProperty associated with the row Header.DoublePropertyrowHeaderWidthProperty()This DoubleProperty represents the with of the rowHeader.voidsetColumnFixingEnabled(boolean b)If set to true, user will be allowed to fix and unfix the columns.voidsetRowFixingEnabled(boolean b)If set to true, user will be allowed to fix and unfix the rows.voidsetRowHeader(TableColumn<S,?> value)Sets the value of the property rowHeader.voidsetRowHeaderContextMenuFactory(BiFunction<Integer,S,ContextMenu> value)Sets the value of the property rowHeaderContextMenuFactory.voidsetRowHeaderVisible(boolean b)Activate and deactivate the row header.voidsetRowHeaderWidth(double value)Specify a new width for the row header.voidsetSouthHeaderBlended(boolean value)Sets the value of the property southHeaderBlended.voidsort()OverridesTableView.sort()in order to fire custom sort events when sorting starts and finishes.BooleanPropertysouthHeaderBlendedProperty()This property allows the developer to blend the south table header row with the regular table header row, so for each column, the regular header and the south table column header look like a single one.-
Methods inherited from class javafx.scene.control.TableView
columnResizePolicyProperty, comparatorProperty, edit, editableProperty, editingCellProperty, fixedCellSizeProperty, focusModelProperty, getClassCssMetaData, getColumnResizePolicy, getColumns, getComparator, getControlCssMetaData, getEditingCell, getFixedCellSize, getFocusModel, getItems, getOnScrollTo, getOnScrollToColumn, getOnSort, getPlaceholder, getRowFactory, getSelectionModel, getSortOrder, getSortPolicy, getVisibleLeafColumn, getVisibleLeafColumns, getVisibleLeafIndex, isEditable, isTableMenuButtonVisible, itemsProperty, onScrollToColumnProperty, onScrollToProperty, onSortProperty, placeholderProperty, queryAccessibleAttribute, refresh, resizeColumn, rowFactoryProperty, scrollTo, scrollTo, scrollToColumn, scrollToColumnIndex, selectionModelProperty, setColumnResizePolicy, setEditable, setFixedCellSize, setFocusModel, setItems, setOnScrollTo, setOnScrollToColumn, setOnSort, setPlaceholder, setRowFactory, setSelectionModel, setSortPolicy, setTableMenuButtonVisible, sortPolicyProperty, tableMenuButtonVisibleProperty
-
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, 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
-
rowFixingEnabled
public final ReadOnlyBooleanProperty rowFixingEnabledProperty
Return the Boolean property associated with the allowance of fixing or unfixing some rows.- See Also:
isRowFixingEnabled(),setRowFixingEnabled(boolean)
-
columnFixingEnabled
public final ReadOnlyBooleanProperty columnFixingEnabledProperty
Return the Boolean property associated with the allowance of fixing or unfixing some columns.
-
rowHeaderVisible
public final BooleanProperty rowHeaderVisibleProperty
BooleanProperty associated with the row Header.- See Also:
isRowHeaderVisible(),setRowHeaderVisible(boolean)
-
rowHeaderWidth
public final DoubleProperty rowHeaderWidthProperty
This DoubleProperty represents the with of the rowHeader. This is just representing the width of the Labels.- Returns:
- A DoubleProperty.
-
rowHeader
public final ObjectProperty<TableColumn<S,?>> rowHeaderProperty
The row header property wraps aTableColumnthat can be used to render the row header. By default, if this property is not set, a TableColumn will be used to render the number of row, starting from 1.- See Also:
getRowHeader(),setRowHeader(TableColumn)
-
rowHeaderContextMenuFactory
public final ObjectProperty<BiFunction<Integer,S,ContextMenu>> rowHeaderContextMenuFactoryProperty
An object property of aBiFunctionthat can be used to define the context menu of each row of the row header. SeeRowFixAction.
-
southHeaderBlended
public final BooleanProperty southHeaderBlendedProperty
This property allows the developer to blend the south table header row with the regular table header row, so for each column, the regular header and the south table column header look like a single one.
-
-
Constructor Detail
-
TableView2
public TableView2()
Creates a TableView2 control with no content.
-
TableView2
public TableView2(ObservableList<S> items)
Creates a TableView2 with the content provided in the items ObservableList.- Parameters:
items- The items to insert into the TableView2, and the list to watch for changes (to automatically show in the TableView2).
-
-
Method Detail
-
getRowSpan
public int getRowSpan(TablePosition<?,?> pos, int index)
Return the current row span at the given position in the Table. If a sort is applied to the TableView2, some spanned cells may be splitted.- Parameters:
pos- theTablePositionindex- the index- Returns:
- the current row span for the given cell.
-
getColumnSpan
public int getColumnSpan(TablePosition<?,?> pos)
Return the current column span.- Parameters:
pos- TheTablePosition- Returns:
- the current column span of a Cell.
-
getFixedRows
public final ObservableList<Integer> getFixedRows()
You can fix or unfix a row by modifying this list. CallisRowFixable(int)before trying to fix a row. SeeTableView2description for information.- Returns:
- an ObservableList of integer representing the fixedRows.
-
isRowFixable
public final boolean isRowFixable(int row)
Indicate whether a row can be fixed or not. Call that method before adding an item withgetFixedRows(). A row cannot be fixed alone if any cell inside the row has a row span superior to one.- Parameters:
row- the number of row- Returns:
- true if the row can be fixed.
-
areRowsFixable
public final boolean areRowsFixable(List<? extends Integer> list)
Indicates whether a List of rows can be fixed or not. A set of rows cannot be fixed if any cell inside these rows has a row span superior to the number of fixed rows.- Parameters:
list- List of rows indices- Returns:
- true if the List of row can be fixed together.
-
isRowFixingEnabled
public final boolean isRowFixingEnabled()
Return whether changes to Fixed rows are enabled.- Returns:
- whether changes to Fixed rows are enabled.
-
setRowFixingEnabled
public final void setRowFixingEnabled(boolean b)
If set to true, user will be allowed to fix and unfix the rows.- Parameters:
b- If set to true, user will be allowed to fix and unfix the rows
-
rowFixingEnabledProperty
public final ReadOnlyBooleanProperty rowFixingEnabledProperty()
Return the Boolean property associated with the allowance of fixing or unfixing some rows.- See Also:
isRowFixingEnabled(),setRowFixingEnabled(boolean)
-
getFixedColumns
public final ObservableList<TableColumn> getFixedColumns()
You can fix or unfix a column by modifying this list.- Returns:
- an ObservableList of the fixed columns.
-
isColumnFixable
public final boolean isColumnFixable(int columnIndex)
Indicate whether this column can be fixed or not.- Parameters:
columnIndex- the number of column- Returns:
- true if the column if fixable
-
isColumnFixingEnabled
public final boolean isColumnFixingEnabled()
Return whether changes to Fixed columns are enabled.- Returns:
- whether changes to Fixed columns are enabled.
-
setColumnFixingEnabled
public final void setColumnFixingEnabled(boolean b)
If set to true, user will be allowed to fix and unfix the columns.- Parameters:
b- If set to true, user will be allowed to fix and unfix the columns
-
columnFixingEnabledProperty
public final ReadOnlyBooleanProperty columnFixingEnabledProperty()
Return the Boolean property associated with the allowance of fixing or unfixing some columns.
-
setRowHeaderVisible
public final void setRowHeaderVisible(boolean b)
Activate and deactivate the row header.- Parameters:
b- boolean to show or hide the header
-
isRowHeaderVisible
public final boolean isRowHeaderVisible()
Return if the row header is showing.- Returns:
- a boolean telling if the row header is being shown
-
rowHeaderVisibleProperty
public final BooleanProperty rowHeaderVisibleProperty()
BooleanProperty associated with the row Header.- See Also:
isRowHeaderVisible(),setRowHeaderVisible(boolean)
-
rowHeaderWidthProperty
public final DoubleProperty rowHeaderWidthProperty()
This DoubleProperty represents the with of the rowHeader. This is just representing the width of the Labels.- Returns:
- A DoubleProperty.
-
setRowHeaderWidth
public final void setRowHeaderWidth(double value)
Specify a new width for the row header.- Parameters:
value- the new width
-
getRowHeaderWidth
public final double getRowHeaderWidth()
- Returns:
- the current width of the row header.
-
setRowHeader
public final void setRowHeader(TableColumn<S,?> value)
Sets the value of the property rowHeader.- Property description:
- The row header property wraps a
TableColumnthat can be used to render the row header. By default, if this property is not set, a TableColumn will be used to render the number of row, starting from 1.
-
getRowHeader
public final TableColumn<S,?> getRowHeader()
Gets the value of the property rowHeader.- Property description:
- The row header property wraps a
TableColumnthat can be used to render the row header. By default, if this property is not set, a TableColumn will be used to render the number of row, starting from 1.
-
rowHeaderProperty
public final ObjectProperty<TableColumn<S,?>> rowHeaderProperty()
The row header property wraps aTableColumnthat can be used to render the row header. By default, if this property is not set, a TableColumn will be used to render the number of row, starting from 1.- See Also:
getRowHeader(),setRowHeader(TableColumn)
-
setRowHeaderContextMenuFactory
public final void setRowHeaderContextMenuFactory(BiFunction<Integer,S,ContextMenu> value)
Sets the value of the property rowHeaderContextMenuFactory.- Property description:
- An object property of a
BiFunctionthat can be used to define the context menu of each row of the row header. SeeRowFixAction.
-
getRowHeaderContextMenuFactory
public final BiFunction<Integer,S,ContextMenu> getRowHeaderContextMenuFactory()
Gets the value of the property rowHeaderContextMenuFactory.- Property description:
- An object property of a
BiFunctionthat can be used to define the context menu of each row of the row header. SeeRowFixAction.
-
rowHeaderContextMenuFactoryProperty
public final ObjectProperty<BiFunction<Integer,S,ContextMenu>> rowHeaderContextMenuFactoryProperty()
An object property of aBiFunctionthat can be used to define the context menu of each row of the row header. SeeRowFixAction.
-
setSouthHeaderBlended
public final void setSouthHeaderBlended(boolean value)
Sets the value of the property southHeaderBlended.- Property description:
- This property allows the developer to blend the south table header row with the regular table header row, so for each column, the regular header and the south table column header look like a single one.
-
isSouthHeaderBlended
public final boolean isSouthHeaderBlended()
Gets the value of the property southHeaderBlended.- Property description:
- This property allows the developer to blend the south table header row with the regular table header row, so for each column, the regular header and the south table column header look like a single one.
-
southHeaderBlendedProperty
public final BooleanProperty southHeaderBlendedProperty()
This property allows the developer to blend the south table header row with the regular table header row, so for each column, the regular header and the south table column header look like a single one.
-
getSpanType
public TableView2.SpanType getSpanType(int rowIndex, int modelColumn)
Return theTableView2.SpanTypeof a cell. This is used internally by the TableView2 but some users may find it useful.- Parameters:
rowIndex- the number of rowmodelColumn- the number of column- Returns:
- The
TableView2.SpanTypeof a cell
-
sort
public void sort()
OverridesTableView.sort()in order to fire custom sort events when sorting starts and finishes. SeeTableView.sort()for more details about calling directly this method.
-
createDefaultSkin
protected Skin<?> createDefaultSkin()
- Overrides:
createDefaultSkinin classTableView<S>
-
getUserAgentStylesheet
public String getUserAgentStylesheet()
- Overrides:
getUserAgentStylesheetin classRegion
-
-