Contents
Hi There
Tom's Changes
Issues Raised in the Forums
What Is Out There
Hi There
This is an effort to get a JCalendar community (back) together, prompted by
enhancements I have made and then those I found from other users. My changes are
set out below. After that I have summarised what I found in the forums.
I did submit my changes, which I think others would find useful, to
the originator of JCalendar, Kai Toedter, but even after a few prods he
remains silent.
I have an interest in JCalendar because it is the "gDateChooser" component
in the Inq client/server scripting language. If you want to know more about
that see http://www.inqwell.com.
Accordingly I have combined the things I found with my own features and
volunteer to maintain these components. Get in touch if you are
interested: tom dot sanders at inqwell dot com or may be a
board at forums.inqwell.com.
My changes, outlined below, can be found
at https://github.com/inqwell/jcalendar.
See also What Is Out There.
Tom's Changes
I've put a few enhancements into the JCalendar components. Here goes:
Components
- The
nullText property.
Sometimes it is nice to display some text in JDateChooser, rather than blank,
when the date is null. For example null might mean "Open Ended" or whatever.
There is a new property on JDateChooser to specify this.
-
The
selectOnFocus property.
When a JDateChooser (that is the underlying JTextComponent) gains the focus,
optionally select its text. Useful for keyboard junkies.
-
The
dateVerifier property.
As well as min/maxSelectableDate, the DateVerifier interface
allows clients to specify arbitrary validation checks, for example valid
business days. When present on JDayChooser, JCalendar or JDateChooser
the valid() method is called. For JDayChooser and JCalendar (and within
JDateChooser obviously) the calendar buttons are disabled for dates that are
not valid. If a JDateChooser has a spinner editor then invalid dates are skipped
in the direction of travel. The same is true for values entered as text.
-
Keyboard interface.
As far as I am aware, using the mnemonic is limited in that it does not require
the component to have the focus. If you have more than one JDateChooser in
your window Alt+C will only ever apply to the one most recently created. I
have changed this to use the input/action map. When focused in
the underlying JTextComponent, Ctrl-C pops up the calendar and Ctrl-N sets
the value to null.
-
Miscellaneous.
JDateChooser.lastSelectedDate not used - I removed it.
Similarly isInitialized.
IDateEditor exposes the
underlying DateFormat
IDateEditor
provides a method to retrieve the underlying JTextComponent.
Test Program
I've added the new properties so they can be exercised. For a DateVerifier
I have implemented one that excludes Mondays and otherwise includes only even
numbered dates. You can set/remove it to see how JCalendar and JDayChooser react.
For JDateChooser I have added a check box that sets the top four
choosers to null when checked, today when not. You can set them to null
individually using ctrl-n when they have the focus. Set the nullText
using the text field.
Apart from the keyboard behaviour everything should be backwards compatible with 1.3.3.
TODO (Possibly)
There are a few more things I am considering - firstly, JDayChooser
colours the "today" button however this is based on a Calendar
instance (JDayChooser.today) that never changes. I think this will go stale
if the application is left open overnight....
Secondly, its a question as to what "today" is. It need not be today's date
of course. Your system may have its own idea of what the date it is.
I'll think a bit more about that.
Last, may be support a separate format for
acceptable input, eg a short form like ddMM, again for k/b junkies.
Issues Raised in the Forums
I went through the (relatively) recent posts and came up with this issues list.
You need to be logged into the forums for the links to work so whatever...
Those forum members I have contacted via a PM are:
scregg
TathiWitch
nkachr
moradan
slartibartfast
Kris Kemper
stever
mcnalu
jainromil
luuuis
vewert
joetraff
peterk1
Francesca
tuler
What Is Out There
Maven Repo at http://repo1.maven.org/maven2/com/toedter/jcalendar/.
Not sure who maintains this? No 1.3.3 there.
JCalendar at Github maintained by
forum member luuuis. His fixes as above based on version 1.3.3. This
version is also hosted
at https://oss.sonatype.org/index.html#nexus-search;quick~jcalendar
as jcalendar-tz.
My changes, luuuis' time zone enhancement, month browsing fix and the
memory leak fix by Kris Kemper are all
at https://github.com/inqwell/jcalendar.
Using the ideas suggested
at http://cemerick.com/2010/08/24/hosting-maven-repos-on-github/
you can use this version as follows:
<repositories>
.
.
<repository>
<id>inqwell-repo</id>
<url>https://github.com/inqwell/mvn-repo/raw/master/releases</url>
<name>Inqwell JCalendar Extensions</name>
</repository>
.
.
</repositories>
.
.
<dependencies>
.
.
<dependency>
<groupId>com.inqwell</groupId>
<artifactId>jcalendar</artifactId>
<version>1.3.3-inqwell-1.0</version>
</dependency>
.
.
</dependencies>
Last Edited: 29 June 2011 16:06 UTC