Skip to content

Commit

Permalink
Merge branch 'master' into jt/clear-on-search
Browse files Browse the repository at this point in the history
  • Loading branch information
Jtang-1 committed Jan 22, 2024
2 parents 850ea79 + 432c9df commit 402dca4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public EntityDetailResponse(EntityDetailSubscreen entityScreen, String title) {
this.details = processDetails(entityScreen.getData());
this.headers = entityScreen.getHeaders();
this.styles = entityScreen.getStyles();

this.tiles = processCaseTiles(entityScreen.getDetail());
}

private static Object[] processDetails(Object[] data) {
Expand Down Expand Up @@ -94,15 +94,16 @@ public EntityDetailResponse(Detail detail,
entityList.toArray(this.entities);
this.title = title;
this.styles = processStyles(detail);
this.tiles = processCaseTiles(detail);
Pair<String[], int[]> pair = EntityListResponse.processHeader(detail, ec, 0);
setHeaders(pair.first);
setUseNodeset(true);
}

private void processCaseTiles(Detail shortDetail) {
DetailField[] fields = shortDetail.getFields();
if (!shortDetail.usesEntityTileView()) {
return;
private Tile[] processCaseTiles(Detail detail) {
DetailField[] fields = detail.getFields();
if (!detail.usesEntityTileView()) {
return null;
}
tiles = new Tile[fields.length];
setUsesCaseTiles(true);
Expand All @@ -113,11 +114,12 @@ private void processCaseTiles(Detail shortDetail) {
tiles[i] = null;
}
}
numEntitiesPerRow = shortDetail.getNumEntitiesToDisplayPerRow();
Pair<Integer, Integer> maxWidthHeight = shortDetail.getMaxWidthHeight();
numEntitiesPerRow = detail.getNumEntitiesToDisplayPerRow();
Pair<Integer, Integer> maxWidthHeight = detail.getMaxWidthHeight();
maxWidth = maxWidthHeight.first;
maxHeight = maxWidthHeight.second;
useUniformUnits = shortDetail.useUniformUnitsInCaseTile();
useUniformUnits = detail.useUniformUnitsInCaseTile();
return tiles;
}

protected static Style[] processStyles(Detail detail) {
Expand Down
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

0 comments on commit 402dca4

Please sign in to comment.