Example usage for org.apache.commons.lang.time FastDateFormat getTimeInstance

List of usage examples for org.apache.commons.lang.time FastDateFormat getTimeInstance

Introduction

In this page you can find the example usage for org.apache.commons.lang.time FastDateFormat getTimeInstance.

Prototype

public static FastDateFormat getTimeInstance(int style) 

Source Link

Document

Gets a time formatter instance using the specified style in the default time zone and locale.

Usage

From source file:org.jumpmind.metl.ui.views.admin.AboutPanel.java

@Override
public void selected() {
    if (table != null) {
        removeComponent(table);//from   w w  w.  j a  v a  2s  . c o  m
    }
    table = new Table();
    table.setSizeFull();
    table.addStyleName("noscroll");
    table.addContainerProperty("Name", String.class, null);
    table.setColumnWidth("Name", 200);
    table.addContainerProperty("Value", String.class, null);

    int itemId = 0;
    table.addItem(new Object[] { "Application Version", VersionUtils.getCurrentVersion() }, itemId++);
    table.addItem(new Object[] { "Build Time", VersionUtils.getBuildTime() }, itemId++);
    table.addItem(new Object[] { "SCM Revision", VersionUtils.getScmVersion() }, itemId++);
    table.addItem(new Object[] { "SCM Branch", VersionUtils.getScmBranch() }, itemId++);

    table.addItem(new Object[] { "Host Name", AppUtils.getHostName() }, itemId++);
    table.addItem(new Object[] { "IP Address", AppUtils.getIpAddress() }, itemId++);
    table.addItem(new Object[] { "Java Version", System.getProperty("java.version") }, itemId++);
    table.addItem(new Object[] { "System Time",
            FastDateFormat.getTimeInstance(FastDateFormat.MEDIUM).format(new Date()) }, itemId++);
    table.addItem(
            new Object[] { "Used Heap",
                    Long.toString(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) },
            itemId++);
    table.addItem(new Object[] { "Heap Size", Long.toString(Runtime.getRuntime().maxMemory()) }, itemId++);
    table.addItem(new Object[] { "Last Restart", CommonUiUtils.formatDateTime(AgentManager.lastRestartTime) },
            itemId++);

    addComponent(table);
    setExpandRatio(table, 1);

}