You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by anton dos santos <ad...@free.fr> on 2011/01/08 20:05:40 UTC

How to change skin

Hi

I need a calendar where only month and year can be selected.
I choose to customize a regular Calendar with a simplified version of TerraCalendarSkin ( without 
the days table). But when I invoke setSkin() on it, I get an exception: 
java.lang.IllegalStateException: Skin is already installed. I also tried skin.install(), but then I 
still have the initial skin.

Or should I do it differently, without skin?

Regards
Anton

Re: How to change skin

Posted by Greg Brown <gk...@verizon.net>.
Yup, looks good!

On Jan 10, 2011, at 3:56 PM, anton dos santos wrote:

> got it
> I added this line in Application#startup:
>  Theme.getTheme().set( MonthCalendar.class, TerraMonthCalendarSkin.class);
> 
> and my custom calendar constructor is:
>  public MonthCalendar(int year,int month) {
>    super( year, month);
>    installSkin( MonthCalendar.class);
>  }
> 
> Regards
> Anton
> 
> On 09/01/2011 01:49, Greg Brown wrote:
>> If you want to change the skin of all Calendars, you can call Theme#set() to map Calendar.class to your custom calendar skin. If you only want to change specific Calendar instances, you can create a custom Calendar subclass (e.g. MyCalendar) and add a mapping of that class to your custom skin class to the theme.
>> G
>> 
>> On Jan 8, 2011, at 2:05 PM, anton dos santos wrote:
>> 
>>> Hi
>>> 
>>> I need a calendar where only month and year can be selected.
>>> I choose to customize a regular Calendar with a simplified version of TerraCalendarSkin ( without the days table). But when I invoke setSkin() on it, I get an exception: java.lang.IllegalStateException: Skin is already installed. I also tried skin.install(), but then I still have the initial skin.
>>> 
>>> Or should I do it differently, without skin?
>>> 
>>> Regards
>>> Anton
>> 
>> 
> 


Re: How to change skin

Posted by anton dos santos <ad...@free.fr>.
got it
I added this line in Application#startup:
   Theme.getTheme().set( MonthCalendar.class, TerraMonthCalendarSkin.class);

and my custom calendar constructor is:
   public MonthCalendar(int year,int month) {
     super( year, month);
     installSkin( MonthCalendar.class);
   }

Regards
Anton

On 09/01/2011 01:49, Greg Brown wrote:
> If you want to change the skin of all Calendars, you can call Theme#set() to map Calendar.class to your custom calendar skin. If you only want to change specific Calendar instances, you can create a custom Calendar subclass (e.g. MyCalendar) and add a mapping of that class to your custom skin class to the theme.
> G
>
> On Jan 8, 2011, at 2:05 PM, anton dos santos wrote:
>
>> Hi
>>
>> I need a calendar where only month and year can be selected.
>> I choose to customize a regular Calendar with a simplified version of TerraCalendarSkin ( without the days table). But when I invoke setSkin() on it, I get an exception: java.lang.IllegalStateException: Skin is already installed. I also tried skin.install(), but then I still have the initial skin.
>>
>> Or should I do it differently, without skin?
>>
>> Regards
>> Anton
>
>


Re: How to change skin

Posted by Greg Brown <gk...@verizon.net>.
If you want to change the skin of all Calendars, you can call Theme#set() to map Calendar.class to your custom calendar skin. If you only want to change specific Calendar instances, you can create a custom Calendar subclass (e.g. MyCalendar) and add a mapping of that class to your custom skin class to the theme.
G

On Jan 8, 2011, at 2:05 PM, anton dos santos wrote:

> Hi
> 
> I need a calendar where only month and year can be selected.
> I choose to customize a regular Calendar with a simplified version of TerraCalendarSkin ( without the days table). But when I invoke setSkin() on it, I get an exception: java.lang.IllegalStateException: Skin is already installed. I also tried skin.install(), but then I still have the initial skin.
> 
> Or should I do it differently, without skin?
> 
> Regards
> Anton