Top Description Inners Fields Methods
org.controlsfx.control.spreadsheet

public Interface SpreadsheetCell

Known Direct Implementers
org.controlsfx.control.spreadsheet.SpreadsheetCellBase
Imports
java.util.List, .Optional, .UUID, javafx.beans.property.ObjectProperty, .ReadOnlyStringProperty, .StringProperty, javafx.collections.ObservableSet, javafx.event.Event, .EventHandler, .EventType, javafx.scene.Node, javafx.scene.control.MenuButton, .MenuItem

Interface of the cells used in the SpreadsheetView. See SpreadsheetCellBase for a complete and detailed documentation.
See Also
SpreadsheetCellBase

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
SpreadsheetCell.CornerPosition

This enum states the four different corner available for positioning some elements in a cell.

Field Summary

Modifier and TypeField and Description
public static final EventType<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.

public static final EventType<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.

public static final EventType<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.

Method Summary

Modifier and TypeMethod and Description
public void
activateCorner(SpreadsheetCell.CornerPosition
the position where the triangle should be displayed
position
)

Activates the given CornerPosition in order to display a little triangle in the cell.

public <E extends Event> void
addEventHandler(EventType<E>
the type of the events to receive by the handler
eventType
,
EventHandler<? super E>
the handler to register
eventHandler
)

Registers an event handler to this SpreadsheetCell.

public void
deactivateCorner(SpreadsheetCell.CornerPosition
the position where the triangle should be removed if displayed
position
)

This deactivates the given CornerPosition so that no triangle will be shown for this cell.

public StringProperty

Returns:

the StringProperty linked with the format state
formatProperty
()

Returns the StringProperty linked with the format.

public SpreadsheetCellType<T>

Returns:

the SpreadsheetCellType of this cell.
getCellType
()

Returns the SpreadsheetCellType of this cell.

public int

Returns:

the column index of this cell
getColumn
()

Returns the column index of this cell.

public int

Returns:

how much this cell is spanning in column, 1 is normal.
getColumnSpan
()

Returns how much this cell is spanning in column, 1 means the cell is not spanning.

public String

Returns:

the format of this cell or an empty string if no format has been specified
getFormat
()

Returns the format of this cell or an empty string if no format has been specified.

public Node

Returns:

the graphic node associated with this cell
getGraphic
()

Returns the graphic node associated with this cell.

public Object

Returns:

the value contained in this cell
getItem
()

Returns the value contained in this cell.

public List<Object>

Returns:

a List of options for the SpreadsheetCellEditor
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.

public List<MenuItem>

Returns:

the MenuItem to show in the Popup
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.

public int

Returns:

the row index of this cell
getRow
()

Returns the row index of this cell.

public int

Returns:

how much this cell is spanning in row, 1 is normal
getRowSpan
()

Returns how much this cell is spanning in row, 1 means the cell is not spanning.

public String

Returns:

The inline CSS style associated with this Node. If this Node does not have an inline style, an empty String is returned.
getStyle
()

A string representation of the CSS style associated with this specific Node.

public ObservableSet<String>

Returns:

an ObservableList of String of all the style class of this cell
getStyleClass
()

Returns an ObservableList of String of all the style class associated with this cell.

public String

Returns:

the text representation of the value
getText
()

Returns the String representation currently used for display in the SpreadsheetView.

public Optional<String>

Returns:

the tooltip associated with this SpreadsheetCell
getTooltip
()

Returns the tooltip for this cell.

public ObjectProperty<Node>

Returns:

an ObjectProperty wrapping a Node for the graphic
graphicProperty
()

Returns the ObjectProperty representing this cell graphic.

public boolean

Returns:

true if this cell needs to display a popup
hasPopup
()

Returns true if this cell needs to display a popup when clicked in order to show some MenuItem like a MenuButton.

public boolean

Returns:

true if this cell item needs to be given to a particular Node
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.

public boolean

Returns:

true if a triangle is displayed in the cell for the given CornerPosition
isCornerActivated
(SpreadsheetCell.CornerPosition position)

Returns true if a triangle is displayed in the cell for the given CornerPosition.

public boolean

Returns:

true if this cell is editable
isEditable
()

Returns true if this cell can be edited.

public boolean

Returns:

true if the text should wrap onto another line if it exceeds the width of the Labeled
isWrapText
()

If a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.

public ObjectProperty<Object>

Returns:

the item property which contains the value.
itemProperty
()

The item property represents the currently-set value inside this SpreadsheetCell.

public boolean

Returns:

true if the upcoming cell value can be set to the current cell
match
(Object
the value that needs to be tested
value
)

Verifies that the upcoming cell value can be set to the current cell.

public <E extends Event> void
removeEventHandler(EventType<E>
the event type from which to unregister
eventType
,
EventHandler<? super E>
the handler to unregister
eventHandler
)

Unregisters a previously registered event handler from this SpreadsheetCell.

public void
setCellGraphic(boolean
if true, a Node will be used to display something particular for the cell
isCellGraphic
)

If isCellGraphic is true, this cell item contains something particular and should be display by using CellGraphicFactory object in the CellView.

public void
setColumnSpan(int
the columnSpan for this cell
columnSpan
)

Sets how much this cell is spanning in column.

public void
setEditable(boolean
true if this cell should be editable
editable
)

Change the editable state of this cell

public void
setFormat(String
a string pattern understood by the SpreadsheetCellType
format
)

Sets a new format for this cell.

public void
setGraphic(Node
a graphic to display for this cell
graphic
)

Sets a graphic for this cell.

public void
setHasPopup(boolean
true to display a Popup when clicked
value
)

Sets to true if this cell needs to display a popup when clicked in order to show some MenuItem like a MenuButton.

public void
setItem(Object value)

Sets the value of the property Item.

public void
setRowSpan(int
the rowSpan for this cell
rowSpan
)

Sets how much this cell is spanning in row.

public void
setStyle(String
a string representation of the CSS style associated with this specific Node
style
)

A string representation of the CSS style associated with this specific Node.

public void
setWrapText(boolean
true if the text should wrap onto another line if it exceeds the width of the Labeled
wrapText
)

If a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.

public StringProperty

Returns:

a string representation of the CSS style
styleProperty
()

A string representation of the CSS style associated with this specific Node.

public ReadOnlyStringProperty

Returns:

the StringProperty of the representation of the value
textProperty
()

Returns the StringProperty of the representation of the value.

Field Detail

CORNER_EVENT_TYPEback to summary
public static final EventType<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.

EDITABLE_EVENT_TYPEback to summary
public static final EventType<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.

WRAP_EVENT_TYPEback to summary
public static final EventType<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.

Method Detail

activateCornerback to summary
public void activateCorner(SpreadsheetCell.CornerPosition position)

Activates the given CornerPosition in order to display a little triangle in the cell.

Parameters
position:SpreadsheetCell.CornerPosition

the position where the triangle should be displayed

addEventHandlerback to summary
public <E extends Event> void addEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler)

Registers an event handler to this SpreadsheetCell.

Parameters
eventType:EventType<E>

the type of the events to receive by the handler

eventHandler:EventHandler<? super E>

the handler to register

Exceptions
NullPointerException:
if the event type or handler is null
deactivateCornerback to summary
public void deactivateCorner(SpreadsheetCell.CornerPosition position)

This deactivates the given CornerPosition so that no triangle will be shown for this cell.

Parameters
position:SpreadsheetCell.CornerPosition

the position where the triangle should be removed if displayed

formatPropertyback to summary
public StringProperty formatProperty()

Returns the StringProperty linked with the format.

Returns:StringProperty

the StringProperty linked with the format state

getCellTypeback to summary
public SpreadsheetCellType<T> getCellType()

Returns the SpreadsheetCellType of this cell.

Returns:SpreadsheetCellType<T>

the SpreadsheetCellType of this cell.

getColumnback to summary
public int getColumn()

Returns the column index of this cell.

Returns:int

the column index of this cell

getColumnSpanback to summary
public int getColumnSpan()

Returns how much this cell is spanning in column, 1 means the cell is not spanning.

Returns:int

how much this cell is spanning in column, 1 is normal.

getFormatback to summary
public String getFormat()

Returns the format of this cell or an empty string if no format has been specified.

Returns:String

the format of this cell or an empty string if no format has been specified

getGraphicback to summary
public Node getGraphic()

Returns the graphic node associated with this cell. Returns null if nothing has been associated.

Returns:Node

the graphic node associated with this cell

getItemback to summary
public Object getItem()

Returns the value contained in this cell.

Returns:Object

the value contained in this cell

getOptionsForEditorback to summary
public List<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.

Returns:List<Object>

a List of options for the SpreadsheetCellEditor

getPopupItemsback to summary
public List<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.

Returns:List<MenuItem>

the MenuItem to show in the Popup

getRowback to summary
public int getRow()

Returns the row index of this cell.

Returns:int

the row index of this cell

getRowSpanback to summary
public int getRowSpan()

Returns how much this cell is spanning in row, 1 means the cell is not spanning.

Returns:int

how much this cell is spanning in row, 1 is normal

getStyleback to summary
public String getStyle()

A string representation of the CSS style associated with this specific Node. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.

Returns:String

The inline CSS style associated with this Node. If this Node does not have an inline style, an empty String is returned.

getStyleClassback to summary
public ObservableSet<String> getStyleClass()

Returns an 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).

Returns:ObservableSet<String>

an ObservableList of String of all the style class of this cell

getTextback to summary
public String getText()

Returns the String representation currently used for display in the SpreadsheetView.

Returns:String

the text representation of the value

getTooltipback to summary
public Optional<String> getTooltip()

Returns the tooltip for this cell.

Returns:Optional<String>

the tooltip associated with this SpreadsheetCell

graphicPropertyback to summary
public ObjectProperty<Node> graphicProperty()

Returns the ObjectProperty representing this cell graphic.

Returns:ObjectProperty<Node>

an ObjectProperty wrapping a Node for the graphic

hasPopupback to summary
public boolean hasPopup()

Returns true if this cell needs to display a popup when clicked in order to show some MenuItem like a MenuButton. The items can be set in getPopupItems().

Returns:boolean

true if this cell needs to display a popup

isCellGraphicback to summary
public 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.

Returns:boolean

true if this cell item needs to be given to a particular Node

isCornerActivatedback to summary
public boolean isCornerActivated(SpreadsheetCell.CornerPosition position)

Returns true if a triangle is displayed in the cell for the given CornerPosition.

Returns:boolean

true if a triangle is displayed in the cell for the given CornerPosition

isEditableback to summary
public boolean isEditable()

Returns true if this cell can be edited.

Returns:boolean

true if this cell is editable

isWrapTextback to summary
public 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.

Returns:boolean

true if the text should wrap onto another line if it exceeds the width of the Labeled

itemPropertyback to summary
public ObjectProperty<Object> itemProperty()

The item property represents the currently-set value inside this SpreadsheetCell.

Returns:ObjectProperty<Object>

the item property which contains the value.

matchback to summary
public boolean match(Object value)

Verifies that the upcoming cell value can be set to the current cell. This is currently used by the Copy/Paste.

Parameters
value:Object

the value that needs to be tested

Returns:boolean

true if the upcoming cell value can be set to the current cell

removeEventHandlerback to summary
public <E extends Event> void removeEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler)

Unregisters a previously registered event handler from this SpreadsheetCell.

Parameters
eventType:EventType<E>

the event type from which to unregister

eventHandler:EventHandler<? super E>

the handler to unregister

Exceptions
NullPointerException:
if the event type or handler is null
setCellGraphicback to summary
public void setCellGraphic(boolean isCellGraphic)

If isCellGraphic is true, this cell item contains something particular and should be display by using CellGraphicFactory object in the CellView.

Parameters
isCellGraphic:boolean

if true, a Node will be used to display something particular for the cell

setColumnSpanback to summary
public void setColumnSpan(int columnSpan)

Sets how much this cell is spanning in column. See 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.

Parameters
columnSpan:int

the columnSpan for this cell

setEditableback to summary
public void setEditable(boolean editable)

Change the editable state of this cell

Parameters
editable:boolean

true if this cell should be editable

setFormatback to summary
public void setFormat(String format)

Sets a new format for this cell. This format will be used by SpreadsheetCellType#toString(java.lang.Object, java.lang.String). This should be used by numbers for example.

Parameters
format:String

a string pattern understood by the SpreadsheetCellType

setGraphicback to summary
public void setGraphic(Node graphic)

Sets a graphic for this cell. It is displayed aside with the text if any is specified. Otherwise it's fully displayed in the cell.

Parameters
graphic:Node

a graphic to display for this cell

setHasPopupback to summary
public 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.

Parameters
value:boolean

true to display a Popup when clicked

setItemback to summary
public void setItem(Object value)

Sets the value of the property Item. This should be used only at initialization. Prefer Grid#setCellValue(int, int, Object) after because it will compute correctly the modifiedCell. If isEditable() return false, nothing is done.

setRowSpanback to summary
public void setRowSpan(int rowSpan)

Sets how much this cell is spanning in row. See 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.

Parameters
rowSpan:int

the rowSpan for this cell

setStyleback to summary
public void setStyle(String style)

A string representation of the CSS style associated with this specific Node. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.

Parameters
style:String

a string representation of the CSS style associated with this specific Node

setWrapTextback to summary
public 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.

Parameters
wrapText:boolean

true if the text should wrap onto another line if it exceeds the width of the Labeled

stylePropertyback to summary
public StringProperty styleProperty()

A string representation of the CSS style associated with this specific Node. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.

Returns:StringProperty

a string representation of the CSS style

textPropertyback to summary
public ReadOnlyStringProperty textProperty()

Returns the StringProperty of the representation of the value.

Returns:ReadOnlyStringProperty

the StringProperty of the representation of the value

org.controlsfx.control.spreadsheet back to summary

public final Enum SpreadsheetCell.CornerPosition

extends Enum<SpreadsheetCell.CornerPosition>
Class Inheritance

This enum states the four different corner available for positioning some elements in a cell.

Field Summary

Modifier and TypeField and Description
public static final SpreadsheetCell.CornerPosition
public static final SpreadsheetCell.CornerPosition
public static final SpreadsheetCell.CornerPosition
public static final SpreadsheetCell.CornerPosition

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SpreadsheetCell.CornerPosition
public static SpreadsheetCell.CornerPosition[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOTTOM_LEFTback to summary
public static final SpreadsheetCell.CornerPosition BOTTOM_LEFT
BOTTOM_RIGHTback to summary
public static final SpreadsheetCell.CornerPosition BOTTOM_RIGHT
TOP_LEFTback to summary
public static final SpreadsheetCell.CornerPosition TOP_LEFT
TOP_RIGHTback to summary
public static final SpreadsheetCell.CornerPosition TOP_RIGHT

Constructor Detail

CornerPositionback to summary
private CornerPosition()

Method Detail

valueOfback to summary
public static SpreadsheetCell.CornerPosition valueOf(String name)
valuesback to summary
public static SpreadsheetCell.CornerPosition[] values()