|
JDatePicker v4.3.25 | ||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
See:
Description
| Interface Summary | |
|---|---|
| DateModel | The date model is a convenient way to represent extended information about a
date; it is extremely useful for date editing components. |
| DateParser | The date parser interface defines the operation that must be implemented by any other object wants to scan a text in order to produce a date. |
| DateSelectionModel | The date selection model defines basic operations needed by date components
like JDatePicker to make valid
date selections; it abstracts everything there is about date selection. |
| Class Summary | |
|---|---|
| AbstractDateSelectionModel | The abstract definition for a date selection model that provides implementation for most operations; date selection model implementations should at least start from this class. |
| DateSelectionModel.SelectionMode | The type of selection for the selection model that allows to choose from single, interval or multiple interval selection. |
| DefaultDateModel | A default implementation for a date model. |
| DefaultDateParser | The default date parser tries to determine the date using a specified date format. |
| DefaultDateSelectionModel | The default date selection model is the model used by all date components. |
| Exception Summary | |
|---|---|
| DateParserException | An exception that indicates a failed date parsing. |
| DateSelectionException | An exception that indicates an inconsistent date selection model change. |
Provides classes and interfaces that cover various date operations mechanisms like editing, parsing and selection. These classes are used by the date components to control the respective date aspects.
To classes from this package offer support for:
As with any other Swing component, date edit components use a model to represent the edited date. A date edit
component's model is an instance of a class that implements the DateModel interface.
DefaultDateModel is the default implementation for a date model.
Date edit components use the date parsing
mechanism to allow flexible date input. Parsers can be created to transforms shortcut strings into dates. For
instance, one could create a parser that translates strings like 'today', 'yesterday', '3 days ago' or 'next month'
to appropriate dates.
DateParser defines the general contract for such a parser and
DefaultDateParser is a default implementation that parses dates
that respect the specified date format. DateParserException is
thrown whenever the parsing operation fails.
The date selection mechanism lets developers control how days are selected, which days can be selected and also notify registered listeners when the selection changes.
To understand what this mechanism is all about you might want to look first at
DateSelectionModel and then at its abstract definition
AbstractDateSelectionModel. The
DefaultDateSelectionModel is the selection model
used by default by all date components and it allows all dates to be selected by default.
Most people might not need to restrict the selected dates but for those who do, the next paragraphs show how this can be accomplished using the classes from this package.
Interval Restriction
The basic approach to restricting the dates available for selection is to specify an interval
of valid dates. Any selection model derived from AbstractDateSelectionModel can specify
this interval using the AbstractDateSelectionModel.setMinimumAllowed(java.util.Date)
and AbstractDateSelectionModel.setMaximumAllowed(java.util.Date) methods. If the
specified value is null then the restriction is removed. By default, there is no such restriction.
Limited Set of Dates Restriction
If you use DefaultDateSelectionModel as date selection model, you can also use the
DefaultDateSelectionModel.addDisabled(java.util.Date) method to specify which dates
cannot be selected and the DefaultDateSelectionModel.removeDisabled(java.util.Date) method
to make a date selectable again. This approach is useful when you need to restrict selection for a limited set
of dates.
Dates Pattern Restriction
Another way you can disable some dates is to use a date selection model that imposes the restrictions you
want. All you have to do is to create a date selection model whose AbstractDateSelectionModel.isDisabled(java.util.Date)
method returns true for the disabled days. This approach is very useful whenever the disabled
dates follow a certain pattern.
|
JDatePicker v4.3.25 | ||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
Visit www.jdatepicker.com for further information or send us your suggestions.
Copyright © 2003-2010 Elmro Ltd. All Rights Reserved.