use of edu.stanford.bmir.protege.web.shared.collection.CreateCollectionItemsAction in project webprotege by protegeproject.
the class CollectionPresenter method handleAddCollectionItems.
private void handleAddCollectionItems() {
current.ifPresent(subject -> {
addItemPromptProvider.get().showPrompt(itemNamesString -> {
// Create Empty Data for the fresh item
List<String> itemNames = Arrays.stream(itemNamesString.split("\n")).map(String::trim).collect(Collectors.toList());
if (itemNames.isEmpty()) {
return;
}
CollectionItem freshItem = CollectionItem.get(itemNames.get(0));
dispatchServiceManager.execute(new CreateCollectionItemsAction(subject.getProjectId(), subject.getCollectionId(), itemNames), result -> {
placeController.goTo(new CollectionViewPlace(subject.getProjectId(), subject.getCollectionId(), subject.getFormId(), Optional.of(freshItem)));
listPresenter.refresh(() -> {
});
});
});
});
}
Aggregations