Thursday, March 30, 2006

Swinging it!

After the release of AgileWiki-alpha13 this morning I've been digging into the NetBeans 5.0 GUI builder and doing a bunch of web searches for additional resources. The problem is that the XML document describing the page is more dynamic and/or far less complete than is needed to do a swing front-end. Woops!

I really like the kind of layouts you can create with NetBeans, you've gotta work hard to do it badly. But these layouts assume a fixed set of components. That's a prolem. And no, I don't want to do something like SwiXML--the XML document should be independent of the client. And no, I don't want to transform the XML document, that's too much work.

The key to this puzzle is that you can specify the constructor of a component. So while a layout may be fixed, the contents of the JPanels can vary tremendously. So what I need to do is have a fixed content for each type of XML element. I need to segregate the role an element plays (given by the XML tag name) from the GUI component used to display it. We can do that just by adding a type attribute. Bada Bing!

A page has 3 parts: the header, the body and the prompt (though the order in the display will depend on the client). Now if the header is generated by class Rolon, you use the normal GUI header component. But if it is generated by the JSec subclass, you use the JSec header component.

Further complication comes when adding multiple interfaces to a client, but this can likely be handled by prefixing the type with the interface name and using a default for the element type when there is no GUI component associated with the compound type name.

I think this will work. I'll still need to enhance the display event generation a bit, but nothing like the changes I'd need to make for SwiXML. And I get to use the GUI components produced using NetBeans.

Happyness is! :-)

Bill

1 Comments:

At Fri Mar 31, 07:45:00 PM GMT+5:30, Blogger Bill la Forge said...

Well we can all dream at least. I'd like to see AgileWiki, as an open and extensible application platform, offer the same kind of service.

 

Post a Comment

<< Home