Re: Component wiring mess in 'HomePage'

2010-12-08 Thread Jeremy Thomerson
On Wed, Dec 8, 2010 at 1:39 PM, Peter Karich wrote: > the MyFooListener needs to be implemented somewhere in HomePage, right? If you do it as an anonymous inner class. > Or do you mean that I will have a separate class for each listener passing > in the necessary references ala: > fp.addOnClickL

Re: Component wiring mess in 'HomePage'

2010-12-08 Thread Hans Lesmeister
Hi, Maybe consider something like this: interface ClickController { void click(); } class YourPage extends WebPage { protected void onInitialize() { ClickController clickController = new ClickController() { void click() { doSomething(); } } } ad

Re: Component wiring mess in 'HomePage'

2010-12-08 Thread Peter Karich
Am 08.12.2010 17:48, schrieb James Carman: On Wed, Dec 8, 2010 at 11:41 AM, Jeremy Thomerson wrote: So, to make that shorter, use the "listener" approach suggested further up in the thread. Like: Slight correction, it was the "listenery" approach. :) yeah :-) I don't want to stress the

Re: Component wiring mess in 'HomePage'

2010-12-08 Thread James Carman
On Wed, Dec 8, 2010 at 11:41 AM, Jeremy Thomerson wrote: > > So, to make that shorter, use the "listener" approach suggested > further up in the thread.  Like: > Slight correction, it was the "listenery" approach. :) - To unsubs

Re: Component wiring mess in 'HomePage'

2010-12-08 Thread Jeremy Thomerson
On Wed, Dec 8, 2010 at 10:27 AM, Peter Karich wrote: >  Hi all, > > sorry, maybe I didn't explain my problem very well. I am trying it again. > > I am using exactly this "stub-method" approach for all my panels. > > But in HomePage I am wiring all those panels together to use them. > I appended**

Re: Component wiring mess in 'HomePage'

2010-12-08 Thread Peter Karich
Hi all, sorry, maybe I didn't explain my problem very well. I am trying it again. I am using exactly this "stub-method" approach for all my panels. But in HomePage I am wiring all those panels together to use them. I appended** an example, where the onTagClick method is overriden in HomePage.

Re: Component wiring mess in 'HomePage'

2010-12-07 Thread Pierre Goupil
Yes, that's a decorator pattern, which could a be good practice. You don't use inheritance since you've just got a Panel, not a Page. So feel free to go for that solution, I find it smart, too. On Wed, Dec 8, 2010 at 7:51 AM, Jeremy Thomerson wrote: > On Tue, Dec 7, 2010 at 4:08 AM, Peter Karic

Re: Component wiring mess in 'HomePage'

2010-12-07 Thread Jeremy Thomerson
On Tue, Dec 7, 2010 at 4:08 AM, Peter Karich wrote: > regarding the panels: I'm using a lot of them. But for instantiation I need > to > specify what to do onClick so I could reuse the panel in a different context > somewhen later. > I mean, when the panelA detects a click this is forwarded to the

Re: Component wiring mess in 'HomePage'

2010-12-07 Thread Peter Karich
Create components out of some of the groups of components that logically belong together? James, What do you mean here? Basically...use Panels. As for the propagation of the events, you could try using a more "listenery" approach, rather than doing the abstract onClick() method, especially s

Re: Component wiring mess in 'HomePage'

2010-12-07 Thread James Carman
On Tue, Dec 7, 2010 at 5:08 AM, Peter Karich wrote: >> Create components out of some of the groups of components that >> logically belong together? > > James, What do you mean here? > Basically...use Panels. As for the propagation of the events, you could try using a more "listenery" approach, r

Re: Component wiring mess in 'HomePage'

2010-12-07 Thread Peter Karich
I always try to identify logical groups and delegate creation of those to separat private methods. And use Panels for reusability. Hans, the private method trick should do it although the HomePage is still lenghty. regarding the panels: I'm using a lot of them. But for instantiation I ne

Re: Component wiring mess in 'HomePage'

2010-12-06 Thread James Carman
Create components out of some of the groups of components that logically belong together? On Mon, Dec 6, 2010 at 4:37 PM, Hans Lesmeister wrote: > Hi, > >> I have some components and I'm wiring them together directly within a >> 300 lines init method in the HomePage class ** >> Now this method is

Re: Component wiring mess in 'HomePage'

2010-12-06 Thread Hans Lesmeister
Hi, > I have some components and I'm wiring them together directly within a > 300 lines init method in the HomePage class ** > Now this method is 'a bit' lengthy and unreadable. How would you make it > more maintainable? I always try to identify logical groups and delegate creation of those to se

Component wiring mess in 'HomePage'

2010-12-06 Thread Peter Karich
Hi, I have some components and I'm wiring them together directly within a 300 lines init method in the HomePage class ** Now this method is 'a bit' lengthy and unreadable. How would you make it more maintainable? Regards, Peter. ** https://github.com/karussell/Jetwick/blob/master/src/main/j