use of com.ramussoft.common.event.QualifierListener in project ramus by Vitaliy-Yakovchuk.
the class OtherElementPlugin method setFramework.
@Override
public void setFramework(GUIFramework framework) {
super.setFramework(framework);
final QualifierListener listener = new QualifierAdapter() {
@Override
public void qualifierDeleted(QualifierEvent event) {
RowSetValue value = sets.get(event.getOldQualifier());
if (value != null) {
value.rowSet.close();
sets.remove(event.getOldQualifier());
}
}
};
framework.getEngine().addQualifierListener(listener);
framework.addCloseMainFrameListener(new CloseMainFrameAdapter() {
@Override
public void closed() {
for (RowSetValue value : sets.values()) {
try {
value.rowSet.close();
} catch (Exception e) {
e.printStackTrace();
}
}
sets.clear();
OtherElementPlugin.this.framework.getEngine().removeQualifierListener(listener);
}
});
}
Aggregations