public EventListener[] removeDetailTableListener(Class type)
{
KDTable detail = getDetailTable();
if (detail != null)
{
EventListenerList eventList = detail.getListenerList();
EventListener[] lists = eventList.getListeners(type);
if (lists != null)
{
for (int i = 0; i < lists.length; i++)
{
eventList.remove(type, lists[i]);
}
return lists;
}
}
return new EventListener[0];
}
public void restoreDetailTableListener(Class type, EventListener[] lists)
{
if ((lists == null) || (lists.length == 0))
{
return;
}
KDTable detail = getDetailTable();
if (detail != null)
{
EventListenerList eventList = detail.getListenerList();
for (int i = 0; i < lists.length; i++)
{
eventList.add(type, lists[i]);
}
}
}
private void innerLoadFields()
{
EventListener[] lsts = removeDetailTableListener(KDTPropertyChangeListener.class);
loadFields();
restoreDetailTableListener(KDTPropertyChangeListener.class, lsts);
}
禁用和启用监听
最新推荐文章于 2022-08-29 16:24:37 发布