Well, it should get added into the menu automatically.  There is a method 
"getStaticLabel()" 
which needs to deliver the String that will be used in the menu.  How it happens is by 
magic :-)

The current documentation that is there for developers is very out-of-date.  I tried a 
long time 
ago to write up some instructions, but they were a dismal failure, and I haven't 
bothered with it 
too much since.  I know, bad bad bad.  

Here are the basics:  The key is what the class type is.  A class called 
"org.apache.jmeter.gui.util.MenuFactory" uses a class called 
"org.apache.jorphan.reflect.ClassFinder" to find all available classes of certain 
types.  For 
instance, it finds all visualizers, all samplers, all timers, all config elements, 
etc.  These are 
grouped in their categories.  When you implement one of these, the class must indicate 
which 
group it belongs in.  However, this is mostly for flexibility - usually the group is 
obvious, and 
you do not need to do anything except extend AbstractVisualizer, which takes care of 
this.  
You'll see methods in there like "createPopupMenu()" and "getMenuCategories()".  These 
methods call on the MenuFactory to do what is necessary to make your visualizer play 
nice 
with the menuing system.

Furthermore, visualizers are especially easy because you likely don't need to override 
the 
"createTestElement()" method.  The AbstractVisualizer creates a 
org.apache.jmeter.reporters.ResultCollector, which is the runtime stand-in for the GUI 
component that collects the sample logs and delivers the info to your visualizer via 
the "add()" 
method.

Now, that may not have made much sense, because I don't know if you understand the big 
picture of how JMeter separates GUI code from the engine code, but that is a 
discussion for 
another time.

-Mike

On 8 Dec 2002 at 10:44, James Whitfield wrote:

> Thanks so much for your support Mike, sorry my response wasn't as rapid as
> yours. Been super busy lately. The classes you mentioned I had already my
> eye on. Thanks for ensuring my assumptions. I need look no further. The next
> question is simply, if I copy those classes to a new name say
> com.apache.jmeter.visualizers.NewAssertionVisualizer and change some
> variables that are unique to that class only, will I have a new listener? My
> ignorance comes when integrating objects with JMeter, I don't understand how
> that class becomes apart of the Menu or how it is invoked. For instance, in
> a servlet war file you have the web.xml contained in the WEB-INF directory.
> There you will find how each class is invoked, and each invoked servlet
> extends the HttpServlet class etc. If I get a good understanding of this, I
> wouldn't mind contributing to the documentation of this cool tool. As a
> developer (soon to  be opensource as well), I understand it is very
> difficult to document things you understand so well. Lastly, coding is much
> more fun than explaining:)  Thanks for any help you can provide. Cheers.
> 
> 
> James Whitfield
> 
> 
> ----- Original Message -----
> From: "Mike Stover" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 06, 2002 11:55 AM
> Subject: Re: JMetter Sample Listener creation?
> 
> 
> > org.apache.jmeter.visualizers.gui.AbstractVisualizer is an abstract class
> that you will want to
> > extend.  To create a visualizer, you have to create a GUI element.  A
> simple visualizer to study
> > is com.apache.jmeter.visualizers.AssertionVisualizer.  It does only the
> basics.  If I've
> > misinterpreted your needs, don't hesitate to clarify.
> >
> > -Mike
> >
> > On 6 Dec 2002 at 7:49, james whitfield wrote:
> >
> > > Hey Michael, thank you for your work on the JMetter
> > > project. I find it to be most impressive and a very
> > > useful tool. I am sorry to mail and am sure you are
> > > very busy, but I was wondering if you could point me
> > > in the direction of creating a Sample Listener (Much
> > > like Assertion Results). I've done my best to
> > > understand the Developer documentation, but I'm afraid
> > > at present I remain oblivious. I'm am no Newbie by any
> > > means of the word, but was unable to decipher the
> > > requirements necessary. I'll gladly settle for which
> > > Source files encompess the most simple Listener. As
> > > in, everything that's required, no more no less, much
> > > like the "Hello World" of Sample Listeners. Any help
> > > would be gladly appreciated.
> > >
> > >
> > > James Whitfield
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > > http://mailplus.yahoo.com
> >
> >
> >
> > --
> > Michael Stover
> > [EMAIL PROTECTED]
> > Yahoo IM: mstover_ya
> > ICQ: 152975688
> > AIM: mstover777
> 
> 



--
Michael Stover
[EMAIL PROTECTED]
Yahoo IM: mstover_ya
ICQ: 152975688
AIM: mstover777

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

Reply via email to