Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 85610 Details for
Bug 171083
AGR Recorder does not distinguish between two controls on the same panel if they have the same text and type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to NonTrivialWidgetResolver.java
patch.txt (text/plain), 2.36 KB, created by
DuWayne Morris
on 2007-12-19 16:55:00 EST
(
hide
)
Description:
Patch to NonTrivialWidgetResolver.java
Filename:
MIME Type:
Creator:
DuWayne Morris
Created:
2007-12-19 16:55:00 EST
Size:
2.36 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.test.auto.gui >Index: src/org/eclipse/tptp/test/auto/gui/internal/resolvers/NonTrivialWidgetResolver.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.auto.gui/src/org/eclipse/tptp/test/auto/gui/internal/resolvers/NonTrivialWidgetResolver.java,v >retrieving revision 1.4 >diff -u -r1.4 NonTrivialWidgetResolver.java >--- src/org/eclipse/tptp/test/auto/gui/internal/resolvers/NonTrivialWidgetResolver.java 2 May 2007 19:35:58 -0000 1.4 >+++ src/org/eclipse/tptp/test/auto/gui/internal/resolvers/NonTrivialWidgetResolver.java 19 Dec 2007 21:49:14 -0000 >@@ -247,25 +247,53 @@ > { > Control[] children = ((Composite)parent).getChildren(); > int buttonInx = 0; >+ // if there are multiple buttons with the same text label >+ int sameTextButtons = 0; >+ String indexWeight = "0.2"; >+ String lengthWeight = "0.3"; > > /* Find the index of the button */ > for (int i = 0; i < children.length; i++) > { >+ if (text != null && children[i] instanceof Button){ >+ String label = ((Button)children[i]).getText(); >+ if (label != null){ >+ label = label.replaceAll("\\&", ""); >+ if (label.compareTo(text) == 0) >+ sameTextButtons++; >+ } >+ } > if (button == children[i]) > { > buttonInx = i; > break; > } > } >+ if (sameTextButtons > 0){ >+ // two or more buttons with the same label in the >+ // same child list under a composite parent >+ // so shift the weighting to favor the button index >+ // to get the right weighting >+ indexWeight = "0.4"; >+ lengthWeight = "0.1"; >+ } > > Object[] properties = > { >+ new Object[] {text, "0.3"}, >+ new Object[] {hoverText, "0.3"}, >+ new Object[] {String.valueOf(children.length), lengthWeight}, >+ new Object[] {size, "0.1"}, >+ new Object[] {location, "0.1"}, >+ new Object[] {String.valueOf(buttonInx), indexWeight}, >+ /* > new Object[] {text, "0.3"}, > new Object[] {hoverText, "0.3"}, > new Object[] {String.valueOf(children.length), "0.3"}, > new Object[] {size, "0.2"}, > new Object[] {location, "0.1"}, > new Object[] {String.valueOf(buttonInx), "0.2"}, >+ */ > }; > > float threshold = 0.7f;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 171083
: 85610