use of org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand in project kie-wb-common by kiegroup.
the class MainDataObjectEditor method onDescriptionChange.
@Override
public void onDescriptionChange() {
if (getDataObject() != null) {
String value = DataModelerUtils.nullTrim(view.getDescription());
DataModelCommand command = commandBuilder.buildDataObjectAnnotationValueChangeCommand(getContext(), getName(), getDataObject(), MainDomainAnnotations.DESCRIPTION_ANNOTATION, "value", value, true);
command.execute();
}
}
use of org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand in project kie-wb-common by kiegroup.
the class MainDataObjectFieldEditor method onDescriptionChange.
@Override
public void onDescriptionChange() {
if (getObjectField() != null) {
String value = DataModelerUtils.nullTrim(view.getDescription());
DataModelCommand command = commandBuilder.buildFieldAnnotationValueChangeCommand(getContext(), getName(), getDataObject(), getObjectField(), MainDomainAnnotations.DESCRIPTION_ANNOTATION, MainDomainAnnotations.VALUE_PARAM, value, true);
command.execute();
}
}
use of org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand in project kie-wb-common by kiegroup.
the class MainDataObjectFieldEditor method onLabelChange.
@Override
public void onLabelChange() {
if (getObjectField() != null) {
String value = DataModelerUtils.nullTrim(view.getLabel());
DataModelCommand command = commandBuilder.buildFieldAnnotationValueChangeCommand(getContext(), getName(), getDataObject(), getObjectField(), MainDomainAnnotations.LABEL_ANNOTATION, MainDomainAnnotations.VALUE_PARAM, value, true);
command.execute();
}
}
use of org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand in project kie-wb-common by kiegroup.
the class JPADataObjectEditor method onTableNameChange.
@Override
public void onTableNameChange(String newValue) {
if (getDataObject() != null) {
String value = DataModelerUtils.nullTrim(newValue);
DataModelCommand command = commandBuilder.buildDataObjectAnnotationValueChangeCommand(getContext(), getName(), getDataObject(), JPADomainAnnotations.JAVAX_PERSISTENCE_TABLE_ANNOTATION, "name", value, true);
command.execute();
}
}
use of org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand in project kie-wb-common by kiegroup.
the class JPADataObjectEditor method doEntityFieldChange.
// convenient method for facilitating testing
protected void doEntityFieldChange(boolean isPersistable, boolean generateIdenfitier) {
final DataModelCommand command = commandBuilder.buildDataObjectAddOrRemoveAnnotationCommand(getContext(), getName(), getDataObject(), JPADomainAnnotations.JAVAX_PERSISTENCE_ENTITY_ANNOTATION, isPersistable);
if (generateIdenfitier) {
addByDefaultId(dataObject);
}
command.execute();
}
Aggregations