Re: FormLayout & Swixml Marriage
kate rhodes <[email protected]>
| Newsgroups | gmane.comp.embedded.carlsbad-cubes |
|---|---|
| Message-ID | <[email protected]> |
After only giving it a couple mins thought I like it. I would change
<layout type= to <layout name= for a little more consistency but that's
nitpicky.
We might want to be able to specify multiple tag files though. For
example.. the standard distribution tag file and company x's tag file
which adds to the standard one... would have to have some means of
dealing with name conflicts specifying which files get precedence,
maybe the order loaded? each successive conflicting addition superceeds ?
something else we need, or, *I* think we need, though is support of sub
tags... for example
<combobox ....>
<option... ></option>
<option... ></option>
</combobox>
I know wolf doesn't want to support the dynamic population of combo
boxes in SWIXML as it starts to veer off into the world of functional
xml instead of strict layout xml but as a 3rd party it's something I'd
really like to add. But, there isn't a good way to handle those "option"
tags at the moment as there isn't a way to just add a component to a
combo box in the way SWIXML does things.
Brian P Michael wrote:
> Everyone,
>
> I am looking at the code to see what it would take to add an
> extensible layout system.
>
> I don't think it would be to hard to complete.
>
> Changes that would need to occur
>
> 1) ConstraintsConverter.java class
> a) add a set of
> registerConstraintHelper("borderlayout",borderConstrainthelper.class)
> b) Call those classes based upon which layout it used.
> 2) LayoutConverter.java
> a) add a set of
> RegisterLayoutConverter("borderlayout",borderLayoutConverter.class)
> b) add a set of LayoutConverters, one converter per class.
> Break the routine apart and call the appropriate converter class
>
>
> 3) Parser.java
> a) Change the single line
> LayoutManager layoutMgr = obj instanceof Container ? ( (Container) obj
> ).getLayout() : null;
>
> I am not sure what would be needed here yet.
>
> The key to this would be a flexible register function that also
> accepts an XML file.
>
> E.g. in SwingTagLibrary
> Instead of having
> protected void registerTags() {
> registerTag( "Applet", JApplet.class );
> registerTag( "Button", JButton.class );
> registerTag( "ButtonGroup", ButtonGroup.class );
> registerTag( "HBox", XHBox.class );
> registerTag( "VBox", XVBox.class );
> registerTag( "Checkbox", JCheckBox.class );
> ........
> registerLayout("BorderLayout","BorderLayoutConstraints.class",
> "BorderLayoutConverter.class");
> registerLayout("FlowLayout","FlowLayoutConstraints.class",
> "FlowLayoutConverter.class");
>
>
> We would need:
> registerTag("tagfile"); or
>
>
> SwingEngine("tagfile").
>
> A default filename of swingTaglibrary.xml could be also established.
>
> Where tagfile is a filename with XML in it.
> E.g.
> <tag name="Applet" class="JApplet.class"/>
> <tag name="Button" class="JButton.class"/>
> <tag name="ButtonGroup" class="ButtonGroup.class"/>
> <layout type="BorderLayout"
> constraintHelper="BorderLayoutConstraints.class"
> converterClass="BorderLayoutConverter.class"/>
> <layout type="FlowLayout"
> constraintHelper="FlowLayoutConstraints.class"
> converterClass="FlowLayoutConverter.class"/>
> <layout type="GridBagLayout"
> constraintHelper="GridBagConstraints.class"
> converterClass="GridBagLayoutConverter.class"/>
>
>
> Any comments.
>
>
> Sincerely,
>
> Brian P Michael
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Forum mailing list
>[email protected]
>http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
>
>