/** * Associates the given element with the given widget. Sets the given item's * data to be the element, and maps the element to the item in the element * map (if enabled). * * @param element * the element * @param item * the widget */ protected void associate(Object element, Item item) { Object data = item.getData(); if (data != element) { if (data != null) { disassociate(item); } item.setData(element); mapElement(element, item); } else { // Always map the element, even if data == element, // since unmapAllElements() can leave the map inconsistent // See bug 2741 for details. mapElement(element, item); } if (associateListener != null) associateListener.associate(element, item); }
/** * Associates the given element with the given widget. Sets the given item's * data to be the element, and maps the element to the item in the element * map (if enabled). * * @param element * the element * @param item * the widget */ protected void associate(Object element, Item item) { Object data = item.getData(); if (data != element) { if (data != null) { disassociate(item); } item.setData(element); mapElement(element, item); } else { // Always map the element, even if data == element, // since unmapAllElements() can leave the map inconsistent // See bug 2741 for details. mapElement(element, item); } if (associateListener != null) associateListener.associate(element, item); }
/** * Associates the given element with the given widget. Sets the given item's * data to be the element, and maps the element to the item in the element * map (if enabled). * * @param element * the element * @param item * the widget */ protected void associate(Object element, Item item) { Object data = item.getData(); if (data != element) { if (data != null) { disassociate(item); } item.setData(element); mapElement(element, item); } else { // Always map the element, even if data == element, // since unmapAllElements() can leave the map inconsistent // See bug 2741 for details. mapElement(element, item); } if (associateListener != null) associateListener.associate(element, item); }