use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.
the class ItemDefinitionCreateHandler method appendItemDefinition.
public ItemDefinition appendItemDefinition() {
final ItemDefinition itemDefinition = new ItemDefinition();
itemDefinitions().add(itemDefinition);
return itemDefinition;
}
use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.
the class DataTypeUpdateHandler method refreshSubDataType.
void refreshSubDataType(final DataType dataType, final String newType) {
final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID());
dataTypeManager.from(dataType).withType(newType);
recordEngine.doUpdate(dataType, itemDefinition);
}
use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.
the class ItemDefinitionDestroyHandler method destroy.
public void destroy(final DataType dataType, final boolean notifyPropertiesPanel) {
final ItemDefinition itemDefinition = findItemDefinition(dataType);
final String destroyedItemDefinition = itemDefinition.getName().getValue();
final Optional<ItemDefinition> itemDefinitionParent = findItemDefinitionParent(dataType);
itemDefinitionParent.ifPresent(parent -> {
parent.getItemComponent().remove(itemDefinition);
});
itemDefinitions().remove(itemDefinition);
itemDefinitionStore.unIndex(dataType.getUUID());
if (notifyPropertiesPanel) {
notifyPropertiesPanel(destroyedItemDefinition);
}
}
use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.
the class DNDDataTypesHandler method cloneDataType.
DataType cloneDataType(final DataType current) {
final String currentUUID = current.getUUID();
final ItemDefinition itemDefinition = itemDefinitionStore.get(currentUUID);
return dataTypeManager.from(itemDefinition).get();
}
use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.
the class ItemDefinitionHandlerTest method makeItemDefinition.
private ItemDefinition makeItemDefinition(final String name, final String type, final boolean isImported) {
final ItemDefinition itemDefinition = new ItemDefinition();
itemDefinition.setName(new Name(name));
itemDefinition.setTypeRef(type == null ? null : new QName(NULL_NS_URI, type, DEFAULT_NS_PREFIX));
itemDefinition.setAllowOnlyVisualChange(isImported);
return itemDefinition;
}
Aggregations