This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 26175 - For now there is no possibility to uniquely identify JFrame, NbFrame, TopComponent
Summary: For now there is no possibility to uniquely identify JFrame, NbFrame, TopComp...
Status: RESOLVED INVALID
Alias: None
Product: qa
Classification: Unclassified
Component: Jellytools (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@qa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-01 11:10 UTC by David Kaspar
Modified: 2002-08-05 11:12 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kaspar 2002-08-01 11:10:08 UTC
When I use only constructors of JFrameOperator,
NBFrameOperator, and TopComponentOperator, there
is not any posibility to search component for
exact name and/or use may ComponentChooser

So, please, add at least constructors with
ComponentOperator as argument.

This problem forbid me to find "Versioning" frame.
because sometimes there could be 2 frames with
"Versioning" substring in its caption.
Comment 1 Alexandre Iline 2002-08-01 22:38:16 UTC
This issue supposed to be failed against jellytools module, since 
there is nothing could be done in Jemmy about it.

Comment 2 Alexandre Iline 2002-08-02 03:05:34 UTC
I understand that you need constructors with ComponentChooser as a 
parameter to be able to find JFrame, NbFrame or TopComponent by 
some criteria such as full title, right? It's already implemented 
in Jemmy (i.e. for JFrame), it sounds reasonable to make the same 
for Jelly.

What I do not understand is why do you need constructors with 
ComponentOperator as an argument. What this argument means?


Comment 3 Jiri Skrivanek 2002-08-05 09:53:38 UTC
There IS a possibility to use exact matching criteria while searching
a component:

	Operator.DefaultStringComparator comparator = new
Operator.DefaultStringComparator(true, true);
        Operator.StringComparator oldComparator =
Operator.getDefaultStringComparator();
        Operator.setDefaultStringComparator(comparator);
        NbFrameOperator frameOper = new NbFrameOperator(title);
        Operator.setDefaultStringComparator(oldComparator);

You can also use ComponentChooser in operators static methods, e.g.:

   JFrameOperator.waitJFrame(myChooser);

Do above constructions solve all your problems? I think so, that's why
I set this issues as invalid.
Comment 4 Jiri Skrivanek 2002-08-05 11:12:02 UTC
In case you need to subclass NbFrameOperator and you need exact match
in constructor, comparator has to be set in static method:

public class Test1 extends NbFrameOperator {
    
    public Test1() {
        super(getTitleToFind());
        // restore default comparator
        setDefaultStringComparator(oldComparator);
    }
    
    private static StringComparator oldComparator;
    private static final String title = "Versioning";
    
    private static String getTitleToFind() {
        oldComparator = getDefaultStringComparator();
        DefaultStringComparator comparator = new
DefaultStringComparator(true, true);
        setDefaultStringComparator(comparator);
        return title;
    }
    
}

Does anyone know better solution?