Re: Reusable component and customization
On Tue, 22 Jan 2008, Igor Vaynberg wrote: a) read javadoc b) create subclass (1 min) c) paste example markup from javadoc into subclass.html file (1 min) c) edit subclass.html What I do is a) create Subclass (10 seconds) b) click to the Superclass in IDE c) click to Superclass.html that is next to Superclass.java d) copy, paste, go home (30 sec) ...that being said, it's not that easy when the component instantiates various other components that you want to customise. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusable component and customization
If it is just css then what you could do is an overridable method getCSS that returns a ResourceReference that you add to your component. On 1/23/08, Martijn Lindhout [EMAIL PROTECTED] wrote: Hi, I just build a simple reusable shoppingcart component with a reasonable default CSS style. The markup, css and images are all packaged resources. How do I enable users of my component to override the default styling? What is the wicket way besides subclassing the CartPanel component and providing a custom markup? Regards, -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusable component and customization
On Wednesday 23 January 2008 11:47:26 Martijn Lindhout wrote: users need to open the jar, pick the right markup file, copy it, changes css attributes, etc. That's not what I expect from component reuse, right? Or do I miss something? The other option is to create overridable methods which provide styling. Like FeedbackPanel#getCSSClass() or BaseTree#getCSS(). Dima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusable component and customization
I like that one with the ResourceReference. What about providing a setter on the component, so that no subclassing is needed? 2008/1/23, Dmitry Kandalov [EMAIL PROTECTED]: On Wednesday 23 January 2008 11:47:26 Martijn Lindhout wrote: users need to open the jar, pick the right markup file, copy it, changes css attributes, etc. That's not what I expect from component reuse, right? Or do I miss something? The other option is to create overridable methods which provide styling. Like FeedbackPanel#getCSSClass() or BaseTree#getCSS(). Dima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29
Re: Reusable component and customization
On Jan 23, 2008 1:12 AM, Dmitry Kandalov [EMAIL PROTECTED] wrote: On Wednesday 23 January 2008 12:55:17 Martijn Lindhout wrote: I like that one with the ResourceReference. What about providing a setter on the component, so that no subclassing is needed? IMO setter or constructor parameter should be ok, though Wicket classes use getters (probably to reduce session size?). Yep, we often work with overridable methods instead of properties because it saves memory. Probably not something you have to worry too much about when you create your custom components, but especially for the Wicket basic components, this can make quite the difference. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusable component and customization
On Wednesday 23 January 2008 12:55:17 Martijn Lindhout wrote: I like that one with the ResourceReference. What about providing a setter on the component, so that no subclassing is needed? IMO setter or constructor parameter should be ok, though Wicket classes use getters (probably to reduce session size?). Dima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusable component and customization
that makes sense. 2008/1/23, Eelco Hillenius [EMAIL PROTECTED]: On Jan 23, 2008 1:12 AM, Dmitry Kandalov [EMAIL PROTECTED] wrote: On Wednesday 23 January 2008 12:55:17 Martijn Lindhout wrote: I like that one with the ResourceReference. What about providing a setter on the component, so that no subclassing is needed? IMO setter or constructor parameter should be ok, though Wicket classes use getters (probably to reduce session size?). Yep, we often work with overridable methods instead of properties because it saves memory. Probably not something you have to worry too much about when you create your custom components, but especially for the Wicket basic components, this can make quite the difference. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29
Re: Reusable component and customization
heh, if its just a css reference then why have your component include a default one at all? let the user style it however they like by including their own css files. -igor On Jan 23, 2008 1:33 AM, Martijn Lindhout [EMAIL PROTECTED] wrote: that makes sense. 2008/1/23, Eelco Hillenius [EMAIL PROTECTED]: On Jan 23, 2008 1:12 AM, Dmitry Kandalov [EMAIL PROTECTED] wrote: On Wednesday 23 January 2008 12:55:17 Martijn Lindhout wrote: I like that one with the ResourceReference. What about providing a setter on the component, so that no subclassing is needed? IMO setter or constructor parameter should be ok, though Wicket classes use getters (probably to reduce session size?). Yep, we often work with overridable methods instead of properties because it saves memory. Probably not something you have to worry too much about when you create your custom components, but especially for the Wicket basic components, this can make quite the difference. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusable component and customization
how do I reference such a CSS? 2008/1/23, Igor Vaynberg [EMAIL PROTECTED]: heh, if its just a css reference then why have your component include a default one at all? let the user style it however they like by including their own css files. -igor On Jan 23, 2008 1:33 AM, Martijn Lindhout [EMAIL PROTECTED] wrote: that makes sense. 2008/1/23, Eelco Hillenius [EMAIL PROTECTED]: On Jan 23, 2008 1:12 AM, Dmitry Kandalov [EMAIL PROTECTED] wrote: On Wednesday 23 January 2008 12:55:17 Martijn Lindhout wrote: I like that one with the ResourceReference. What about providing a setter on the component, so that no subclassing is needed? IMO setter or constructor parameter should be ok, though Wicket classes use getters (probably to reduce session size?). Yep, we often work with overridable methods instead of properties because it saves memory. Probably not something you have to worry too much about when you create your custom components, but especially for the Wicket basic components, this can make quite the difference. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29
Re: Reusable component and customization
whats wrong with subclassing and providing your own markup? -igor On Jan 22, 2008 11:22 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: Hi, I just build a simple reusable shoppingcart component with a reasonable default CSS style. The markup, css and images are all packaged resources. How do I enable users of my component to override the default styling? What is the wicket way besides subclassing the CartPanel component and providing a custom markup? Regards, -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusable component and customization
well, then the users of my the component need to know the internals of the component. That's not what I want, or at least reduce it to the minimum. 2008/1/23, Igor Vaynberg [EMAIL PROTECTED]: whats wrong with subclassing and providing your own markup? -igor On Jan 22, 2008 11:22 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: Hi, I just build a simple reusable shoppingcart component with a reasonable default CSS style. The markup, css and images are all packaged resources. How do I enable users of my component to override the default styling? What is the wicket way besides subclassing the CartPanel component and providing a custom markup? Regards, -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29
Re: Reusable component and customization
what internals do they need to know to create a subclsas? -igor On Jan 22, 2008 11:40 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: well, then the users of my the component need to know the internals of the component. That's not what I want, or at least reduce it to the minimum. 2008/1/23, Igor Vaynberg [EMAIL PROTECTED]: whats wrong with subclassing and providing your own markup? -igor On Jan 22, 2008 11:22 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: Hi, I just build a simple reusable shoppingcart component with a reasonable default CSS style. The markup, css and images are all packaged resources. How do I enable users of my component to override the default styling? What is the wicket way besides subclassing the CartPanel component and providing a custom markup? Regards, -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusable component and customization
users need to open the jar, pick the right markup file, copy it, changes css attributes, etc. That's not what I expect from component reuse, right? Or do I miss something? 2008/1/23, Igor Vaynberg [EMAIL PROTECTED]: what internals do they need to know to create a subclsas? -igor On Jan 22, 2008 11:40 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: well, then the users of my the component need to know the internals of the component. That's not what I want, or at least reduce it to the minimum. 2008/1/23, Igor Vaynberg [EMAIL PROTECTED]: whats wrong with subclassing and providing your own markup? -igor On Jan 22, 2008 11:22 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: Hi, I just build a simple reusable shoppingcart component with a reasonable default CSS style. The markup, css and images are all packaged resources. How do I enable users of my component to override the default styling? What is the wicket way besides subclassing the CartPanel component and providing a custom markup? Regards, -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29
Re: Reusable component and customization
a) read javadoc b) create subclass (1 min) c) paste example markup from javadoc into subclass.html file (1 min) c) edit subclass.html the only overhead is two minutes, or am i missing something? -igor On Jan 22, 2008 11:47 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: users need to open the jar, pick the right markup file, copy it, changes css attributes, etc. That's not what I expect from component reuse, right? Or do I miss something? 2008/1/23, Igor Vaynberg [EMAIL PROTECTED]: what internals do they need to know to create a subclsas? -igor On Jan 22, 2008 11:40 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: well, then the users of my the component need to know the internals of the component. That's not what I want, or at least reduce it to the minimum. 2008/1/23, Igor Vaynberg [EMAIL PROTECTED]: whats wrong with subclassing and providing your own markup? -igor On Jan 22, 2008 11:22 PM, Martijn Lindhout [EMAIL PROTECTED] wrote: Hi, I just build a simple reusable shoppingcart component with a reasonable default CSS style. The markup, css and images are all packaged resources. How do I enable users of my component to override the default styling? What is the wicket way besides subclassing the CartPanel component and providing a custom markup? Regards, -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martijn Lindhout JointEffort IT Services http://www.jointeffort.nl [EMAIL PROTECTED] +31 (0)6 18 47 25 29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]