I came across this situation and found that event.getSource () provides an instance of the source object, not its name. I had to drop it and get its name to identify the original object. In my case, I use MaterialImage and set its title to UiBinder.
Example: UiBinder Code
<m:MaterialImage url="images/icons/simpleLine.svg" ui:field="simpleLine" title="simpleLine" /> <m:MaterialImage url="images/icons/smallDashBigGap.svg"ui:field="smallDashBigGap" title="smallDashBigGap" />
In java
Object object = event.getSource(); if (object instanceof MaterialImage) { MaterialImage image = (MaterialImage) object; String type = image.getTitle(); if (type.equals("simpleLine")) { ... }
I want a better way, but all that I could work with.
source share