Top Description Inners Fields Constructors Methods
com.dlsc.pickerfx

public Class LocalTimePicker

extends Picker<LocalTime>
Class Inheritance
Imports
com.dlsc.pickerfx.skins.LocalTimePickerSkin, javafx.beans.property.ObjectProperty, .SimpleObjectProperty, javafx.scene.control.Skin, javafx.util.Callback, java.time.LocalTime, java.util.Objects

A specific picker implementation used to let the user select a time.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
LocalTimePicker.Meridiem

An enum used to distinguish between AM and PM times.

Field Summary

Modifier and TypeField and Description
private final ObjectProperty<Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>>
hourCellFactory

The cell factory used by the segment that displays the hours.

private final ObjectProperty<Callback<Segment<LocalTime, LocalTimePicker.Meridiem>, SegmentCell<LocalTimePicker.Meridiem>>>
meridiemCellFactory

The cell factory used by the segment that displays the meridiem ("AM", "PM").

private final ObjectProperty<Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>>
minuteCellFactory

The cell factory used by the segment that displays the minutes.

private final ObjectProperty<TimeFormat>
timeFormat

Specifies whether we want to display time in 24 hour time format or 12 hour time format with AM and PM indicator.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>
public final Callback<Segment<LocalTime, LocalTimePicker.Meridiem>, SegmentCell<LocalTimePicker.Meridiem>>
public final Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>
public final TimeFormat
public String
getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method.

public final ObjectProperty<Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>>
public final ObjectProperty<Callback<Segment<LocalTime, LocalTimePicker.Meridiem>, SegmentCell<LocalTimePicker.Meridiem>>>
public final ObjectProperty<Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>>
public final void
public final void
public final void
public final void
public final ObjectProperty<TimeFormat>
Inherited from com.dlsc.pickerfx.Picker:
cellSizePropertygetCellSizegetClassCssMetaDatagetControlCssMetaDatagetIndicatorSizegetOrientationgetValueindicatorSizePropertyinvalidPropertyisInvalidisReadOnlyisShowIndicatororientationPropertyreadOnlyPropertysetCellSizesetIndicatorSizesetOrientationsetReadOnlysetShowIndicatorsetValueshowIndicatorPropertyvalueProperty

Field Detail

hourCellFactoryback to summary
private final ObjectProperty<Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>> hourCellFactory

The cell factory used by the segment that displays the hours.

meridiemCellFactoryback to summary
private final ObjectProperty<Callback<Segment<LocalTime, LocalTimePicker.Meridiem>, SegmentCell<LocalTimePicker.Meridiem>>> meridiemCellFactory

The cell factory used by the segment that displays the meridiem ("AM", "PM").

minuteCellFactoryback to summary
private final ObjectProperty<Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>> minuteCellFactory

The cell factory used by the segment that displays the minutes.

timeFormatback to summary
private final ObjectProperty<TimeFormat> timeFormat

Specifies whether we want to display time in 24 hour time format or 12 hour time format with AM and PM indicator.

Constructor Detail

LocalTimePickerback to summary
public LocalTimePicker()

Method Detail

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Returns:Skin<?>

new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.

Annotations
@Override
getHourCellFactoryback to summary
public final Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>> getHourCellFactory()
getMeridiemCellFactoryback to summary
public final Callback<Segment<LocalTime, LocalTimePicker.Meridiem>, SegmentCell<LocalTimePicker.Meridiem>> getMeridiemCellFactory()
getMinuteCellFactoryback to summary
public final Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>> getMinuteCellFactory()
getTimeFormatback to summary
public final TimeFormat getTimeFormat()
getUserAgentStylesheetback to summary
public String getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

Doc from javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls.

The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.

Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.



package com.example.javafx.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MyApp extends Application {

    @Override public void start(Stage stage) {
        Scene scene = new Scene(new Group());
        scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
Returns:String

A string URL

Annotations
@Override
hourCellFactoryPropertyback to summary
public final ObjectProperty<Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>> hourCellFactoryProperty()
meridiemCellFactoryPropertyback to summary
public final ObjectProperty<Callback<Segment<LocalTime, LocalTimePicker.Meridiem>, SegmentCell<LocalTimePicker.Meridiem>>> meridiemCellFactoryProperty()
minuteCellFactoryPropertyback to summary
public final ObjectProperty<Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>>> minuteCellFactoryProperty()
setHourCellFactoryback to summary
public final void setHourCellFactory(Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>> factory)
setMeridiemCellFactoryback to summary
public final void setMeridiemCellFactory(Callback<Segment<LocalTime, LocalTimePicker.Meridiem>, SegmentCell<LocalTimePicker.Meridiem>> factory)
setMinuteCellFactoryback to summary
public final void setMinuteCellFactory(Callback<Segment<LocalTime, Integer>, SegmentCell<Integer>> factory)
setTimeFormatback to summary
public final void setTimeFormat(TimeFormat timeFormat)
timeFormatPropertyback to summary
public final ObjectProperty<TimeFormat> timeFormatProperty()
com.dlsc.pickerfx back to summary

public final Enum LocalTimePicker.Meridiem

extends Enum<LocalTimePicker.Meridiem>
Class Inheritance

An enum used to distinguish between AM and PM times.

Field Summary

Modifier and TypeField and Description
public static final LocalTimePicker.Meridiem
public static final LocalTimePicker.Meridiem

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

Field Detail

AMback to summary
public static final LocalTimePicker.Meridiem AM
PMback to summary
public static final LocalTimePicker.Meridiem PM

Constructor Detail

Meridiemback to summary
private Meridiem()

Method Detail

valueOfback to summary
public static LocalTimePicker.Meridiem valueOf(String name)
valuesback to summary
public static LocalTimePicker.Meridiem[] values()