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);
}
}
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);
}
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);
}
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);
}
Aggregations