Search in sources :

Example 6 with DataObjectChangeEvent

use of org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent in project kie-wb-common by kiegroup.

the class AddMethodCommand method execute.

@Override
public void execute() {
    if (method != null) {
        dataObject.addMethod(method);
        DataModelerEvent event = new DataObjectChangeEvent().withChangeType(ChangeType.METHOD_ADD_CHANGE).withOldValue(null).withNewValue(method).withContextId(getContext().getContextId()).withSource(getSource()).withCurrentDataObject(getDataObject()).withCurrentMethod(method);
        notifyChange(event);
    }
}
Also used : DataModelerEvent(org.kie.workbench.common.screens.datamodeller.events.DataModelerEvent) DataObjectChangeEvent(org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent)

Example 7 with DataObjectChangeEvent

use of org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent in project kie-wb-common by kiegroup.

the class DataObjectNameChangeCommand method execute.

@Override
public void execute() {
    String oldName = dataObject.getName();
    getDataObject().setName(newName);
    DataObjectChangeEvent event = new DataObjectChangeEvent(ChangeType.OBJECT_NAME_CHANGE, getContext().getContextId(), getSource(), getDataObject(), null, oldName, newName);
    notifyChange(event);
}
Also used : DataObjectChangeEvent(org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent)

Example 8 with DataObjectChangeEvent

use of org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent in project kie-wb-common by kiegroup.

the class DataObjectPackageChangeCommand method execute.

@Override
public void execute() {
    String oldPackage = dataObject.getPackageName();
    getDataObject().setPackageName(newPackage);
    DataObjectChangeEvent event = new DataObjectChangeEvent(ChangeType.PACKAGE_NAME_CHANGE, getContext().getContextId(), getSource(), getDataObject(), null, oldPackage, newPackage);
    notifyChange(event);
}
Also used : DataObjectChangeEvent(org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent)

Example 9 with DataObjectChangeEvent

use of org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent in project kie-wb-common by kiegroup.

the class DataObjectSuperClassChangeCommand method execute.

@Override
public void execute() {
    String oldSuperClass = dataObject.getSuperClassName();
    getDataObject().setSuperClassName(newSuperClass);
    // Remove former extension refs if superclass has changed
    if (oldSuperClass != null && !"".equals(oldSuperClass)) {
        getContext().getHelper().dataObjectExtended(oldSuperClass, getDataObject().getClassName(), false);
    }
    getContext().getHelper().dataObjectExtended(newSuperClass, getDataObject().getClassName(), true);
    DataObjectChangeEvent event = new DataObjectChangeEvent(ChangeType.SUPER_CLASS_NAME_CHANGE, getContext().getContextId(), getSource(), getDataObject(), null, oldSuperClass, newSuperClass);
    notifyChange(event);
}
Also used : DataObjectChangeEvent(org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent)

Aggregations

DataObjectChangeEvent (org.kie.workbench.common.screens.datamodeller.events.DataObjectChangeEvent)9 DataModelerEvent (org.kie.workbench.common.screens.datamodeller.events.DataModelerEvent)5 Annotation (org.kie.workbench.common.services.datamodeller.core.Annotation)1 AnnotationImpl (org.kie.workbench.common.services.datamodeller.core.impl.AnnotationImpl)1