Re: [SrcML] XHTML-ViewPlugin
Status: Beta
Brought to you by:
crashchaos
From: Frank R. <fra...@un...> - 2005-11-18 16:39:00
|
On Fri, Nov 18, 2005 at 11:22:13AM +0100, Leif Bladt wrote: > >What about adding a boolean variable then for the different events > >specifying whether they should fire DoneEvents and an accessor > >method to > >set this behavior? > Nice idea. So this variable could be in ViewEvent itself, with a get- > and set-method. And the default value for a plugin is set in its > constructor? In this case, you have to change thee default every time > you create an event. Could we get this into the view platform, so > that we could define the behaviours only when we create the view > platform? Actually I was thinking about having it in the ViewPlatform right from the start. So that for every platform you create you can customize what events you want to be handled. Let me elaborate this a bit further: These are the event classes currently existing: NewlineEvent, NextElementEvent, StringEvent, WhitespaceEvent Let's add corresponding Done-Events: NewlineDoneEvent, NextElementDoneEvent, StringDoneEvent, WhitespaceDoveEvent Now create a Set<java.lang.Class> in the ViewPlatform which by default contains all those event classes. Add methods to add/remove/clear classes to/from this set. And in View.sendEvent(ViewEvent) perform a single lookup whether the event's class is in the set. If not the event is immediately thrown away. For performance reasons the ViewPlatform can also keep some boolean variables f.ex. for the generation of the *DoneEvent objects. Those variables will have to be consistent with the set of course and can be used to even avoid the instantiation of those events. How does that sound to you? Anything I'm missing there? -- Raiser, Frank Student @ University of Ulm (www.uni-ulm.de) Every technology really needs to be shipped with a special manual-- not how to use it but why, when and for what. (Alan Kay) |