List of usage examples for com.google.gwt.user.client.ui Label fireEvent
void fireEvent(GwtEvent<?> event);
From source file:com.qualogy.qafe.gwt.client.component.QTree.java
License:Apache License
private void fireItemClickEvent(final SelectionEvent<TreeItem> event) { // When a qaml is listening to a tree with its id, and when clicks on parent tree , as the parent tree is also an item // we dont have to do implicit click handling of item. otherwise 2 times the event will be executed. if (isRootItem(event.getSelectedItem())) { return;// w w w . ja va 2 s . co m } if (rootItem instanceof QTreeItem) { final Label rootItemlabel = ((QTreeItem) rootItem).getLabel(); ClickEvent clickEvent = new ClickEvent() { // This is to make sure that we are making the item id and value available as src-id and src-value @Override public Object getSource() { if (event.getSelectedItem() instanceof QTreeItem) { return ((QTreeItem) event.getSelectedItem()).getLabel(); } return rootItemlabel; } }; rootItemlabel.fireEvent(clickEvent); } }