use of org.eclipse.scout.rt.platform.util.EventListenerList in project scout.rt by eclipse.
the class VirtualDesktop method addPropertyChangeListener.
@Override
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
EventListenerList list = m_propertyChangeListenerMap.get(propertyName);
if (list == null) {
list = new EventListenerList();
m_propertyChangeListenerMap.put(propertyName, list);
}
list.add(PropertyChangeListener.class, listener);
}
use of org.eclipse.scout.rt.platform.util.EventListenerList in project scout.rt by eclipse.
the class VirtualDesktop method addDataChangeListener.
@Override
public void addDataChangeListener(DataChangeListener listener, Object... dataTypes) {
if (dataTypes == null || dataTypes.length == 0) {
EventListenerList list = m_dataChangeListenerMap.get(null);
if (list == null) {
list = new EventListenerList();
m_dataChangeListenerMap.put(null, list);
}
list.add(DataChangeListener.class, listener);
} else {
for (Object dataType : dataTypes) {
if (dataType != null) {
EventListenerList list = m_dataChangeListenerMap.get(dataType);
if (list == null) {
list = new EventListenerList();
m_dataChangeListenerMap.put(dataType, list);
}
list.add(DataChangeListener.class, listener);
}
}
}
}
use of org.eclipse.scout.rt.platform.util.EventListenerList in project scout.rt by eclipse.
the class VirtualDesktop method removeDataChangeListener.
@Override
public void removeDataChangeListener(DataChangeListener listener, Object... dataTypes) {
if (dataTypes == null || dataTypes.length == 0) {
for (Iterator<EventListenerList> it = m_dataChangeListenerMap.values().iterator(); it.hasNext(); ) {
EventListenerList list = it.next();
list.removeAll(DataChangeListener.class, listener);
if (list.getListenerCount(DataChangeListener.class) == 0) {
it.remove();
}
}
} else {
for (Object dataType : dataTypes) {
if (dataType != null) {
EventListenerList list = m_dataChangeListenerMap.get(dataType);
if (list != null) {
list.remove(DataChangeListener.class, listener);
if (list.getListenerCount(DataChangeListener.class) == 0) {
m_dataChangeListenerMap.remove(dataType);
}
}
}
}
}
}
use of org.eclipse.scout.rt.platform.util.EventListenerList in project scout.rt by eclipse.
the class VirtualDesktop method addPropertyChangeListener.
@Override
public void addPropertyChangeListener(PropertyChangeListener listener) {
EventListenerList list = m_propertyChangeListenerMap.get(null);
if (list == null) {
list = new EventListenerList();
m_propertyChangeListenerMap.put(null, list);
}
list.add(PropertyChangeListener.class, listener);
}
use of org.eclipse.scout.rt.platform.util.EventListenerList in project scout.rt by eclipse.
the class AbstractValueField method initConfig.
@Override
protected void initConfig() {
super.initConfig();
m_listeningSlaves = new EventListenerList();
setAutoAddDefaultMenus(getConfiguredAutoAddDefaultMenus());
// menus
List<Class<? extends IMenu>> declaredMenus = getDeclaredMenus();
List<IMenu> contributedMenus = m_contributionHolder.getContributionsByClass(IMenu.class);
OrderedCollection<IMenu> menus = new OrderedCollection<IMenu>();
for (Class<? extends IMenu> menuClazz : declaredMenus) {
menus.addOrdered(ConfigurationUtility.newInnerInstance(this, menuClazz));
}
menus.addAllOrdered(contributedMenus);
try {
injectMenusInternal(menus);
} catch (Exception e) {
LOG.error("error occured while dynamically contributing menus.", e);
}
new MoveActionNodesHandler<IMenu>(menus).moveModelObjects();
// set container on menus
IValueFieldContextMenu contextMenu = createContextMenu(menus);
contextMenu.setContainerInternal(this);
setContextMenu(contextMenu);
setStatusMenuMappings(createStatusMenuMappings());
}
Aggregations