Mailing list - Entries of 2006


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] Tabs in JTabbedPane with ItemNameResolver


  • Subject: Re: [qftestJUI] Tabs in JTabbedPane with ItemNameResolver
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 10 Jan 2006 19:35:11 +0100

Hi Bostjan,

I don't fully undestand your question. 

When you register an ItemNameResolver for a JTabbedPane, you are
telling qftestJUI that your resolver is able to tell qftestJUI the
preferred name of a tab, given the JTabbedPane and the index of the
tab.

Table 23.1 in chapter 3 of the manual lists the source, primary and
secondary parameters for JTabbedPane to be the pane itself, the index
of the tab and null (Python None), so that is all as expected and you
should have all the required info.

That qftestJUI calls the resolver multiple times for various tabs
shouldn't bother you. It doesn't cache results (which might change
over time) and has to look for thing's like uniqueness of the name,
etc.

If that doesn't help, please rephrase your question :-)

Best regards,
    Greg


"Bo¡tjan Praznik" <bostjan.boco@?.si> writes:

> Hi,
> 
> I am new with the qftest and I am trying to recognize single tabs in JTabbedPane
> using the ItemNameResolver (see the code bellow). My tabbed pane has three tabs.
> I have recorded clicks on each tab before registering the resolver.
> 
> After the components (tabs) were recorded I registered my resolver. Now I would
> like to get (with resolver) the title or index of the tab which is being
> recognized. The source parameter in the getItemName method doesn't give the info
> about the tab but the whole JTabbedPane (or am I wrong?).
> 
> When item (tab) is being recognized I can see that the getItemName method is
> being called as many times as needed to get to the right tab (e.g. if click on
> second tab than primary is first 0 and then 1 which is correct) but it loops
> twice. Bellow you can find the code and output for the described example.
> 
> Thank you in advance,
> Bostjan
> 
> ---------------------------------------------
> 
> My resolver:
> 
> class ItemResolver(ItemNameResolver):
>   def getItemName(self, source, primary, secondary):
>     print "source =", source
>     print "primary =", primary
>     print "secondary =", secondary
>     try:
>       #I don't know yet what to return so return None
>       return None
>     except:
>       # Error handling: print a Jython stacktrace
>       import traceback
>       traceback.print_exc()
> 
> Output:
> source =
> JTabbedPane[,0,133,376x197,layout=javax.swing.plaf.metal.MetalTabbedPaneUI$TabbedPaneLayout,alignmentX=null,alignmentY=null,border=,flags=352,maximumSize=,minimumSize=,preferredSize=,haveRegistered=false,tabPlacement=TOP]
> primary = 0
> secondary = None
> 
> source =
> JTabbedPane[,0,133,376x197,layout=javax.swing.plaf.metal.MetalTabbedPaneUI$TabbedPaneLayout,alignmentX=null,alignmentY=null,border=,flags=352,maximumSize=,minimumSize=,preferredSize=,haveRegistered=false,tabPlacement=TOP]
> primary = 1
> secondary = None
> 
> source =
> JTabbedPane[,0,133,376x197,layout=javax.swing.plaf.metal.MetalTabbedPaneUI$TabbedPaneLayout,alignmentX=null,alignmentY=null,border=,flags=352,maximumSize=,minimumSize=,preferredSize=,haveRegistered=false,tabPlacement=TOP]
> primary = 0
> secondary = None
> 
> source =
> JTabbedPane[,0,133,376x197,layout=javax.swing.plaf.metal.MetalTabbedPaneUI$TabbedPaneLayout,alignmentX=null,alignmentY=null,border=,flags=352,maximumSize=,minimumSize=,preferredSize=,haveRegistered=false,tabPlacement=TOP]
> primary = 1
> secondary = None
> 
> ____________________
> http://www.email.si/
> 
> 
> _______________________________________________
> qftestJUI-list mailing list
> qftestJUI-list@?.de
> http://www.qfs.de/mailman/listinfo/qftestjui-list

-- 
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876



Videos Downloads Documentation Buy Free Trial