public void setItemSelected(JavaScriptObject aValue) { if (itemSelected != aValue) { if (selectedItemReg != null) { selectedItemReg.removeHandler(); selectedItemReg = null; } itemSelected = aValue; if (component instanceof HasSelectionHandlers<?>) { selectedItemReg = ((HasSelectionHandlers<Object>) component).addSelectionHandler(new SelectionHandler<Object>() { @Override public void onSelection(SelectionEvent<Object> event) { JavaScriptObject published = ((HasPublished) event.getSource()).getPublished(); Object oItem = event.getSelectedItem(); if (oItem instanceof HasPublished) oItem = ((HasPublished) oItem).getPublished(); executeEvent(itemSelected, EventsPublisher.publishItemEvent(published, oItem instanceof JavaScriptObject ? (JavaScriptObject) oItem : null)); } }); } } }
protected void addSelectionHandler(HasSelectionHandlers<PartDefinition> widget) { widget.addSelectionHandler(new SelectionHandler<PartDefinition>() { @Override public void onSelection(final SelectionEvent<PartDefinition> event) { panelManager.onPartLostFocus(); panelManager.onPartFocus(event.getSelectedItem()); } }); }
public HasSelectionHandlers<Integer> getTabPanelSelector() { return tab_panel; }
HasSelectionHandlers<Integer> getTabPanelSelector();