Search in sources :

Example 1 with SessionInspector

use of org.eclipse.scout.rt.server.admin.inspector.SessionInspector in project scout.rt by eclipse.

the class CallsView method produceBody.

@Override
public void produceBody(HtmlComponent p) {
    final SessionInspector session = getAdminSession().getTopView().getSessionsView().getSelectedSession();
    p.linkAction("Clear calls", new AbstractHtmlAction("clearCalls") {

        @Override
        public void run() {
            session.clearCallInspectors();
        }
    });
    p.p();
    // 
    p.startTable(0, 5, 5);
    p.startTableRow();
    p.startTableCell();
    renderCallTable(p, session);
    p.startTableCell();
    // selected call
    if (m_selectedCall != null) {
        renderCallDetail(p, m_selectedCall);
    }
    p.endTableCell();
    p.endTableRow();
    p.endTable();
}
Also used : AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction) SessionInspector(org.eclipse.scout.rt.server.admin.inspector.SessionInspector)

Example 2 with SessionInspector

use of org.eclipse.scout.rt.server.admin.inspector.SessionInspector in project scout.rt by eclipse.

the class SessionsView method renderSessionTable.

protected void renderSessionTable(HtmlComponent p) {
    HtmlTable table1 = new HtmlTable(p, "table1", m_table1SortInfo);
    table1.startTable(1, 0, 3);
    renderSessionTableHeader(table1);
    SessionInspector validSelection = null;
    SessionInspector[] sorted = getSortedSessions();
    for (int i = sorted.length - 1; i >= 0; i--) {
        if (sorted[i] == m_selectedSession) {
            validSelection = m_selectedSession;
        }
        VirtualRow vrow = table1.addVirtualRow();
        renderSessionRow(vrow, i + 1, sorted[i]);
    }
    table1.appendVirtualRows();
    m_selectedSession = validSelection;
    table1.endTable();
    p.append(table1);
}
Also used : HtmlTable(org.eclipse.scout.rt.server.admin.html.widget.table.HtmlTable) VirtualRow(org.eclipse.scout.rt.server.admin.html.widget.table.VirtualRow) SessionInspector(org.eclipse.scout.rt.server.admin.inspector.SessionInspector)

Example 3 with SessionInspector

use of org.eclipse.scout.rt.server.admin.inspector.SessionInspector in project scout.rt by eclipse.

the class CallsView method produceTitle.

@Override
public void produceTitle(HtmlComponent p) {
    final SessionInspector session = getAdminSession().getTopView().getSessionsView().getSelectedSession();
    p.print("Calls of " + (session != null ? session.getInfo().getUserId() + "/" + session.getInfo().getSessionId() : "?"));
}
Also used : SessionInspector(org.eclipse.scout.rt.server.admin.inspector.SessionInspector)

Example 4 with SessionInspector

use of org.eclipse.scout.rt.server.admin.inspector.SessionInspector in project scout.rt by eclipse.

the class SessionsView method getSortedSessions.

protected SessionInspector[] getSortedSessions() {
    SessionInspector[] sessionInspectors = ProcessInspector.instance().getSessionInspectors();
    TreeMap<CompositeObject, SessionInspector> userAndTimeToSessions = new TreeMap<CompositeObject, SessionInspector>();
    for (int i = 0; i < sessionInspectors.length; i++) {
        String user = sessionInspectors[i].getInfo().getUserId();
        long lastAccess = NumberUtility.nvl(sessionInspectors[i].getInfo().getLastAccessedTime(), 0L);
        userAndTimeToSessions.put(new CompositeObject(lastAccess, user, i), sessionInspectors[i]);
    }
    return userAndTimeToSessions.values().toArray(new SessionInspector[userAndTimeToSessions.size()]);
}
Also used : CompositeObject(org.eclipse.scout.rt.platform.util.CompositeObject) TreeMap(java.util.TreeMap) SessionInspector(org.eclipse.scout.rt.server.admin.inspector.SessionInspector)

Aggregations

SessionInspector (org.eclipse.scout.rt.server.admin.inspector.SessionInspector)4 TreeMap (java.util.TreeMap)1 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)1 AbstractHtmlAction (org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction)1 HtmlTable (org.eclipse.scout.rt.server.admin.html.widget.table.HtmlTable)1 VirtualRow (org.eclipse.scout.rt.server.admin.html.widget.table.VirtualRow)1