use of org.kie.workbench.common.dmn.client.editors.types.common.DataType in project kie-wb-common by kiegroup.
the class DataTypeList method makeTreeListItems.
List<DataTypeListItem> makeTreeListItems(final DataType dataType, final int level) {
final DataTypeListItem listItem = makeListItem();
final List<DataType> subDataTypes = dataType.getSubDataTypes();
final List<DataTypeListItem> gridItems = new ArrayList<>();
listItem.setupDataType(dataType, level);
gridItems.add(listItem);
for (final DataType subDataType : subDataTypes) {
gridItems.addAll(makeTreeListItems(subDataType, level + 1));
}
return gridItems;
}
use of org.kie.workbench.common.dmn.client.editors.types.common.DataType in project kie-wb-common by kiegroup.
the class DataTypeList method importDataObjects.
public void importDataObjects(final List<DataObject> selectedDataObjects) {
removeFullQualifiedNames(selectedDataObjects);
for (final DataObject dataObject : selectedDataObjects) {
final DataType newDataType = createNewDataType(dataObject);
final Optional<DataType> existing = findDataTypeByName(dataObject.getClassType());
if (existing.isPresent()) {
replace(existing.get(), newDataType);
} else {
insert(newDataType);
}
insertProperties(dataObject);
}
}
use of org.kie.workbench.common.dmn.client.editors.types.common.DataType in project kie-wb-common by kiegroup.
the class DataTypeList method refreshItemsByUpdatedDataTypes.
void refreshItemsByUpdatedDataTypes(final List<DataType> updateDataTypes) {
for (final DataType dataType : updateDataTypes) {
findItem(dataType).ifPresent(listItem -> {
listItem.refresh();
refreshSubItemsFromListItem(listItem, dataType.getSubDataTypes());
});
}
refreshDragAndDropList();
refreshSearchBar();
}
use of org.kie.workbench.common.dmn.client.editors.types.common.DataType in project kie-wb-common by kiegroup.
the class DataTypeListItem method insertFieldBelow.
public void insertFieldBelow() {
closeEditMode();
final DataType newDataType = newDataType();
final String referenceDataTypeHash = insertFieldBelow(newDataType);
enableEditModeAndUpdateCallbacks(getNewDataTypeHash(newDataType, referenceDataTypeHash));
}
use of org.kie.workbench.common.dmn.client.editors.types.common.DataType in project kie-wb-common by kiegroup.
the class DataTypeListItem method insertFieldAbove.
public void insertFieldAbove() {
closeEditMode();
final DataType newDataType = newDataType();
final String referenceDataTypeHash = insertFieldAbove(newDataType);
enableEditModeAndUpdateCallbacks(getNewDataTypeHash(newDataType, referenceDataTypeHash));
}
Aggregations