You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Paul Michael Reilly <pm...@pajato.com> on 2002/11/05 21:27:27 UTC

[Jelly] Bug?

Script:

  <?xml version="1.0"?>
  <j:jelly xmlns:j="jelly:core" 
           xmlns="jelly:swing" 
           xmlns:log="jelly:log"
           xmlns:define="jelly:define"
           xmlns:dcc="psg.dcc.jelly.TagLibrary">

      <menuBar var="dccMenuBar">
        <menu text="File">
          <menu text="New">
  ...
          </menuItem>
        </menu>
      </menuBar>

  ...

    <frame title="DCC" var="dccFrame"
           location="${preferredXOrigin}, ${preferredYOrigin}"
           size="${preferredWidth}, ${preferredHeight}"
           jMenuBar="${dccMenuBar}">
      <font family="helvetica" size="14"/>

      <windowListener var="event" closing="${onClosing}"/>

    </frame>

    ${dccFrame.show()}

  </j:jelly>


Is it a bug that the generated frame does not contain the menubar,
dccMenuBar?  I think it is.

When 

    ${dccFrame.setJMenuBar(dccMenuBar)}

is added, the menubar is attached correctly.

-pmr


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Jelly] Bug?

Posted by James Strachan <ja...@yahoo.co.uk>.
From: "Paul Michael Reilly" <pm...@pajato.com>
> Script:
>
>   <?xml version="1.0"?>
>   <j:jelly xmlns:j="jelly:core"
>            xmlns="jelly:swing"
>            xmlns:log="jelly:log"
>            xmlns:define="jelly:define"
>            xmlns:dcc="psg.dcc.jelly.TagLibrary">
>
>       <menuBar var="dccMenuBar">
>         <menu text="File">
>           <menu text="New">
>   ...
>           </menuItem>
>         </menu>
>       </menuBar>
>
>   ...
>
>     <frame title="DCC" var="dccFrame"
>            location="${preferredXOrigin}, ${preferredYOrigin}"
>            size="${preferredWidth}, ${preferredHeight}"
>            jMenuBar="${dccMenuBar}">
>       <font family="helvetica" size="14"/>
>
>       <windowListener var="event" closing="${onClosing}"/>
>
>     </frame>
>
>     ${dccFrame.show()}
>
>   </j:jelly>
>
>
> Is it a bug that the generated frame does not contain the menubar,
> dccMenuBar?  I think it is.
>
> When
>
>     ${dccFrame.setJMenuBar(dccMenuBar)}
>
> is added, the menubar is attached correctly.

This is a bean introspector issue. Even though the setter method is
setJMenuBar, because the first 2 characters of the name in the setter are
upper case, the property name is "JMenuBar" rather than "jMenuBar". So the
following change should fix this issue...

e.g.

    <frame title="DCC" var="dccFrame"
           location="${preferredXOrigin}, ${preferredYOrigin}"
           size="${preferredWidth}, ${preferredHeight}"
           JMenuBar="${dccMenuBar}">

At some point it'd be great to generate the tag reference document for the
JellySwing tags using the real introspection information from the Swing
beans so that it'd be obvious what property names are available and what
their types are.

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>