mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2025-01-18 18:33:16 +00:00
WIP
This commit is contained in:
parent
fa4f074871
commit
a13f6e28ec
|
@ -141,39 +141,44 @@ 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 -> {
|
|
||||||
setAppliedTagList(documentId).join();
|
setRegisteredTagList().join();
|
||||||
for (int i = 0; i < this.registeredTags.size(); i++) {
|
setAppliedTagList(documentId).join();
|
||||||
boolean isChecked = false;
|
|
||||||
for (int j = 0; j < this.appliedTags.size(); j++) {
|
logger.debug("getDocumentTagArrayList", "this.registeredTags.size(): " + this.registeredTags.size());
|
||||||
if (this.registeredTags.get(i).getId().equals(this.appliedTags.get(j).getId())) {
|
logger.debug("getDocumentTagArrayList", "this.appliedTags.size(): " + this.appliedTags.size());
|
||||||
isChecked = true;
|
|
||||||
break;
|
for (int i = 0; i < this.registeredTags.size(); i++) {
|
||||||
}
|
boolean isChecked = false;
|
||||||
|
for (int j = 0; j < this.appliedTags.size(); j++) {
|
||||||
|
if (this.registeredTags.get(i).getId().equals(this.appliedTags.get(j).getId())) {
|
||||||
|
isChecked = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel(
|
|
||||||
new DocumentTag(this.registeredTags.get(i).getId(), this.registeredTags.get(i).getName(), this.registeredTags.get(i).getColor()), isChecked));
|
|
||||||
}
|
}
|
||||||
});
|
documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel(
|
||||||
|
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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user