Search in sources :

Example 1 with DataModelCommand

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();
    }
}
Also used : DataModelCommand(org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand)

Example 2 with DataModelCommand

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();
    }
}
Also used : DataModelCommand(org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand)

Example 3 with DataModelCommand

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();
    }
}
Also used : DataModelCommand(org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand)

Example 4 with DataModelCommand

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();
    }
}
Also used : DataModelCommand(org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand)

Example 5 with DataModelCommand

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();
}
Also used : DataModelCommand(org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand)

Aggregations

DataModelCommand (org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand)8 ArrayList (java.util.ArrayList)1 ValuePair (org.kie.workbench.common.screens.datamodeller.client.command.ValuePair)1