use of org.kie.workbench.common.screens.datamodeller.client.command.AddPropertyCommand in project kie-wb-common by kiegroup.
the class DataObjectBrowser method addNewProperty.
private void addNewProperty(DataObject dataObject, final String propertyName, final String propertyLabel, final String propertyType, final Boolean isMultiple) {
AddPropertyCommand command = commandBuilder.buildAddPropertyCommand(getContext(), DataModelerEvent.DATA_OBJECT_BROWSER, dataObject, propertyName, propertyLabel, propertyType, isMultiple);
command.execute();
ObjectProperty property = command.getProperty();
adjustTableSize(dataProvider.getList().size() + 1);
dataProvider.getList().add(property);
view.setSelectedRow(property, true);
executePostCommandProcessing(command);
}
use of org.kie.workbench.common.screens.datamodeller.client.command.AddPropertyCommand in project kie-wb-common by kiegroup.
the class JPADomainHandler method postCommandProcessing.
@Override
public void postCommandProcessing(DataModelCommand command) {
if (command instanceof FieldTypeChangeCommand && (isPersistable(((FieldTypeChangeCommand) command).getDataObject()) || isRelationConfigured(((FieldTypeChangeCommand) command).getField()))) {
AdjustFieldDefaultRelationsCommand postCommand = commandBuilder.buildAdjustFieldDefaultRelationsCommand((FieldTypeChangeCommand) command, getName(), ((FieldTypeChangeCommand) command).getField());
postCommand.execute();
} else if (command instanceof AddPropertyCommand && isPersistable(((AddPropertyCommand) command).getDataObject())) {
AdjustFieldDefaultRelationsCommand postCommand = commandBuilder.buildAdjustFieldDefaultRelationsCommand((AddPropertyCommand) command, getName(), ((AddPropertyCommand) command).getProperty());
postCommand.execute();
}
}
Aggregations