Skip to content

Commit 1fda962

Browse files
authored
Migrate to renderGridCellContents(RenderContext, HtmlWriter) (#552)
1 parent dde5962 commit 1fda962

File tree

2 files changed

+48
-31
lines changed

2 files changed

+48
-31
lines changed

panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7969,18 +7969,28 @@ private ModelAndView getSourceFilesView(SpectralLibrary specLib, ITargetedMSRun
79697969
List<String> spectrumFileNames = getSourceFiles(libSourceFiles, LibSourceFile::getSpectrumSourceFile);
79707970
List<String> idFileNames = getSourceFiles(libSourceFiles, LibSourceFile::getIdFile);
79717971
view.addView(new HtmlView(DIV(
7972-
TABLE(TR(
7973-
TD(at(valign, "top", style, "padding:5px;"),
7974-
createTable("Spectrum Files", spectrumFileNames)),
7975-
TD(at(valign, "top", style, "padding:5px;"),
7976-
createTable("Search Results Files", idFileNames)))
7977-
))));
7972+
TABLE(TR(
7973+
TD(
7974+
at(valign, "top", style, "padding:5px;"),
7975+
createTable("Spectrum Files", spectrumFileNames)
7976+
),
7977+
TD(
7978+
at(valign, "top", style, "padding:5px;"),
7979+
createTable("Search Results Files", idFileNames)
7980+
)
7981+
))
7982+
)));
79787983
}
79797984
}
79807985
catch (SpecLibReaderException e)
79817986
{
7982-
view.addView(new HtmlView(DIV(DIV(cl("labkey-error"), "Error reading library source files."),
7983-
DIV(ExceptionUtil.renderException(e)))));
7987+
view.addView(new HtmlView(
7988+
DIV(DIV(
7989+
cl("labkey-error"),
7990+
"Error reading library source files."),
7991+
DIV(ExceptionUtil.renderException(e))
7992+
))
7993+
);
79847994
}
79857995
}
79867996
}

panoramapublic/src/org/labkey/panoramapublic/view/publish/CatalogEntryWebPart.java

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -82,32 +82,39 @@ public CatalogEntryWebPart(ExperimentAnnotations expAnnotations, User user, @Nul
8282

8383
CatalogEntrySettings settings = CatalogEntryManager.getCatalogEntrySettings();
8484
addView(new HtmlView(
85-
DIV(
86-
TABLE(
87-
TR(
88-
TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Status:")),
89-
TD(at(style, "vertical-align:top;"),
90-
CatalogEntry.getStatusText(entry.getApproved()),
91-
changeStatusBtn == null ? "" : changeStatusBtn)
85+
DIV(
86+
TABLE(
87+
TR(
88+
TD(
89+
at(style, "padding:0 10px 15px 0; vertical-align:top;"),
90+
U("Status:")
9291
),
93-
TR(
94-
TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Title:")),
95-
TD(at(style, "vertical-align:top;"), expAnnotations.getTitle())
96-
),
97-
TR(
98-
TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Description:")),
99-
TD(at(style, "vertical-align:top;"), entry.getDescription())
92+
TD(
93+
at(style, "vertical-align:top;"),
94+
CatalogEntry.getStatusText(entry.getApproved()),
95+
changeStatusBtn == null ? "" : changeStatusBtn
10096
)
10197
),
102-
DIV(IMG(at(src, PanoramaPublicController.getCatalogImageDownloadUrl(expAnnotations, entry.getImageFileName()))
103-
.at(width, settings.getImgWidth()).at(height, settings.getImgHeight())
104-
.at(style, "margin:10px 0 15px 0;border: 1px solid lightgrey;"))),
105-
new ButtonBuilder("Edit").href(editUrl),
106-
HtmlString.NBSP,
107-
new ButtonBuilder("Delete").href(deleteUrl)
108-
.usePost("Are you sure you want to delete the Panorama Public catalog entry for this experiment?"),
109-
returnUrl != null ? DIV(at(style, "margin-top:25px;"), new ButtonBuilder("Back").href(returnUrl))
110-
: HtmlString.EMPTY_STRING
98+
TR(
99+
TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Title:")),
100+
TD(at(style, "vertical-align:top;"), expAnnotations.getTitle())
101+
),
102+
TR(
103+
TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Description:")),
104+
TD(at(style, "vertical-align:top;"), entry.getDescription())
105+
)
106+
),
107+
DIV(IMG(
108+
at(src, PanoramaPublicController.getCatalogImageDownloadUrl(expAnnotations, entry.getImageFileName()))
109+
.at(width, settings.getImgWidth()).at(height, settings.getImgHeight())
110+
.at(style, "margin:10px 0 15px 0;border: 1px solid lightgrey;")
111+
)),
112+
new ButtonBuilder("Edit").href(editUrl),
113+
HtmlString.NBSP,
114+
new ButtonBuilder("Delete").href(deleteUrl)
115+
.usePost("Are you sure you want to delete the Panorama Public catalog entry for this experiment?"),
116+
returnUrl != null ? DIV(at(style, "margin-top:25px;"), new ButtonBuilder("Back").href(returnUrl))
117+
: HtmlString.EMPTY_STRING
111118
)));
112119
}
113120
}

0 commit comments

Comments
 (0)