Search in sources :

Example 11 with AbstractHtmlAction

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("&nbsp;");
    } else {
        print(content);
    }
    if (m_sortInfo.getColumnIndex() == columnIndex) {
        m_out.print("</b>");
    }
    endLinkAction();
    m_out.print("</th>");
}
Also used : AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction)

Aggregations

AbstractHtmlAction (org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction)11 PropertyDescriptor (java.beans.PropertyDescriptor)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 TreeMap (java.util.TreeMap)1 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)1 IView (org.eclipse.scout.rt.server.admin.html.IView)1 ProcessInspector (org.eclipse.scout.rt.server.admin.inspector.ProcessInspector)1 ServiceInspector (org.eclipse.scout.rt.server.admin.inspector.ServiceInspector)1 SessionInspector (org.eclipse.scout.rt.server.admin.inspector.SessionInspector)1 CallInfo (org.eclipse.scout.rt.server.admin.inspector.info.CallInfo)1 UpdateServiceConfigurationPermission (org.eclipse.scout.rt.shared.security.UpdateServiceConfigurationPermission)1 IPingService (org.eclipse.scout.rt.shared.services.common.ping.IPingService)1