The earlier implementation just flattens the entire UI hierarchy finds
a widget of a particular type, and starts walking backwards to find a
label. Which does not seem to be the right thing to do, but works in
most cases.

The new implementation does this:

protected boolean doMatch(Object obj) {
        Widget previousWidget = SWTUtils.previousWidget((Widget) obj);
        if ((previousWidget instanceof Label) &&
mnemonicTextMatcher.matches(previousWidget))
                return true;
        return false;
}

Which means that it finds the _immediate previous sibling_ and matches
it for the specified label. Which seems to be the right thing to do,
but does not work in most cases.

Any suggestions to find a middle ground ? I'm thinking along the lines
of making this search fuzzy, which means flatten the hierarchy, but
don't walk backwards all the way to the shell, but stop after say 5
widgets.

-- Ketan

On Thu, Nov 6, 2008 at 9:29 PM, Hans Schwaebli <[EMAIL PROTECTED]> wrote:
> I could not find a widget by label today. Previously it found the widget by
> label. But the development team changed the implementation from
>
>     final Label functionalGroupLabel = new Label(selectTeardownGroup,
> SWT.NONE);
>
> to:
>
>     final Composite funGpCom = new Composite(selectTeardownGroup, SWT.NONE);
>     funGpCom.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false,
> false));
>     funGpCom.setLayout(new GridLayout());
>     final Label functionalGroupLabel = new Label(funGpCom, SWT.NONE);
>
> Could it be that this is the reason why SWTBot sometimes does not find
> widgets by label?
>
> The other labels where I cannot find the widget for it are similiar
> implemented.
>
> Does this give you a clue and if yes, can you please fix it?
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> SWTBot-users mailing list
> SWTBot-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/swtbot-users
> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
>
>
>



-- 
Ketan Padegaonkar
I blog... therefore I am... http://ketan.padegaonkar.name
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
SWTBot-users mailing list
SWTBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

Reply via email to