use of com.ramussoft.common.event.QualifierEvent 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);
}
});
}
use of com.ramussoft.common.event.QualifierEvent in project ramus by Vitaliy-Yakovchuk.
the class JournaledEngine method registerCreation.
private Qualifier registerCreation(Qualifier qualifier) {
synchronized (swithJournalLock) {
journal.store(new CreateQualifierCommand(this, qualifier));
}
QualifierEvent event = new QualifierEvent(this, null, qualifier);
qualifierCreated(event);
return qualifier;
}
use of com.ramussoft.common.event.QualifierEvent in project ramus by Vitaliy-Yakovchuk.
the class UpdateQualifierCommand method undo.
@Override
public void undo(IEngine iEngine) {
iEngine.updateQualifier(oldQualifier);
QualifierEvent event = new QualifierEvent(engine, newQualifier, oldQualifier, true);
for (Attribute attribute : deletedAttributes) {
for (Entry<Long, Transaction> entry : hashtable.get(attribute.getId()).entrySet()) {
iEngine.setBinaryAttribute(entry.getKey(), attribute.getId(), entry.getValue());
Element element = iEngine.getElement(entry.getKey());
AttributeEvent event2 = new AttributeEvent(engine, element, attribute, null, engine.getAttribute(element, attribute), true);
engine.attributeChanged(event2);
}
}
if (oldQualifier.getAttributeForName() != newQualifier.getAttributeForName())
getEngine().updateElementNames(newQualifier, oldQualifier);
engine.qualifierUpdated(event);
}
use of com.ramussoft.common.event.QualifierEvent in project ramus by Vitaliy-Yakovchuk.
the class DeleteQualifierCommand method undo.
@Override
public void undo(IEngine iEngine) {
Qualifier old;
if (system)
old = iEngine.createSystemQualifier(qualifier.getId());
else
old = iEngine.createQualifier(qualifier.getId());
QualifierEvent event = new QualifierEvent(engine, null, old, true);
engine.qualifierCreated(event);
iEngine.updateQualifier(qualifier);
event = new QualifierEvent(engine, old, qualifier, true);
engine.qualifierUpdated(event);
}
use of com.ramussoft.common.event.QualifierEvent in project ramus by Vitaliy-Yakovchuk.
the class DeleteQualifierCommand method redo.
@Override
public void redo(IEngine iEngine) {
iEngine.deleteQualifier(qualifier.getId());
QualifierEvent event = new QualifierEvent(engine, qualifier, null, true);
engine.qualifierDeleted(event);
}
Aggregations