KonamiCode and StyleCalendar widgets

Hi.

I created a couple of new widgets. The demos can be found here:
KonamiCodeListener
and
StyleCalendar
.

KonamiCodeListener listens to the famous
Konami Code
and fires an event when it is typed. It should work where ever in the application it is.

StyleCalendar is a simple calendar implementation, with a few customization options. Its main feature is the ability to add custom stylenames to specific dates. The Css should be easily modifable too.

Sources can be found from the contrib:
KonamiCodeListener
and
StyleCalendar

Haha I wanted to implement the Konami Code into my project, too! :smiley: Thanks for providing that :wink:

Updated KonamiCodeListener to a general KeyCodeListener, which can accept any array of keycodes. Sources
here
.

Hi Risto

I tried to use the
stylecalendar-0.5.jar
but i am getting the error as attached in the image file.

I tried to get the
widgets
but there seems to be no files.

Can you let me know, what is the mistake i am making ?

Thanks and Regards
Vasu
11238.jpg

Hi. It seems you haven’t compiled the widgetset. When ever you add custom widgets to your project, you have rebuild the client-side code so that it includes the new stuff. If you use Eclipse and the
Vaadin-plugin
, instructions can be found
here
. If you want to create your own build-scripts, read
this
.

Hi

Thanks for the answer.

Regards
Vasu

Hi,

I was wondering if it’s some how possible to add tooltips for each calendar day (or all days which fulfill some condition)?

I’m making a portlet which fetches events from Liferay calendar and shows those days with events in a small calendar. I would like to add list of events per day as a tooltip or some other similar way.

Hi, and sorry for the late reply. The tooltips seem like a good idea, and shouldn’t be too hard to implement. I’ll implement those for the next version soon (1-2 weeks).

It will be nice to add few methods like showPreviousYear/showNextYear, or simply rename setShowingMonth to setShowingDate, if you do not want to duplicate code.


public void showPreviousYear() {
		Calendar calendar = getCalendarInstance();
		calendar.setTime(getShowingDate());
		calendar.set(Calendar.DAY_OF_MONTH, 1);
		calendar.add(Calendar.YEAR, -1);

        //Here will be better to call such method as setShowingDate(Date date)
		setShowingMonth(calendar.getTime());
	}

Do you plan to restore in new version of your add-on such methods as isDisabledMonth and setEnabledDateRange?

Your have duplicate CSS (.v-stylecalendar .week .selected .gwt-Label) style for one element in your calender and this do not allow to set different CSS style for it.

I am using styelecalender-0.5.jar, but I did not find the method setEnabledDateRange in the class…

I want to disable the previous dates , and enable only the future date.
I have seen there is a change to support the this feature , change log source: svn/contrib/StyleCalendar/stylecalendar-0.5.jar @ 22193

@13467 18 months risto.yrjana - added options for disabling dates and date ranges - added a field …
@10901 23 months risto.yrjana - added directory compatible jar - cleanup

when I download the jar from the site , I do not find this method.

Thanks,
Raju

Thanks for all your comments. I’ll check&update the project, I probably uploaded the wrong JAR.

I uploaded a new version to the Directory. It should fix the disabled dates, and setting the date from the server-side. I also removed the duplicate CSS. Next up, tooltips.

Hi, Risto!
Unfortunately this links not available now:

risto.virtuallypreinstalled.com
The requested host is not available at the moment 

Can you fix it?

in 0.6, disabled date logic is incorrect. You are storing disabled dates as a List of Integer values. However, you are including days that fill out the first and last week of the displayed month, without any indication of which month the date belongs to. In this case, it is quite easy to disable the 1st of the following month, displayed in the final week of the current calendar, but not the 1st of the current month. The 1st of the displayed month is rendered correctly as clickable/enabled, but the click event is discarded because “1” exists in the list of “disabledRenderedDays”. But 1 is there representing the 1st of the following month, not the current month.

This happens only when you have a DateOptionsGenerator, because its isDateDisabled() method is called for all displayed dates, not just dates in the current month.

You already disable selection of days outside the displayed month, but not by putting them in the disabledRenderedDays list, so isDateDisabled() should not be called for them.

Thanks for the report, created
https://github.com/ripla/StyleCalendar/issues/1

Hi Risto,

thanks for the StyleCalendar, it’s a very useful addon. But unfortunately it does not support popup-view yet. I have seen there is a StyleCalendarField in GIT, but it’s not in the JAR. Is it already usable? Could you please publish a version containing this feature? And while talking about wishes: It would be great if StyleCalendarField#getNewStyleCalendar() would be protected instead of private for making inheriting easier.

ty,
Tobias

I started writing StyleCalendarField back when I first wrote StyleCalendar, but I haven’t had the time to work on it since then. I’ll try to squeeze in a very simple (read: working) version to the next release. Good to hear you’re finding the add-on useful. :slight_smile:

Released 1.0 with bugfixes, tooltip support and an experimental version of StyleCalendarField.