----- Original Message ----- From: "Matt Benson" <[EMAIL PROTECTED]>
To: "Ant Users List" <user@ant.apache.org>
Sent: Friday, February 10, 2006 6:27 PM
Subject: Re: Displaying the value in a Java class?



--- Rhino <[EMAIL PROTECTED]> wrote:
[SNIP]
Here is my task again:

 <antmenu title="Verify Employment History Format"
  stylesheet="${resume.xml.dir}\resume.style"

image="${resume.xml.dir}\maximal.orange.129x30.jpg">
  <label>The current value of the
DESIRED_EMPLOYMENT_HISTORY_FORMAT constant
in the ResumeConstants class is:
${DESIRED_EMPLOYMENT_HISTORY_FORMAT}.</label>
  <label>If that value is satisfactory, press the
Proceed button.</label>
  <label>If the value is wrong, press the Abort
button to stop the build.
Then, edit the value of the property in the
ResumeConstants.java class and
run the build again.</label>
  <link label="Proceed" target="jar"/>
  <link label="Abort" target="abort"/>
 </antmenu>

I think the answer to your question is that I am
trying to display the
property via nested XML text, i.e. the label tag.
I'm not sure how to pass
that same value to the AntMenu task as an attribute.
And, if I did, how
would AntMenu know where to put the attribute, i.e
where to display the
sentence that I want?

You can see the documentation for AntMenu at this
page:
http://antforms.sourceforge.net/usageam.html


Okay, having looked at this, including the source, 1)
AntForms needs to have its BaseType class extend
ProjectComponent and call
getProject().replaceProperties(text) whenever text is
added.  But that doesn't help you.  If you hate the
text box the <label> tag creates anyway, why don't you
bundle all the text you want into the title attribute
of the <antmenu>?

Actually, I hate the textbox that 'input' gives you; 'antmenu' is just fine except that it doesn't expand properties like DESIRED_EMPLOYMENT_HISTORY_FORMAT (or ant.home for that matter).

You can get line breaks with the
property ${line.separator}.  A handy trick is to,
early on, define a shorter property (I use "br"):

<property name="br" value="${line.separator}" />

Then you can do:

<antmenu title="Verify Employment History
Format${br}The current value of the
DESIRED_EMPLOYMENT_HISTORY_FORMAT constant
in the ResumeConstants class is:
${DESIRED_EMPLOYMENT_HISTORY_FORMAT}.${br}If that
value is satisfactory, press the
Proceed button.${br}If the value is wrong, press the
Abort button to stop the build.${br}
Then, edit the value of the property in the
ResumeConstants.java class and
run the build again."
stylesheet="${resume.xml.dir}\resume.style"
image="${resume.xml.dir}\maximal.orange.129x30.jpg">

  <link label="Proceed" target="jar"/>
  <link label="Abort" target="abort"/>
</antmenu>

something along those lines...

I tried doing the title along the lines you suggested and got a partial success: 'title' successfully expands the property! Unfortunately, it also displays title text in an inappropriately large font. But I think I can get into the "style sheet" (a properties file that has similar affect to CSS) for the antform and shrink it to a more reasonable size.

Your 'br' trick failed to work. I checked my typing very carefully but 'title' didn't put the line breaks where I asked for them. (The value in the title attribute also appears as the dialog title and I got two small square boxes where I'd put the 'br' property; the two square boxes didn't appear in the 'title' portion of the menu proper.) I'm not sure why that failed but I can live with this approach, especially if I can make the title font a bit smaller.

That looks like the closest I am going to get for the time being; maybe next year the AntForm folks will properly expand properties in the <label> tags and/or observe 'line.separator' in the 'title' attribute. Or maybe 'input' will be made so attractive that I'll start using it again. :-) But, in the meantime, I suppose this will do. Not ideal but reasonably good for my purpsoses.

you might put the title
in a file with a token defined where the variable part
goes, then load that file into a property filtering in
the property you've already set from your Java class,
just to make your poor task invocation look a little
more compact.

Oh, that's not a big concern for me but thanks for the suggestion anyway.

And THANK YOU VERY VERY MUCH for all your help with this! I knew there had to be a more straightforward way to display that variable value when I started this thread and you helped me find it and get it working to a satisfactory level. I really appreciate all the time you gave me to help me get this far. I owe you one :-)

--
Rhino


-Matt

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.5/256 - Release Date: 10/02/2006





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.5/256 - Release Date: 10/02/2006


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to