Top Inners Fields Constructors Methods
impl.com.calendarfx.view

public Class SearchResultViewSkin

extends SkinBase<SearchResultView>
Class Inheritance
Annotations
@SuppressWarnings:javadoc
Imports
com.calendarfx.model.Calendar, .Entry, com.calendarfx.view.Messages, .RequestEvent, .SearchResultView, javafx.scene.control.ContentDisplay, .Label, .ListCell, .ListView, .SkinBase, javafx.scene.layout.BorderPane, javafx.scene.shape.Circle, javafx.util.Callback, java.text.MessageFormat, java.time.LocalDate, java.time.format.DateTimeFormatter, .FormatStyle

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
public class

Field Summary

Modifier and TypeField and Description
private final ListView<Entry<?>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from javafx.scene.control.SkinBase:
computeBaselineOffsetcomputeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthconsumeMouseEventsdisposeexecuteAccessibleActiongetChildrengetClassCssMetaDatagetCssMetaDatagetNodegetSkinnablelayoutChildrenlayoutInArealayoutInArealayoutInAreapositionInAreapositionInAreapseudoClassStateChangedqueryAccessibleAttributeregisterChangeListenerregisterInvalidationListenerregisterListChangeListenersnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYunregisterChangeListenersunregisterInvalidationListenersunregisterListChangeListeners

Field Detail

listViewback to summary
private final ListView<Entry<?>> listView

Constructor Detail

SearchResultViewSkinback to summary
public SearchResultViewSkin(SearchResultView view)
impl.com.calendarfx.view back to summary

public Class SearchResultViewSkin.SearchResultCellFactory

extends Object
implements Callback<ListView<Entry<?>>, ListCell<Entry<?>>>
Class Inheritance
  • java.lang.Object
  • impl.com.calendarfx.view.SearchResultViewSkin.SearchResultCellFactory
All Implemented Interfaces
javafx.util.Callback

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ListCell<Entry<?>>
call(ListView<Entry<?>>
The single argument upon which the returned value should be determined.
param
)

Implements javafx.util.Callback.call.

The call method is called when required, and is given a single argument of type P, with a requirement that an object of type R is returned.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SearchResultCellFactoryback to summary
public SearchResultCellFactory()

Method Detail

callback to summary
public ListCell<Entry<?>> call(ListView<Entry<?>> param)

Implements javafx.util.Callback.call.

Doc from javafx.util.Callback.call.

The call method is called when required, and is given a single argument of type P, with a requirement that an object of type R is returned.

Parameters
param:ListView<Entry<?>>

The single argument upon which the returned value should be determined.

Returns:ListCell<Entry<?>>

An object of type R that may be determined based on the provided parameter value.

Annotations
@Override
impl.com.calendarfx.view back to summary

public Class SearchResultViewSkin.SearchResultListViewCell

extends ListCell<Entry<?>>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final BorderPane
private final Circle
private final DateTimeFormatter
private final Label
private final DateTimeFormatter
private final Label
private final Label

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
getTimeText(Entry<?> entry)

protected void
updateItem(Entry<?>
The new item for the cell.
entry
,
boolean
whether or not this cell represents data from the list. If it is empty, then it does not represent any domain data, but is a cell being used to render an "empty" row.
empty
)

Overrides javafx.scene.control.Cell.updateItem.

The updateItem method should not be called by developers, but it is the best method for developers to override to allow for them to customise the visuals of the cell.

Inherited from javafx.scene.control.ListCell:
cancelEditcommitEditcreateDefaultSkinexecuteAccessibleActiongetListViewlayoutChildrenlistViewPropertyqueryAccessibleAttributestartEditupdateListView

Field Detail

borderPaneback to summary
private final BorderPane borderPane
colorCircleback to summary
private final Circle colorCircle
dateFormatterback to summary
private final DateTimeFormatter dateFormatter
dateLabelback to summary
private final Label dateLabel
timeFormatterback to summary
private final DateTimeFormatter timeFormatter
timeLabelback to summary
private final Label timeLabel
titleLabelback to summary
private final Label titleLabel

Constructor Detail

SearchResultListViewCellback to summary
public SearchResultListViewCell()

Method Detail

getTimeTextback to summary
private String getTimeText(Entry<?> entry)
updateItemback to summary
protected void updateItem(Entry<?> entry, boolean empty)

Overrides javafx.scene.control.Cell.updateItem.

Doc from javafx.scene.control.Cell.updateItem.

The updateItem method should not be called by developers, but it is the best method for developers to override to allow for them to customise the visuals of the cell. To clarify, developers should never call this method in their code (they should leave it up to the UI control, such as the javafx.scene.control.ListView control) to call this method. However, the purpose of having the updateItem method is so that developers, when specifying custom cell factories (again, like the ListView cell factory), the updateItem method can be overridden to allow for complete customisation of the cell.

It is very important that subclasses of Cell override the updateItem method properly, as failure to do so will lead to issues such as blank cells or cells with unexpected content appearing within them. Here is an example of how to properly override the updateItem method:

protected void updateItem(T item, boolean empty) {
    super.updateItem(item, empty);

    if (empty || item == null) {
        setText(null);
        setGraphic(null);
    } else {
        setText(item.toString());
    }
}

Note in this code sample two important points:

  1. We call the super.updateItem(T, boolean) method. If this is not done, the item and empty properties are not correctly set, and you are likely to end up with graphical issues.
  2. We test for the empty condition, and if true, we set the text and graphic properties to null. If we do not do this, it is almost guaranteed that end users will see graphical artifacts in cells unexpectedly.
Parameters
entry:Entry<?>

The new item for the cell.

empty:boolean

whether or not this cell represents data from the list. If it is empty, then it does not represent any domain data, but is a cell being used to render an "empty" row.

Annotations
@Override