Search in sources :

Example 1 with AttributeListener

use of com.ramussoft.common.event.AttributeListener in project ramus by Vitaliy-Yakovchuk.

the class UpdateAttributeCommand method redo.

@Override
public void redo(IEngine iEngine) {
    iEngine.updateAttribute(newAttribute);
    AttributeEvent event = new AttributeEvent(engine, null, newAttribute, oldAttribute, newAttribute, true);
    for (AttributeListener l : engine.getAttributeListeners()) {
        l.attributeUpdated(event);
    }
}
Also used : AttributeListener(com.ramussoft.common.event.AttributeListener) AttributeEvent(com.ramussoft.common.event.AttributeEvent)

Example 2 with AttributeListener

use of com.ramussoft.common.event.AttributeListener in project ramus by Vitaliy-Yakovchuk.

the class JournaledEngine method updateAttribute.

@Override
public void updateAttribute(Attribute attribute) {
    Attribute old = getAttribute(attribute.getId());
    deligate.updateAttribute(attribute);
    synchronized (swithJournalLock) {
        journal.store(new UpdateAttributeCommand(this, old, attribute));
    }
    AttributeEvent event = new AttributeEvent(this, null, attribute, old, attribute);
    for (AttributeListener listener : attributeListeners) {
        listener.attributeUpdated(event);
    }
}
Also used : Attribute(com.ramussoft.common.Attribute) AttributeListener(com.ramussoft.common.event.AttributeListener) AttributeEvent(com.ramussoft.common.event.AttributeEvent) UpdateAttributeCommand(com.ramussoft.common.journal.command.UpdateAttributeCommand)

Example 3 with AttributeListener

use of com.ramussoft.common.event.AttributeListener in project ramus by Vitaliy-Yakovchuk.

the class UpdateAttributeCommand method undo.

@Override
public void undo(IEngine iEngine) {
    iEngine.updateAttribute(oldAttribute);
    AttributeEvent event = new AttributeEvent(engine, null, oldAttribute, newAttribute, oldAttribute, true);
    for (AttributeListener l : engine.getAttributeListeners()) {
        l.attributeUpdated(event);
    }
}
Also used : AttributeListener(com.ramussoft.common.event.AttributeListener) AttributeEvent(com.ramussoft.common.event.AttributeEvent)

Aggregations

AttributeEvent (com.ramussoft.common.event.AttributeEvent)3 AttributeListener (com.ramussoft.common.event.AttributeListener)3 Attribute (com.ramussoft.common.Attribute)1 UpdateAttributeCommand (com.ramussoft.common.journal.command.UpdateAttributeCommand)1