Search in sources :

Example 6 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 7 with DataModelCommand

use of org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand in project kie-wb-common by kiegroup.

the class MainDataObjectEditor method onLabelChange.

@Override
public void onLabelChange() {
    if (getDataObject() != null) {
        String value = DataModelerUtils.nullTrim(view.getLabel());
        DataModelCommand command = commandBuilder.buildDataObjectAnnotationValueChangeCommand(getContext(), getName(), getDataObject(), MainDomainAnnotations.LABEL_ANNOTATION, "value", value, true);
        command.execute();
    }
}
Also used : DataModelCommand(org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand)

Example 8 with DataModelCommand

use of org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand in project kie-wb-common by kiegroup.

the class MainDataObjectFieldEditor method doTypeChange.

private void doTypeChange(String newType, boolean isMultiple) {
    if (getObjectField() != null) {
        boolean multiple = isMultiple;
        if (getContext().getHelper().isPrimitiveType(newType)) {
            view.setMultipleTypeEnabled(false);
            view.setMultipleType(false);
            multiple = false;
        } else {
            view.setMultipleTypeEnabled(true);
        }
        DataModelCommand command = commandBuilder.buildChangeTypeCommand(getContext(), getName(), getDataObject(), getObjectField(), newType, multiple);
        command.execute();
        executePostCommandProcessing(command);
    }
}
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