public class FitFormatter extends Object implements CellFormatter<fit.Parse>
| Constructor and Description |
|---|
FitFormatter() |
| Modifier and Type | Method and Description |
|---|---|
void |
asLink(CellWrapper<fit.Parse> cell,
String resolvedUrl,
String link,
String text)
formats the content as a hyperlink.
|
void |
check(CellWrapper<fit.Parse> valueCell,
RestDataTypeAdapter adapter)
formats a check cell.
|
void |
exception(CellWrapper<fit.Parse> cell,
String exceptionMessage)
formats a cell containing an exception.
|
void |
exception(CellWrapper<fit.Parse> cell,
Throwable exception)
formats a cell containing an exception.
|
String |
fromRaw(String text)
in SLIM cell content is HTML escaped - we abstract this method to
delegate to formatter the cleaning of the content.
|
String |
gray(String string)
formats a cell with a gray background.
|
boolean |
isDisplayActual() |
String |
label(String string)
formats a cell label
|
void |
right(CellWrapper<fit.Parse> expected,
RestDataTypeAdapter typeAdapter)
formats a cell representing a right expectation.
|
void |
setActionFixtureDelegate(fit.ActionFixture f)
sets the action fixture delegate to forward formatting messages.
|
void |
setDisplayAbsoluteURLInFull(boolean displayAbsoluteURLInFull)
sets whether absolute urls are displayed in full
|
void |
setDisplayActual(boolean d)
sets whether the cell should display the actual value after evaluation.
|
void |
setMinLengthForToggleCollapse(int minLen)
renders the cell as a toggle area if the content of the cell is over the
min value set here.
|
void |
wrong(CellWrapper<fit.Parse> expected,
RestDataTypeAdapter typeAdapter)
formats a cell representing a wrong expectation.
|
public void setActionFixtureDelegate(fit.ActionFixture f)
f - the fixturepublic boolean isDisplayActual()
isDisplayActual in interface CellFormatter<fit.Parse>public void setMinLengthForToggleCollapse(int minLen)
CellFormattersetMinLengthForToggleCollapse in interface CellFormatter<fit.Parse>minLen - the min value of the content of a cell.public void setDisplayActual(boolean d)
CellFormattersetDisplayActual in interface CellFormatter<fit.Parse>d - true if actual value has to be rendered.public void setDisplayAbsoluteURLInFull(boolean displayAbsoluteURLInFull)
CellFormattersetDisplayAbsoluteURLInFull in interface CellFormatter<fit.Parse>displayAbsoluteURLInFull - the value to setpublic void exception(CellWrapper<fit.Parse> cell, String exceptionMessage)
CellFormatterexception in interface CellFormatter<fit.Parse>cell - the cell wrapperexceptionMessage - the exception message to render.public void exception(CellWrapper<fit.Parse> cell, Throwable exception)
CellFormatterexception in interface CellFormatter<fit.Parse>cell - the cell wrapperexception - the excteption to render.public void check(CellWrapper<fit.Parse> valueCell, RestDataTypeAdapter adapter)
CellFormattercheck in interface CellFormatter<fit.Parse>valueCell - the cell value.adapter - the adapter interpreting the value.public String label(String string)
CellFormatterlabel in interface CellFormatter<fit.Parse>string - the labelpublic void wrong(CellWrapper<fit.Parse> expected, RestDataTypeAdapter typeAdapter)
CellFormatterwrong in interface CellFormatter<fit.Parse>expected - the expected valuetypeAdapter - the adapter with the actual value.public void right(CellWrapper<fit.Parse> expected, RestDataTypeAdapter typeAdapter)
CellFormatterright in interface CellFormatter<fit.Parse>expected - the expected valuetypeAdapter - the adapter with the actual value.public String gray(String string)
CellFormattergray in interface CellFormatter<fit.Parse>string - the contentpublic void asLink(CellWrapper<fit.Parse> cell, String resolvedUrl, String link, String text)
CellFormatterasLink in interface CellFormatter<fit.Parse>cell - the cell.resolvedUrl - the cell content after symbols' substitution.link - the uri in the href.text - the text.public String fromRaw(String text)
CellFormatterfromRaw in interface CellFormatter<fit.Parse>text - the textCopyright © 2017 smartrics. All rights reserved.