Community
Participate
Working Groups
Created attachment 168384 [details] patch checks containsTarget before adding relation Before adding a new relation in Accessible.addRelation, we need to check that the relation is only being added once. This came up because the first thing the UI team did was to add a Relation in response to a UI event, and the same relation was being added over and over. For context, here is the relevant piece of the UI patch: +++ src/org/eclipse/jface/dialogs/TitleAreaDialog.java private void updateMessage(String newMessage) { + Display display = workArea.getDisplay(); + Control focusControl = display.getFocusControl(); + if (focusControl != null) + focusControl.getAccessible().addRelation(ACC.RELATION_DESCRIBED_BY, messageLabel.getAccessible()); messageLabel.setText(newMessage); + if (focusControl != null) + focusControl.getAccessible().sendEvent(ACC.EVENT_DESCRIPTION_CHANGED, null); } The attached patch fixes this by checking first whether the target was already added for the relation type.
Created attachment 168387 [details] this is the correct patch I attached the wrong patch previously. This one has only the fix mentioned.
Created attachment 168396 [details] patch for GTK
Created attachment 168402 [details] patch for cocoa
Car, please review the gtk patch
The gtk patch looks ok - I think you should probably implement hashCode as well, though. Maybe something like: public int hashCode () { return target.hashCode() ^ type; } I need to test on your machine.
Relation is not been added to hash tables right now. I will add hashCode() if I ever add a relation to a set/hash table.
Windows and Mac patch are committed.
Fixed > 20100513