|
Renderers
A component is composed of renderers. The renderer's job is to render the component. The attributes of each renderer represent the features that are valid to renderer the specific component. For the purpose of this article I will also talk about the Html renderers and their attributes as they are used more often. For the other views see the javadocs to find out the various renderer specific attributes and how to use them. TableRendererEach Table component has a TableRenderer. There are no common attributes for a TableRenderer between different views. However, an HtmlTableRenderer has the following attributes: style, styleClass, border, cellpadding, cellspacing, and width. The style is the style attribute on the html table element. For instance this would change the font color to blue in the table.
table.getTableRenderer().setStyle("color:blue");
<jmesa:table style="color:blue"> The styleClass is the class attribute on the html table element. For instance this would change the css class to jmesaTable.
table.getTableRenderer().setStyleClass("jmesaTable");
<jmesa:table styleClass="jmesaTable"> The border is the border attribute on the html table element. For instance this would change the border to 1px.
table.getTableRenderer().setBorder("1px");
<jmesa:table border="1px"> The cellpadding is the cellpadding attribute on the html table element. For instance this would change the cellpadding to 1px.
table.getTableRenderer().setCellpadding("1px");
<jmesa:table cellpadding="1px""> The cellspacing is the cellspacing attribute on the html table element. For instance this would change the cellspacing to 1px.
table.getTableRenderer().setCellspacing("1px");
<jmesa:table cellspacing="1px""> The width is the width attribute on the html table element. For instance this would change the width to 600px.
table.getTableRenderer().setWidth("600px");
<jmesa:table width="600px""> RowRendererEach Row component has a RowRenderer. There are no common attributes for a RowRenderer between different views. However, an HtmlRowRenderer has the following attributes: style, styleClass, highlightStyle, highlightClass, evenClass, and oddClass. The style is the style attribute on the html tr element. For instance this would change the height of the row to 20px.
row.getRowRenderer().setStyle("height:20px");
<jmesa:row style="height:20px""> The styleClass is the class attribute on the html tr element. For instance this would change the css class to jmesaRow.
row.getRowRenderer().setStyleClass("jmesaRow");
<jmesa:row styleClass="jmesaRow"> The highlightStyle is the style attribute on the html tr element. For instance this would change the height of the row to 20px.
row.getRowRenderer().setHighlightStyle("height:20px");
<jmesa:row highlightStyle="height:20px"> The highlightClass is the class attribute on the html tr element. For instance this would change the css class to jmesaRowHighlighter.
row.getRowRenderer().setHighlightClass("jmesaRowHighlighter");
<jmesa:row highlightClass="jmesaRowHighlighter"> The evenClass is the class attribute on the html tr element. For instance this would change the css class to jmesaRowEven.
row.getRowRenderer().setEvenClass("jmesaRowEven");
<jmesa:row evenClass="jmesaRowEven"> The oddClass is the class attribute on the html tr element. For instance this would change the css class to jmesaRowOdd.
row.getRowRenderer().setOddClass("jmesaRowOdd");
<jmesa:row oddClass="jmesaRowOdd"> CellRendererEach Column component has a CellRenderer. The common attribute for all CellRenderers, regardless of the view, is the CellEditor. A CellEditor is responsible for returning the value that the renderer will render. For more information see the Editors article. An HtmlCellRenderer has the following attributes: style, and styleClass. The style is the style attribute on the html td element. For instance this would change the font color to blue in the column.
column.getCellRenderer().setStyle("color:blue");
<jmesa:column style="color:blue"> The styleClass is the class attribute on the html td element. For instance this would change the css class to jmesaCell.
column.getCellRenderer().setStyleClass("jmesaCell");
<jmesa:column styleClass="jmesaCell"> HeaderRendererEach Column component has a HeaderRenderer. The common attribute for all HeaderRenderers, regardless of the view, is the HeaderEditor. A HeaderEditor is responsible for returning the value that the renderer will render. For more information see the Editors article. An HtmlHeaderRenderer has the following attributes: style, styleClass, and defaultSortOrderable. The style is the style attribute on the html td element in the header row. For instance this would change the height of the column to 20px.
column.geHeaderRenderer().setStyle("height:20px");
<jmesa:column headerStyle="height:20px"> The styleClass is the class attribute on the html td element in the header row. For instance this would change the css class to jmesaHeader.
column.getHeaderRenderer().setStyleClass("jmesaHeader");
<jmesa:column headerClass="jmesaHeader"> FilterRendererEach Column component has a FilterRenderer. The common attribute for all FilterRenderers, regardless of the view, is the FilterEditor. A FilterEditor is responsible for returning the value that the renderer will render. For more information see the Editors article. An HtmlFilterRenderer has the following attributes: style, and styleClass. The style is the style attribute on the html td element. For instance this would change the height of the column to 20px.
column.getFilterRenderer().setStyle("height:20px");
<jmesa:column filterStyle="height:20px"> The styleClass is the class attribute on the html td element. For instance this would change the css class to jmesaFilter.
column.getFilterRenderer().setStyleClass("jmesaFilter");
<jmesa:column filterClass="jmesaFilter"> |