Search in sources :

Example 11 with AttributeEvent

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

the class DeleteAttributeCommand method undo.

@Override
public void undo(IEngine iEngine) {
    Attribute old = iEngine.createAttribute(attribute.getId(), attribute.getAttributeType());
    iEngine.setBinaryAttribute(-1, attribute.getId(), properties);
    AttributeEvent event = new AttributeEvent(engine, null, attribute, null, attribute, true);
    engine.attributeCreated(event);
    iEngine.updateAttribute(attribute);
    event = new AttributeEvent(engine, null, attribute, old, attribute, true);
    engine.attributeChanged(event);
}
Also used : Attribute(com.ramussoft.common.Attribute) AttributeEvent(com.ramussoft.common.event.AttributeEvent)

Example 12 with AttributeEvent

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

the class DeleteAttributeCommand method redo.

@Override
public void redo(IEngine iEngine) {
    AttributeEvent event = new AttributeEvent(engine, null, attribute, attribute, null, true);
    engine.beforeAttributeDeleted(event);
    iEngine.deleteAttribute(attribute.getId());
    engine.attributeDeleted(event);
}
Also used : AttributeEvent(com.ramussoft.common.event.AttributeEvent)

Example 13 with AttributeEvent

use of com.ramussoft.common.event.AttributeEvent 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)

Example 14 with AttributeEvent

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

the class CreateAttributeCommand method redo.

@Override
public void redo(IEngine iEngine) {
    Attribute attr = iEngine.createAttribute(attribute.getId(), attribute.getAttributeType());
    AttributeEvent event = new AttributeEvent(engine, null, attr, null, attr, true);
    engine.attributeCreated(event);
}
Also used : Attribute(com.ramussoft.common.Attribute) AttributeEvent(com.ramussoft.common.event.AttributeEvent)

Example 15 with AttributeEvent

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

the class CreateAttributeCommand method undo.

@Override
public void undo(IEngine iEngine) {
    iEngine.deleteAttribute(attribute.getId());
    AttributeEvent event = new AttributeEvent(engine, null, attribute, attribute, null, true);
    engine.attributeDeleted(event);
}
Also used : AttributeEvent(com.ramussoft.common.event.AttributeEvent)

Aggregations

AttributeEvent (com.ramussoft.common.event.AttributeEvent)18 Attribute (com.ramussoft.common.Attribute)11 Element (com.ramussoft.common.Element)8 Qualifier (com.ramussoft.common.Qualifier)7 ElementEvent (com.ramussoft.common.event.ElementEvent)5 ElementAttributeListener (com.ramussoft.common.event.ElementAttributeListener)4 AttributeType (com.ramussoft.common.AttributeType)3 AttributeListener (com.ramussoft.common.event.AttributeListener)3 ElementAdapter (com.ramussoft.common.event.ElementAdapter)3 QualifierEvent (com.ramussoft.common.event.QualifierEvent)3 ArrayList (java.util.ArrayList)3 Engine (com.ramussoft.common.Engine)2 IEngine (com.ramussoft.common.IEngine)2 QualifierAdapter (com.ramussoft.common.event.QualifierAdapter)2 IEngineImpl (com.ramussoft.core.impl.IEngineImpl)2 JDBCTemplate (com.ramussoft.jdbc.JDBCTemplate)2 RowMapper (com.ramussoft.jdbc.RowMapper)2 ResultSet (java.sql.ResultSet)2 SQLException (java.sql.SQLException)2 CalculateInfo (com.ramussoft.common.CalculateInfo)1