List of usage examples for com.vaadin.ui AbstractComponent getListeners
public Collection<?> getListeners(Class<?> eventType)
From source file:com.jain.addon.I18N.listners.JAttachDetachListner.java
License:Apache License
/** * Add this listener to a component// w w w. j a v a2 s. co m * @param parent * @param component */ public static void addListenerToComponent(AbstractComponent parent, Component component) { Collection<?> collection = parent.getListeners(ComponentAttachEvent.class); for (Object object : collection) { if (object instanceof JAttachDetachListner) ((JAttachDetachListner) object).initializeNAddRemoveListner(component, false); } System.out.println(collection); }
From source file:com.jain.addon.I18N.listners.JAttachDetachListner.java
License:Apache License
/** * Remove this listener from component/* w ww. j a v a 2 s . c o m*/ * @param parent * @param component */ public static void removeListenerFromComponent(AbstractComponent parent, Component component) { Collection<?> collection = parent.getListeners(ComponentAttachEvent.class); for (Object object : collection) { if (object instanceof JAttachDetachListner) ((JAttachDetachListner) object).initializeNAddRemoveListner(component, true); } System.out.println(collection); }