Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add select text to entity list response #1529

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class EntityListResponse extends MenuBean {
private boolean useUniformUnits;
private int[] sortIndices;
private String noItemsText;
private String selectText;

private int pageCount;
private int currentPage;
Expand Down Expand Up @@ -102,6 +103,7 @@ public EntityListResponse(EntityScreen nextScreen) {
entities = new EntityBean[entityBeans.size()];
entityBeans.toArray(entities);
setNoItemsText(getNoItemsTextLocaleString(detail));
setSelectText(getSelectTextLocaleString(detail));
hasDetails = nextScreen.getLongDetail() != null;

processTitle(session);
Expand Down Expand Up @@ -517,6 +519,24 @@ private String getNoItemsTextLocaleString(Detail detail) {
return noItemsTextString;
}

private void setSelectText(String selectText) {
this.selectText = selectText;
}

public String getSelectText() {
return selectText;
}

private String getSelectTextLocaleString(Detail detail) {
String selectTextString;
try {
selectTextString = detail.getSelectText().evaluate();
} catch (NoLocalizedTextException | NullPointerException e) {
return null;
}
return selectTextString;
}

public QueryResponseBean getQueryResponse() {
return queryResponse;
}
Expand Down