use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.
the class HtmlTable method tableHeaderCell.
@Override
public void tableHeaderCell(String content) {
m_out.print("<th>");
final int columnIndex = m_temporaryColumn;
// next
m_temporaryColumn++;
String sortId;
if (m_sortInfo.getColumnIndex() == columnIndex) {
if (m_sortInfo.isAscending()) {
sortId = m_tableId + ".sortCol." + columnIndex + ".down";
} else {
sortId = m_tableId + ".sortCol." + columnIndex + ".up";
}
} else {
sortId = m_tableId + ".sortCol." + columnIndex;
}
startLinkAction(new AbstractHtmlAction(sortId) {
@Override
public void run() {
if (m_sortInfo.getColumnIndex() == columnIndex) {
m_sortInfo.setAscending(!m_sortInfo.isAscending());
} else {
m_sortInfo.setColumnIndex(columnIndex);
m_sortInfo.setAscending(true);
}
}
});
if (m_sortInfo.getColumnIndex() == columnIndex) {
m_out.print("<b>");
}
if (!StringUtility.hasText(content)) {
m_out.print(" ");
} else {
print(content);
}
if (m_sortInfo.getColumnIndex() == columnIndex) {
m_out.print("</b>");
}
endLinkAction();
m_out.print("</th>");
}
Aggregations