bsorrentino / swixml2

Project that extends the original swixml project providing integration with Swing Application Framework (JSR 296) and Beans Binding (JSR 295) to further simplifying the GUI creation & management
0 stars 0 forks source link

ConstraintsTagProcessor doesn't take namespaces into account on processComponent(...) #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Define namespace (even default) for component markup as per [UseSchema]
2. Use GridBagLayout as a layout and <gridbagconstraints .../> elements to 
define constraints for elements as per (rev.1050, line 
72)[http://code.google.com/p/swixml2/source/browse/trunk/core/src/main/java/org/
swixml/layoutconverters/GridBagLayoutConverter.java?r=1050#72]
3. Render layout with SwingApplication.render()

What is the expected output? What do you see instead?
<gridbagconstraints .../> elements should be taken into account but they are 
not.

What version of the product are you using? On what operating system?
swixml 2.5.20110914 with JDK 1.6.26b on WinXP

Please provide any additional information below.
It appears that ConstraintTagProcessor code ignores possible usage of XML 
namespaces on component processing and hence cannot find <gridbagconstraints 
.../> child elements (and other actually - it seems to be a common issue with 
markup document parsing). Here is a link to the code line ignoring namespaces 
(rev.1050, line 54): 
http://code.google.com/p/swixml2/source/browse/trunk/core/src/main/java/org/swix
ml/processor/ConstraintsTagProcessor.java?r=1050#54

<code language="java">
Element grandchild = child.getChild(Parser.TAG_GRIDBAGCONSTRAINTS);
</code>

Whether you update this line as follows it becomes able to find desired child 
element:
<code language="java">
Element grandchild = child.getChild(Parser.TAG_GRIDBAGCONSTRAINTS, 
child.getNamespace());
</code>

Original issue reported on code.google.com by kozlovda...@gmail.com on 16 Sep 2011 at 7:42

GoogleCodeExporter commented 9 years ago
A workaround is to not-define/comment-out namespace declaration before 
application run.

Original comment by kozlovda...@gmail.com on 16 Sep 2011 at 7:45

GoogleCodeExporter commented 9 years ago
thx for feedback 

i'll cjheck asap

Original comment by bartolom...@gmail.com on 16 Sep 2011 at 9:16

GoogleCodeExporter commented 9 years ago
I've verified your fix and deployed a new SNAPSHOT (2.5-SNAPSHOT) 

Soon i'll arrange a new release

Thanks again for contribution

Original comment by bartolom...@gmail.com on 16 Sep 2011 at 2:42

GoogleCodeExporter commented 9 years ago
Hi!
Thank you for great responsiveness :-)

Original comment by kozlovda...@gmail.com on 16 Sep 2011 at 3:55

GoogleCodeExporter commented 9 years ago
Hi 

i've release the 2.5-20110919 with your patch

thx again

Original comment by bartolom...@gmail.com on 19 Sep 2011 at 8:32

GoogleCodeExporter commented 9 years ago
Hi 

i've release the 2.5-20110919 with your patch

thx again

Original comment by bartolom...@gmail.com on 19 Sep 2011 at 8:32