Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Date/Calendar widgets - any validation support?(Ability to prevent selection of certain dates, or paint them in another colour?)
icon3.gif  Date/Calendar widgets - any validation support? [message #494804] Mon, 02 November 2009 17:14 Go to next message
Justin Dolezy is currently offline Justin DolezyFriend
Messages: 68
Registered: July 2009
Member
Hi,

I need to provide date selection where non-business days cannot be chosen. I have holiday schedules so I know which days aren't business days...

Do any of the available calendar widgets support being able to disable certain dates? Having some callback to query whether a data is valid or not would be good.

I'm guessing nothing like this is available, is it?

Alternatively maybe one of the widgets supports alernate painting of specific dates, so the user at least would then have a visual clue that they shouldn't select it?

Thanks,
Justin
Re: Date/Calendar widgets - any validation support? [message #494869 is a reply to message #494804] Tue, 03 November 2009 00:44 Go to previous messageGo to next message
Eric Wuillai is currently offline Eric WuillaiFriend
Messages: 27
Registered: July 2009
Junior Member
I'm not able to respond for other Nebula calendars, but this is actually
not possible with DateChooser.
However it should be relatively simple to add. Please post a feature
request in bugzilla if you are interested.

For the alternate painting, DateChooser support the possibility to use a
different foreground color for non-business days. It is implemented by
default in the provided themes (except the new SYSTEM theme I just
commit today). And you can define your own themes with your own colors.

Regards,
Eric

> Hi,
>
> I need to provide date selection where non-business days cannot be
> chosen. I have holiday schedules so I know which days aren't business
> days...
>
> Do any of the available calendar widgets support being able to disable
> certain dates? Having some callback to query whether a data is valid or
> not would be good.
>
> I'm guessing nothing like this is available, is it?
>
> Alternatively maybe one of the widgets supports alernate painting of
> specific dates, so the user at least would then have a visual clue that
> they shouldn't select it?
>
> Thanks,
> Justin
>
Re: Date/Calendar widgets - any validation support? [message #494942 is a reply to message #494869] Tue, 03 November 2009 10:48 Go to previous messageGo to next message
Justin Dolezy is currently offline Justin DolezyFriend
Messages: 68
Registered: July 2009
Member
Eric Wuillai wrote on Mon, 02 November 2009 19:44
I'm not able to respond for other Nebula calendars, but this is actually
not possible with DateChooser.
However it should be relatively simple to add. Please post a feature
request in bugzilla if you are interested.

For the alternate painting, DateChooser support the possibility to use a
different foreground color for non-business days. It is implemented by
default in the provided themes (except the new SYSTEM theme I just
commit today). And you can define your own themes with your own colors.

Regards,
Eric
>


Hi Eric,

That's great, I'll raise a feature request.

About the non-business days foreground painting - that currently treats weekends as non-business days iirc. I need to extend that so that local public holidays which fall during the week could also be painted as non-business days! Likewise for not being able to select them.. hence the need for a callback so the widget can query the application, if required, to ask if any of the dates in the displayed calendar are non-business days.

Hope I've explained that OK..

Best,
Justin
Re: Date/Calendar widgets - any validation support? [message #495158 is a reply to message #494942] Tue, 03 November 2009 22:58 Go to previous messageGo to next message
Laurent Marchal is currently offline Laurent MarchalFriend
Messages: 91
Registered: July 2009
Member
Hello,

This was my needs too, and I implemented this in my application. I have
created a patch and submitted it for integration, I hope it will be
merged one day.

This should fit your needs.
http://dev.eclipse.org/newslists/news.eclipse.technology.neb ula/msg01554.html

Patch here :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=248394

Hope this helps.
Laurent Marchal.

Justin Dolezy a écrit :
> Eric Wuillai wrote on Mon, 02 November 2009 19:44
>> I'm not able to respond for other Nebula calendars, but this is actually
>> not possible with DateChooser.
>> However it should be relatively simple to add. Please post a feature
>> request in bugzilla if you are interested.
>>
>> For the alternate painting, DateChooser support the possibility to use a
>> different foreground color for non-business days. It is implemented by
>> default in the provided themes (except the new SYSTEM theme I just
>> commit today). And you can define your own themes with your own colors.
>>
>> Regards,
>> Eric
>> >
>
>
> Hi Eric,
>
> That's great, I'll raise a feature request.
>
> About the non-business days foreground painting - that currently treats
> weekends as non-business days iirc. I need to extend that so that local
> public holidays which fall during the week could also be painted as
> non-business days! Likewise for not being able to select them.. hence
> the need for a callback so the widget can query the application, if
> required, to ask if any of the dates in the displayed calendar are
> non-business days.
>
> Hope I've explained that OK..
>
> Best,
> Justin
Re: Date/Calendar widgets - any validation support? [message #495772 is a reply to message #495158] Fri, 06 November 2009 00:02 Go to previous messageGo to next message
Eric Wuillai is currently offline Eric WuillaiFriend
Messages: 27
Registered: July 2009
Junior Member
Hi Justin, Laurent,

Laurent, I noticed the patch you proposed in bugzilla, but I was quite
busy the last months to find time to look really at it.
I made several modifications to DateChooser that I published at the
beginning of the week. Now I will look to add other features. I have
some idees to implement something like what is demanded here and will
look the patch you submitted to see how I can take it in account.

Features I would like to add :
- min / max date for the calendar
- a callback with several methods allowing for each date displayed to :
forbid the selection, change colors used, add a decorator indicating an
event on the date, add a tooltip, etc...

Any idee is welcome.

Regards,
Eric

Laurent Marchal a écrit :
> Hello,
>
> This was my needs too, and I implemented this in my application. I
> have created a patch and submitted it for integration, I hope it will be
> merged one day.
>
> This should fit your needs.
> http://dev.eclipse.org/newslists/news.eclipse.technology.neb ula/msg01554.html
>
>
> Patch here :
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=248394
>
> Hope this helps.
> Laurent Marchal.
>
> Justin Dolezy a écrit :
>> Eric Wuillai wrote on Mon, 02 November 2009 19:44
>>> I'm not able to respond for other Nebula calendars, but this is actually
>>> not possible with DateChooser.
>>> However it should be relatively simple to add. Please post a feature
>>> request in bugzilla if you are interested.
>>>
>>> For the alternate painting, DateChooser support the possibility to use a
>>> different foreground color for non-business days. It is implemented by
>>> default in the provided themes (except the new SYSTEM theme I just
>>> commit today). And you can define your own themes with your own colors.
>>>
>>> Regards,
>>> Eric
>>> >
>>
>>
>> Hi Eric,
>>
>> That's great, I'll raise a feature request.
>>
>> About the non-business days foreground painting - that currently
>> treats weekends as non-business days iirc. I need to extend that so
>> that local public holidays which fall during the week could also be
>> painted as non-business days! Likewise for not being able to select
>> them.. hence the need for a callback so the widget can query the
>> application, if required, to ask if any of the dates in the displayed
>> calendar are non-business days.
>>
>> Hope I've explained that OK..
>>
>> Best,
>> Justin
Re: Date/Calendar widgets - any validation support? [message #495932 is a reply to message #495772] Fri, 06 November 2009 17:02 Go to previous message
Laurent Marchal is currently offline Laurent MarchalFriend
Messages: 91
Registered: July 2009
Member
Hello,

The patch I made could fulfill your needs : It allows to forbids the
selection, customize colors used, and customize the tooltip for dates.
There is not support for a custom decorator, because my needs was to use
custom colors to display that there is an event on the date. To do this
I think you will need to add a paintListener on the date's label cell to
and draw a decorator on it.

I'm not sure to fully understand what is the min / max dates feature you
need for the calendar, but I had a kind of need like this. I had to
disable all selection on dates, and only enable selections on dates
where there are some events attached, then also change the color of the
date.

What I do is (with patch applied ;))

setCustomState(null, false); // disable selection on all dates
List<Date> minMaxDateList; // list of dates interval
foreach (Date date : minMaxDateList) {
setCustomState(date, true); // enable the date selection
setCustomColor(date, GREEN); // custom color
}

What I liked in my patch is that the customization was minimal to the
DateChooser.java file (few lines of code), and you can easily add
features (like the decorator) into the class
DateChooserTheme#CustomCellProperty.

I think lots of people would need theses kind of features, I hope we
could find a way to make theses features integrated upstream.

Regards.
Laurent Marchal.

Eric Wuillai a écrit :
> Hi Justin, Laurent,
>
> Laurent, I noticed the patch you proposed in bugzilla, but I was quite
> busy the last months to find time to look really at it.
> I made several modifications to DateChooser that I published at the
> beginning of the week. Now I will look to add other features. I have
> some idees to implement something like what is demanded here and will
> look the patch you submitted to see how I can take it in account.
>
> Features I would like to add :
> - min / max date for the calendar
> - a callback with several methods allowing for each date displayed to :
> forbid the selection, change colors used, add a decorator indicating an
> event on the date, add a tooltip, etc...
>
> Any idee is welcome.
>
> Regards,
> Eric
>
> Laurent Marchal a écrit :
>> Hello,
>>
>> This was my needs too, and I implemented this in my application. I
>> have created a patch and submitted it for integration, I hope it will be
>> merged one day.
>>
>> This should fit your needs.
>> http://dev.eclipse.org/newslists/news.eclipse.technology.neb ula/msg01554.html
>>
>>
>> Patch here :
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=248394
>>
>> Hope this helps.
>> Laurent Marchal.
>>
>> Justin Dolezy a écrit :
>>> Eric Wuillai wrote on Mon, 02 November 2009 19:44
>>>> I'm not able to respond for other Nebula calendars, but this is actually
>>>> not possible with DateChooser.
>>>> However it should be relatively simple to add. Please post a feature
>>>> request in bugzilla if you are interested.
>>>>
>>>> For the alternate painting, DateChooser support the possibility to use a
>>>> different foreground color for non-business days. It is implemented by
>>>> default in the provided themes (except the new SYSTEM theme I just
>>>> commit today). And you can define your own themes with your own colors.
>>>>
>>>> Regards,
>>>> Eric
>>>
>>> Hi Eric,
>>>
>>> That's great, I'll raise a feature request.
>>>
>>> About the non-business days foreground painting - that currently
>>> treats weekends as non-business days iirc. I need to extend that so
>>> that local public holidays which fall during the week could also be
>>> painted as non-business days! Likewise for not being able to select
>>> them.. hence the need for a callback so the widget can query the
>>> application, if required, to ask if any of the dates in the displayed
>>> calendar are non-business days.
>>>
>>> Hope I've explained that OK..
>>>
>>> Best,
>>> Justin
Re: Date/Calendar widgets - any validation support? [message #598583 is a reply to message #494869] Tue, 03 November 2009 10:48 Go to previous message
Justin Dolezy is currently offline Justin DolezyFriend
Messages: 68
Registered: July 2009
Member
Eric Wuillai wrote on Mon, 02 November 2009 19:44
> I'm not able to respond for other Nebula calendars, but this is actually
> not possible with DateChooser.
> However it should be relatively simple to add. Please post a feature
> request in bugzilla if you are interested.
>
> For the alternate painting, DateChooser support the possibility to use a
> different foreground color for non-business days. It is implemented by
> default in the provided themes (except the new SYSTEM theme I just
> commit today). And you can define your own themes with your own colors.
>
> Regards,
> Eric
> >


Hi Eric,

That's great, I'll raise a feature request.

About the non-business days foreground painting - that currently treats weekends as non-business days iirc. I need to extend that so that local public holidays which fall during the week could also be painted as non-business days! Likewise for not being able to select them.. hence the need for a callback so the widget can query the application, if required, to ask if any of the dates in the displayed calendar are non-business days.

Hope I've explained that OK..

Best,
Justin
Re: Date/Calendar widgets - any validation support? [message #598590 is a reply to message #598583] Tue, 03 November 2009 22:58 Go to previous message
Laurent Marchal is currently offline Laurent MarchalFriend
Messages: 91
Registered: July 2009
Member
Hello,

This was my needs too, and I implemented this in my application. I have
created a patch and submitted it for integration, I hope it will be
merged one day.

This should fit your needs.
http://dev.eclipse.org/newslists/news.eclipse.technology.neb ula/msg01554.html

Patch here :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=248394

Hope this helps.
Laurent Marchal.

Justin Dolezy a écrit :
> Eric Wuillai wrote on Mon, 02 November 2009 19:44
>> I'm not able to respond for other Nebula calendars, but this is actually
>> not possible with DateChooser.
>> However it should be relatively simple to add. Please post a feature
>> request in bugzilla if you are interested.
>>
>> For the alternate painting, DateChooser support the possibility to use a
>> different foreground color for non-business days. It is implemented by
>> default in the provided themes (except the new SYSTEM theme I just
>> commit today). And you can define your own themes with your own colors.
>>
>> Regards,
>> Eric
>> >
>
>
> Hi Eric,
>
> That's great, I'll raise a feature request.
>
> About the non-business days foreground painting - that currently treats
> weekends as non-business days iirc. I need to extend that so that local
> public holidays which fall during the week could also be painted as
> non-business days! Likewise for not being able to select them.. hence
> the need for a callback so the widget can query the application, if
> required, to ask if any of the dates in the displayed calendar are
> non-business days.
>
> Hope I've explained that OK..
>
> Best,
> Justin
Re: Date/Calendar widgets - any validation support? [message #598598 is a reply to message #495158] Fri, 06 November 2009 00:02 Go to previous message
Eric Wuillai is currently offline Eric WuillaiFriend
Messages: 27
Registered: July 2009
Junior Member
Hi Justin, Laurent,

Laurent, I noticed the patch you proposed in bugzilla, but I was quite
busy the last months to find time to look really at it.
I made several modifications to DateChooser that I published at the
beginning of the week. Now I will look to add other features. I have
some idees to implement something like what is demanded here and will
look the patch you submitted to see how I can take it in account.

Features I would like to add :
- min / max date for the calendar
- a callback with several methods allowing for each date displayed to :
forbid the selection, change colors used, add a decorator indicating an
event on the date, add a tooltip, etc...

Any idee is welcome.

Regards,
Eric

Laurent Marchal a écrit :
> Hello,
>
> This was my needs too, and I implemented this in my application. I
> have created a patch and submitted it for integration, I hope it will be
> merged one day.
>
> This should fit your needs.
> http://dev.eclipse.org/newslists/news.eclipse.technology.neb ula/msg01554.html
>
>
> Patch here :
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=248394
>
> Hope this helps.
> Laurent Marchal.
>
> Justin Dolezy a écrit :
>> Eric Wuillai wrote on Mon, 02 November 2009 19:44
>>> I'm not able to respond for other Nebula calendars, but this is actually
>>> not possible with DateChooser.
>>> However it should be relatively simple to add. Please post a feature
>>> request in bugzilla if you are interested.
>>>
>>> For the alternate painting, DateChooser support the possibility to use a
>>> different foreground color for non-business days. It is implemented by
>>> default in the provided themes (except the new SYSTEM theme I just
>>> commit today). And you can define your own themes with your own colors.
>>>
>>> Regards,
>>> Eric
>>> >
>>
>>
>> Hi Eric,
>>
>> That's great, I'll raise a feature request.
>>
>> About the non-business days foreground painting - that currently
>> treats weekends as non-business days iirc. I need to extend that so
>> that local public holidays which fall during the week could also be
>> painted as non-business days! Likewise for not being able to select
>> them.. hence the need for a callback so the widget can query the
>> application, if required, to ask if any of the dates in the displayed
>> calendar are non-business days.
>>
>> Hope I've explained that OK..
>>
>> Best,
>> Justin
Re: Date/Calendar widgets - any validation support? [message #598606 is a reply to message #495772] Fri, 06 November 2009 17:02 Go to previous message
Laurent Marchal is currently offline Laurent MarchalFriend
Messages: 91
Registered: July 2009
Member
Hello,

The patch I made could fulfill your needs : It allows to forbids the
selection, customize colors used, and customize the tooltip for dates.
There is not support for a custom decorator, because my needs was to use
custom colors to display that there is an event on the date. To do this
I think you will need to add a paintListener on the date's label cell to
and draw a decorator on it.

I'm not sure to fully understand what is the min / max dates feature you
need for the calendar, but I had a kind of need like this. I had to
disable all selection on dates, and only enable selections on dates
where there are some events attached, then also change the color of the
date.

What I do is (with patch applied ;))

setCustomState(null, false); // disable selection on all dates
List<Date> minMaxDateList; // list of dates interval
foreach (Date date : minMaxDateList) {
setCustomState(date, true); // enable the date selection
setCustomColor(date, GREEN); // custom color
}

What I liked in my patch is that the customization was minimal to the
DateChooser.java file (few lines of code), and you can easily add
features (like the decorator) into the class
DateChooserTheme#CustomCellProperty.

I think lots of people would need theses kind of features, I hope we
could find a way to make theses features integrated upstream.

Regards.
Laurent Marchal.

Eric Wuillai a écrit :
> Hi Justin, Laurent,
>
> Laurent, I noticed the patch you proposed in bugzilla, but I was quite
> busy the last months to find time to look really at it.
> I made several modifications to DateChooser that I published at the
> beginning of the week. Now I will look to add other features. I have
> some idees to implement something like what is demanded here and will
> look the patch you submitted to see how I can take it in account.
>
> Features I would like to add :
> - min / max date for the calendar
> - a callback with several methods allowing for each date displayed to :
> forbid the selection, change colors used, add a decorator indicating an
> event on the date, add a tooltip, etc...
>
> Any idee is welcome.
>
> Regards,
> Eric
>
> Laurent Marchal a écrit :
>> Hello,
>>
>> This was my needs too, and I implemented this in my application. I
>> have created a patch and submitted it for integration, I hope it will be
>> merged one day.
>>
>> This should fit your needs.
>> http://dev.eclipse.org/newslists/news.eclipse.technology.neb ula/msg01554.html
>>
>>
>> Patch here :
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=248394
>>
>> Hope this helps.
>> Laurent Marchal.
>>
>> Justin Dolezy a écrit :
>>> Eric Wuillai wrote on Mon, 02 November 2009 19:44
>>>> I'm not able to respond for other Nebula calendars, but this is actually
>>>> not possible with DateChooser.
>>>> However it should be relatively simple to add. Please post a feature
>>>> request in bugzilla if you are interested.
>>>>
>>>> For the alternate painting, DateChooser support the possibility to use a
>>>> different foreground color for non-business days. It is implemented by
>>>> default in the provided themes (except the new SYSTEM theme I just
>>>> commit today). And you can define your own themes with your own colors.
>>>>
>>>> Regards,
>>>> Eric
>>>
>>> Hi Eric,
>>>
>>> That's great, I'll raise a feature request.
>>>
>>> About the non-business days foreground painting - that currently
>>> treats weekends as non-business days iirc. I need to extend that so
>>> that local public holidays which fall during the week could also be
>>> painted as non-business days! Likewise for not being able to select
>>> them.. hence the need for a callback so the widget can query the
>>> application, if required, to ask if any of the dates in the displayed
>>> calendar are non-business days.
>>>
>>> Hope I've explained that OK..
>>>
>>> Best,
>>> Justin
Previous Topic:OwnerDrawLabelProvider and PaintItem events for Grid/GridViewer?
Next Topic:CDateTime is null
Goto Forum:
  


Current Time: Thu Mar 28 08:30:54 GMT 2024

Powered by FUDForum. Page generated in 0.03828 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top