Skip to content

Commit 12c06ca

Browse files
authored
Remove unused methods from DisplayColumn, refactor (#229)
1 parent 814c34e commit 12c06ca

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

laboratory/src/org/labkey/laboratory/query/EnterResultsDisplayColumn.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
import org.labkey.api.exp.api.ExperimentService;
1111
import org.labkey.api.util.PageFlowUtil;
1212
import org.labkey.api.view.ActionURL;
13+
import org.labkey.api.writer.HtmlWriter;
1314

14-
import java.io.IOException;
15-
import java.io.Writer;
15+
import static org.labkey.api.util.DOM.TD;
16+
import static org.labkey.api.util.DOM.cl;
1617

1718
/**
1819
* User: bimber
@@ -45,20 +46,20 @@ public String renderURL(RenderContext ctx)
4546
}
4647

4748
@Override
48-
public void renderGridCellContents(RenderContext ctx, Writer out) throws IOException
49+
public void renderGridCellContents(RenderContext ctx, HtmlWriter out)
4950
{
5051
Object value = getValue(ctx);
5152
String url = renderURL(ctx);
5253

5354
if (value != null && url != null)
5455
{
55-
out.write(PageFlowUtil.link(value.toString()).href(url).target(_linkTarget).toString());
56+
out.write(PageFlowUtil.link(value.toString()).href(url).target(_linkTarget));
5657
}
5758
}
5859

5960
@Override
60-
public void renderGridHeaderCell(RenderContext ctx, Writer out, String headerClass) throws IOException
61+
public void renderGridHeaderCell(RenderContext ctx, HtmlWriter out, String headerClass)
6162
{
62-
out.write("<td class=\"labkey-column-header\"></td>");
63+
TD(cl("labkey-column-header")).appendTo(out);
6364
}
6465
}

laboratory/src/org/labkey/laboratory/query/WorkbookIdDisplayColumn.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import org.labkey.api.data.ColumnInfo;
44
import org.labkey.api.data.DataColumn;
55
import org.labkey.api.data.RenderContext;
6-
7-
import java.io.IOException;
8-
import java.io.Writer;
6+
import org.labkey.api.writer.HtmlWriter;
97

108
/**
119
* User: bimber
@@ -20,9 +18,9 @@ public WorkbookIdDisplayColumn(ColumnInfo col)
2018
}
2119

2220
@Override
23-
public void renderGridCellContents(RenderContext ctx, Writer out) throws IOException
21+
public void renderGridCellContents(RenderContext ctx, HtmlWriter out)
2422
{
25-
//if the lookup is broken, dont render a value
23+
//if the lookup is broken, don't render a value
2624
Object dv = getDisplayValue(ctx);
2725
if (dv == null || "".equals(dv))
2826
return;
@@ -35,7 +33,7 @@ public Object getDisplayValue(RenderContext ctx)
3533
{
3634
Object ret = super.getDisplayValue(ctx);
3735

38-
//if the lookup is broken, dont render a value. note: return empty string so client API draws the distinction between deliberately empty and a genuine NULL value
36+
//if the lookup is broken, don't render a value. note: return empty string so client API draws the distinction between deliberately empty and a genuine NULL value
3937
return ret == null ? "" : ret;
4038
}
4139
}

0 commit comments

Comments
 (0)