Re: Pure Swing + EOF distribution channel
Florijan Stamenkovic <[email protected]> Wed, 9 Nov 2005 15:41:34 +0100
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
Hi Pierre, Thanks a lot for the hand. I posted the same question to webobjects=20 list at Apple and got to a solution. I am sending a part of the thread=20= below (response from [email protected]. Please feel free to comment. Best regards, Flor > > > I've recently done something similar. I believe the correct way to do=20= > what you propose is to create a subclass of EOApplication. Make sure=20= > you have the function: > protected void finishInitialization() { > =A0=A0=A0 super.finishInitialization(); > =A0=A0=A0=A0 > =A0=A0=A0 // call your startup code > > } > > Bind this new subclass to applicationClassName in the JavaClient=20 > component. It's very similar to the server side, to get access to your=20= > application object call EOApplication.sharedInstance() and typecast it=20= > to your class. > > > The framework will be completely=A0initialized after you call the = super=20 > function and you can do what you want. The one caveat is don't specify=20= > an interfaceControllerClassname binding in your JavaClient component=20= > and do specify the EOClientApplicationSupport as the main class.=A0 > > Be sure to register your windows with the EOApplication's window=20 > observer. I=A0believe it'll quit the program if nothing is registered=20= > with it after a certain amount of time. > > Some other useful startup bindings/arguments: > > splashIconName > splashIconURL=A0 =A0 =A0=A0 =A0provides a startup splash screen based = on the icon > > One gotcha I've found is creating fetch objects from specification's=20= > in the EOModel. They appear to return null all the time. The trick is=20= > to create an EODataSource with the fetch name and then call=20 > fetchObjects on it. > > Even without the nibs, XML, and rules there is a LOT to the java=20 > client's library that you can still utilize. I'm doing something very=20= > similar to you and I've found that each time I come up with a way to=20= > do something I discover there's already a way to do it in the library=20= > with a simple function call. My biggest complaint about it is that the=20= > whole framework seems to assume that all the layout's are of=20 > EOViewLayout and will try to repackage it into one if you pass it some=20= > windows. At the very least I'd be hesitant to throw out the=20 > EOAssociations. I've already created some classes to allow creation of=20= > associations with JLabel's. > > Let me know if you figure out getting menus to work based on the=20 > EOAction's. Menu's are not required for my app but I'll be looking=20 > into it later. > > I agree the lack of documentation is a=A0horrendous oversight on = Apple's=20 > part. Hopefully they'll document what they already have before they go=20= > further.=A0 > > Hope this helps.