2323import org .labkey .api .data .RenderContext ;
2424import org .labkey .api .query .FieldKey ;
2525import org .labkey .api .util .GUID ;
26- import org .labkey .api .util .PageFlowUtil ;
2726import org .labkey .api .view .ActionURL ;
2827import org .labkey .api .view .HttpView ;
2928import org .labkey .api .writer .HtmlWriter ;
3029import org .labkey .targetedms .TargetedMSController ;
3130import org .labkey .targetedms .view .ChromatogramsDataRegion ;
3231import org .springframework .web .servlet .mvc .Controller ;
3332
34- import java .io .IOException ;
35- import java .io .Writer ;
3633import java .util .Set ;
3734import java .util .function .Consumer ;
3835
36+ import static org .labkey .api .util .DOM .A ;
37+ import static org .labkey .api .util .DOM .Attribute .alt ;
38+ import static org .labkey .api .util .DOM .Attribute .name ;
39+ import static org .labkey .api .util .DOM .Attribute .style ;
40+ import static org .labkey .api .util .DOM .DIV ;
41+ import static org .labkey .api .util .DOM .at ;
3942import static org .labkey .targetedms .view .ChromatogramsDataRegion .FRAGMENT_PREFIX ;
4043import static org .labkey .targetedms .view .ChromatogramsDataRegion .HIGHLIGHTED_CHROMATOGRAM_PARAMETER_NAME ;
4144
42- /**
43- * User: vsharma
44- * Date: 5/3/12
45- * Time: 9:10 PM
46- */
4745public class ChromatogramDisplayColumnFactory implements DisplayColumnFactory
4846{
4947 private final Container _container ;
@@ -156,8 +154,8 @@ public ChromatogramDisplayColumnFactory(Container container, Type type,
156154 @ Override
157155 public DisplayColumn createRenderer (ColumnInfo colInfo )
158156 {
159- return new DataColumn (colInfo ) {
160-
157+ return new DataColumn (colInfo )
158+ {
161159 @ Override
162160 public boolean isFilterable ()
163161 {
@@ -171,7 +169,7 @@ public boolean isSortable()
171169 }
172170
173171 @ Override
174- public void renderGridCellContents (RenderContext ctx , Writer oldWriter , HtmlWriter out ) throws IOException
172+ public void renderGridCellContents (RenderContext ctx , HtmlWriter out )
175173 {
176174 Object id = getValue (ctx ); // Primary key from the relevant table
177175 if (null == id )
@@ -204,13 +202,20 @@ public void renderGridCellContents(RenderContext ctx, Writer oldWriter, HtmlWrit
204202
205203 ChromatogramsDataRegion dataRegion = (ChromatogramsDataRegion )ctx .getCurrentRegion ();
206204
207- String html = "<a name=\" " + FRAGMENT_PREFIX + id + "\" ></a>" ;
208- html += "<div alt=\" Chromatogram " + PageFlowUtil .filter (sampleName ) + "\" style=\" border: " + (highlight ? "beige" : "white" ) +
209- " solid 8px; width:" + (_chartWidth + 16 ) + "px; min-height:" + (_chart_height + 50 ) + "px\" id=\" " + PageFlowUtil .filter (domId ) + "\" ></div>" +
210- "<div style=\" text-align: center\" id=\" " + PageFlowUtil .filter (domLabelId ) + "\" ></div>" ;
205+ A (at (name ,FRAGMENT_PREFIX + id )).appendTo (out );
206+ DIV (
207+ at (
208+ alt , "Chromatogram " + sampleName ,
209+ style , "border: " + (highlight ? "beige" : "white" ) + " solid 8px; width:" + (_chartWidth + 16 ) + "px; min-height:" + (_chart_height + 50 ) + "px"
210+ ).id (domId )
211+ ).appendTo (out );
212+ DIV (
213+ at (
214+ style , "text-align: center"
215+ ).id (domLabelId )
216+ ).appendTo (out );
211217
212218 dataRegion .addSVG (chromAction .getLocalURIString (), domId , domLabelId );
213- oldWriter .write (html );
214219 }
215220
216221 @ Override
0 commit comments