public interface SpreadsheetCell
SpreadsheetView.
See SpreadsheetCellBase for a complete and detailed documentation.SpreadsheetCellBase| Type | Property and Description |
|---|---|
javafx.beans.property.StringProperty |
format
Returns the
StringProperty linked with the format. |
javafx.beans.property.ObjectProperty<javafx.scene.Node> |
graphic
Returns the
ObjectProperty representing this cell graphic. |
javafx.beans.property.ObjectProperty<java.lang.Object> |
item
The item property represents the currently-set value inside this
SpreadsheetCell. |
javafx.beans.property.StringProperty |
style
A string representation of the CSS style associated with this specific
Node.
|
javafx.beans.property.ReadOnlyStringProperty |
text
Returns the StringProperty of the representation of the value.
|
| Modifier and Type | Interface and Description |
|---|---|
static class |
SpreadsheetCell.CornerPosition
This enum states the four different corner available for positioning
some elements in a cell.
|
| Modifier and Type | Field and Description |
|---|---|
static javafx.event.EventType<javafx.event.Event> |
CORNER_EVENT_TYPE
This EventType can be used with an
EventHandler in order to catch
when a corner state of a SpreadsheetCell is changed. |
static javafx.event.EventType<javafx.event.Event> |
EDITABLE_EVENT_TYPE
This EventType can be used with an
EventHandler in order to catch
when the editable state of a SpreadsheetCell is changed. |
static javafx.event.EventType<javafx.event.Event> |
WRAP_EVENT_TYPE
This EventType can be used with an
EventHandler in order to catch
when the wrap text state of a SpreadsheetCell is changed. |
| Modifier and Type | Method and Description |
|---|---|
void |
activateCorner(SpreadsheetCell.CornerPosition position)
Activates the given
CornerPosition in order to display a little
triangle in the cell. |
void |
addEventHandler(javafx.event.EventType<javafx.event.Event> eventType,
javafx.event.EventHandler<javafx.event.Event> eventHandler)
Registers an event handler to this SpreadsheetCell.
|
void |
deactivateCorner(SpreadsheetCell.CornerPosition position)
This deactivates the given
CornerPosition so that no triangle
will be shown for this cell. |
javafx.beans.property.StringProperty |
formatProperty()
Returns the
StringProperty linked with the format. |
SpreadsheetCellType |
getCellType()
Returns the
SpreadsheetCellType of this cell. |
int |
getColumn()
Returns the column index of this cell.
|
int |
getColumnSpan()
Returns how much this cell is spanning in column, 1 means the cell is not
spanning.
|
java.lang.String |
getFormat()
Returns the format of this cell or an empty string if no format has been
specified.
|
javafx.scene.Node |
getGraphic()
Returns the graphic node associated with this cell.
|
java.lang.Object |
getItem()
Returns the value contained in this cell.
|
java.util.List<java.lang.Object> |
getOptionsForEditor()
If some options cannot be factorized in a
SpreadsheetCellType and
are specific to a cell, you can return them here and the
SpreadsheetCellEditor will receive them. |
java.util.List<javafx.scene.control.MenuItem> |
getPopupItems()
If
hasPopup() is set to true, this method will be called when
the user clicks on the cell in order to gather the MenuItem to
show in the Popup. |
int |
getRow()
Returns the row index of this cell.
|
int |
getRowSpan()
Returns how much this cell is spanning in row, 1 means the cell is not
spanning.
|
java.lang.String |
getStyle()
A string representation of the CSS style associated with this specific
Node.
|
javafx.collections.ObservableSet<java.lang.String> |
getStyleClass()
Returns an
ObservableList of String of all the style
class associated with this cell. |
java.lang.String |
getText()
Returns the String representation currently used for display in the
SpreadsheetView. |
java.util.Optional<java.lang.String> |
getTooltip()
Returns the tooltip for this cell.
|
javafx.beans.property.ObjectProperty<javafx.scene.Node> |
graphicProperty()
Returns the
ObjectProperty representing this cell graphic. |
boolean |
hasPopup()
Returns true if this cell needs to display a popup when clicked in order
to show some
MenuItem like a MenuButton. |
boolean |
isCellGraphic()
Returns
true if this cell contains something particular in its
item and a Node given by the CellGraphicFactory will be used to
display it. |
boolean |
isCornerActivated(SpreadsheetCell.CornerPosition position)
Returns
true if a triangle is displayed in the cell for the given
CornerPosition. |
boolean |
isEditable()
Returns
true if this cell can be edited. |
boolean |
isWrapText()
If a run of text exceeds the width of the Labeled, then this variable
indicates whether the text should wrap onto another line.
|
javafx.beans.property.ObjectProperty<java.lang.Object> |
itemProperty()
The item property represents the currently-set value inside this
SpreadsheetCell. |
boolean |
match(java.lang.Object value)
Verifies that the upcoming cell value can be set to the current cell.
|
void |
removeEventHandler(javafx.event.EventType<javafx.event.Event> eventType,
javafx.event.EventHandler<javafx.event.Event> eventHandler)
Unregisters a previously registered event handler from this
SpreadsheetCell.
|
void |
setCellGraphic(boolean isCellGraphic)
If
isCellGraphic is true, this cell item contains
something particular and should be display by using a Node provided by
CellGraphicFactory object in the CellView. |
void |
setColumnSpan(int columnSpan)
Sets how much this cell is spanning in column.
|
void |
setEditable(boolean editable)
Change the editable state of this cell
|
void |
setFormat(java.lang.String format)
Sets a new format for this cell.
|
void |
setGraphic(javafx.scene.Node graphic)
Sets a graphic for this cell.
|
void |
setHasPopup(boolean value)
Sets to
true if this cell needs to display a popup when clicked
in order to show some MenuItem like a MenuButton. |
void |
setItem(java.lang.Object value)
Sets the value of the property Item.
|
void |
setRowSpan(int rowSpan)
Sets how much this cell is spanning in row.
|
void |
setStyle(java.lang.String style)
A string representation of the CSS style associated with this specific
Node.
|
void |
setWrapText(boolean wrapText)
If a run of text exceeds the width of the Labeled, then this variable
indicates whether the text should wrap onto another line.
|
javafx.beans.property.StringProperty |
styleProperty()
A string representation of the CSS style associated with this specific
Node.
|
javafx.beans.property.ReadOnlyStringProperty |
textProperty()
Returns the StringProperty of the representation of the value.
|
javafx.beans.property.ObjectProperty<java.lang.Object> itemProperty
SpreadsheetCell.getItem(),
setItem(Object)javafx.beans.property.StringProperty styleProperty
getStyle(),
setStyle(String)javafx.beans.property.StringProperty formatProperty
StringProperty linked with the format.getFormat(),
setFormat(String)javafx.beans.property.ReadOnlyStringProperty textProperty
getText()javafx.beans.property.ObjectProperty<javafx.scene.Node> graphicProperty
ObjectProperty representing this cell graphic.getGraphic(),
setGraphic(Node)static final javafx.event.EventType<javafx.event.Event> EDITABLE_EVENT_TYPE
EventHandler in order to catch
when the editable state of a SpreadsheetCell is changed.static final javafx.event.EventType<javafx.event.Event> WRAP_EVENT_TYPE
EventHandler in order to catch
when the wrap text state of a SpreadsheetCell is changed.static final javafx.event.EventType<javafx.event.Event> CORNER_EVENT_TYPE
EventHandler in order to catch
when a corner state of a SpreadsheetCell is changed.boolean match(java.lang.Object value)
value - the value that needs to be testedtrue if the upcoming cell value can be set to the current
cellvoid setItem(java.lang.Object value)
Grid.setCellValue(int, int, Object) after
because it will compute correctly the modifiedCell. If
isEditable() return false, nothing is done.value - java.lang.Object getItem()
javafx.beans.property.ObjectProperty<java.lang.Object> itemProperty()
SpreadsheetCell.getItem(),
setItem(Object)boolean isEditable()
true if this cell can be edited.true if this cell is editablevoid setEditable(boolean editable)
editable - true if this cell should be editableboolean isWrapText()
true if the text should wrap onto another line if it
exceeds the width of the Labeledboolean isCellGraphic()
true if this cell contains something particular in its
item and a Node given by the CellGraphicFactory will be used to
display it.true if this cell item needs to be given to a particular
Nodevoid setCellGraphic(boolean isCellGraphic)
isCellGraphic is true, this cell item contains
something particular and should be display by using a Node provided by
CellGraphicFactory object in the CellView.
If you only seek to place a simple Node for this cell, simply use setGraphic(javafx.scene.Node).isCellGraphic - if true, a Node will be used to display
something particular for the cellvoid setWrapText(boolean wrapText)
wrapText - true if the text should wrap onto another line if
it exceeds the width of the Labeledjava.util.List<java.lang.Object> getOptionsForEditor()
SpreadsheetCellType and
are specific to a cell, you can return them here and the
SpreadsheetCellEditor will receive them.List of options for the SpreadsheetCellEditorboolean hasPopup()
MenuItem like a MenuButton.
The items can be set in getPopupItems().true if this cell needs to display a popupvoid setHasPopup(boolean value)
true if this cell needs to display a popup when clicked
in order to show some MenuItem like a MenuButton.value - true to display a Popup when clickedjava.util.List<javafx.scene.control.MenuItem> getPopupItems()
hasPopup() is set to true, this method will be called when
the user clicks on the cell in order to gather the MenuItem to
show in the Popup.MenuItem to show in the Popupvoid setStyle(java.lang.String style)
style - a string representation of the CSS style associated with
this specific Nodejava.lang.String getStyle()
javafx.beans.property.StringProperty styleProperty()
getStyle(),
setStyle(String)void activateCorner(SpreadsheetCell.CornerPosition position)
CornerPosition in order to display a little
triangle in the cell.position - the position where the triangle should be displayedvoid deactivateCorner(SpreadsheetCell.CornerPosition position)
CornerPosition so that no triangle
will be shown for this cell.position - the position where the triangle should be removed if
displayedboolean isCornerActivated(SpreadsheetCell.CornerPosition position)
true if a triangle is displayed in the cell for the given
CornerPosition.position - true if a triangle is displayed in the cell for the given
CornerPositionjavafx.beans.property.StringProperty formatProperty()
StringProperty linked with the format.getFormat(),
setFormat(String)java.lang.String getFormat()
void setFormat(java.lang.String format)
SpreadsheetCellType.toString(java.lang.Object, java.lang.String). This should be used by numbers for example.format - a string pattern understood by the
SpreadsheetCellTypejavafx.beans.property.ReadOnlyStringProperty textProperty()
getText()java.lang.String getText()
SpreadsheetView.SpreadsheetCellType getCellType()
SpreadsheetCellType of this cell.SpreadsheetCellType of this cell.int getRow()
int getColumn()
int getRowSpan()
void setRowSpan(int rowSpan)
SpreadsheetCell
description for information. You should use
Grid.spanRow(int, int, int) instead of using this method
directly.
1 means the cell is not spanning. Thus, the rowSpan should not be
inferior to 1.rowSpan - the rowSpan for this cellint getColumnSpan()
void setColumnSpan(int columnSpan)
SpreadsheetCell description for information. You should use
Grid.spanColumn(int, int, int) instead of using this method
directly.
1 means the cell is not spanning. Thus, the rowSpan should not be
inferior to 1.columnSpan - the columnSpan for this celljavafx.collections.ObservableSet<java.lang.String> getStyleClass()
ObservableList of String of all the style
class associated with this cell. You can easily modify its appearance by
adding a style class (previously set in CSS).ObservableList of String of all the style
class of this celljavafx.beans.property.ObjectProperty<javafx.scene.Node> graphicProperty()
ObjectProperty representing this cell graphic.getGraphic(),
setGraphic(Node)void setGraphic(javafx.scene.Node graphic)
graphic - a graphic to display for this celljavafx.scene.Node getGraphic()
java.util.Optional<java.lang.String> getTooltip()
SpreadsheetCellvoid addEventHandler(javafx.event.EventType<javafx.event.Event> eventType,
javafx.event.EventHandler<javafx.event.Event> eventHandler)
eventType - the type of the events to receive by the handlereventHandler - the handler to registerjava.lang.NullPointerException - if the event type or handler is nullvoid removeEventHandler(javafx.event.EventType<javafx.event.Event> eventType,
javafx.event.EventHandler<javafx.event.Event> eventHandler)
eventType - the event type from which to unregistereventHandler - the handler to unregisterjava.lang.NullPointerException - if the event type or handler is null