This commit is contained in:
r-ca 2024-01-29 01:02:43 +09:00
parent fa4f074871
commit a13f6e28ec
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -141,8 +141,13 @@ public class LacertaApplyTagDialog extends DialogFragment {
private CompletableFuture<ArrayList<DocumentTagApplyTagDialogExtendedModel>> getDocumentTagArrayList(String documentId) { private CompletableFuture<ArrayList<DocumentTagApplyTagDialogExtendedModel>> getDocumentTagArrayList(String documentId) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
ArrayList<DocumentTagApplyTagDialogExtendedModel> documentTagArrayList = new ArrayList<>(); ArrayList<DocumentTagApplyTagDialogExtendedModel> documentTagArrayList = new ArrayList<>();
setRegisteredTagList().thenAccept(Void -> {
setRegisteredTagList().join();
setAppliedTagList(documentId).join(); setAppliedTagList(documentId).join();
logger.debug("getDocumentTagArrayList", "this.registeredTags.size(): " + this.registeredTags.size());
logger.debug("getDocumentTagArrayList", "this.appliedTags.size(): " + this.appliedTags.size());
for (int i = 0; i < this.registeredTags.size(); i++) { for (int i = 0; i < this.registeredTags.size(); i++) {
boolean isChecked = false; boolean isChecked = false;
for (int j = 0; j < this.appliedTags.size(); j++) { for (int j = 0; j < this.appliedTags.size(); j++) {
@ -154,26 +159,26 @@ public class LacertaApplyTagDialog extends DialogFragment {
documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel( documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel(
new DocumentTag(this.registeredTags.get(i).getId(), this.registeredTags.get(i).getName(), this.registeredTags.get(i).getColor()), isChecked)); new DocumentTag(this.registeredTags.get(i).getId(), this.registeredTags.get(i).getName(), this.registeredTags.get(i).getColor()), isChecked));
} }
});
return documentTagArrayList; return documentTagArrayList;
}); });
} }
private CompletableFuture<Void> setAppliedTagList(String documentId) { private CompletableFuture<ArrayList<DocumentTag>> setAppliedTagList(String documentId) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> { lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> {
this.appliedTags = documentTags; this.appliedTags = documentTags;
}); });
return null; return this.appliedTags;
}); });
} }
private CompletableFuture<Void> setRegisteredTagList() { private CompletableFuture<ArrayList<DocumentTag>> setRegisteredTagList() {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
lacertaLibrary.getTagList().thenAccept(documentTags -> { lacertaLibrary.getTagList().thenAccept(documentTags -> {
this.registeredTags = documentTags; this.registeredTags = documentTags;
}); });
return null; return this.registeredTags;
}); });
} }