GridLayout layout;
Label label;
setLayout(new FillLayout());
CTabFolder stats_tabs = new CTabFolder(this,SWT.BORDER);
stats_tabs.setLayout(new FillLayout());
stats_tabs.setSimple(false);
CTabItem network_stats = new CTabItem(stats_tabs,SWT.NONE);
network_stats.setText(_._("mainwindow.statisticstab.tab.general"));
content = new Composite(stats_tabs,SWT.NONE);
network_stats.setControl(content);
content.setLayout(new GridLayout(2,true));
Group sessions_stats = new Group(content,SWT.NONE);
sessions_stats.setText(_._("mainwindow.statisticstab.tab.general.group.sessions"));
layout_data = new GridData(GridData.FILL_HORIZONTAL);
sessions_stats.setLayoutData(layout_data);
layout = new GridLayout(2,false);
sessions_stats.setLayout(layout);
label = new Label(sessions_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.session_downloaded") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label download_session_bytes = new Label(sessions_stats,SWT.NONE);
download_session_bytes.setFont(skin.getLabelFont());
download_session_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_SESSION_DOWNLOAD_BYTES, download_session_bytes);
label = new Label(sessions_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.session_uploaded") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label upload_session_bytes = new Label(sessions_stats,SWT.NONE);
upload_session_bytes.setFont(skin.getLabelFont());
upload_session_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_SESSION_UPLOAD_BYTES, upload_session_bytes);
label = new Label(sessions_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.session_download_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label download_session_count = new Label(sessions_stats,SWT.NONE);
download_session_count.setFont(skin.getLabelFont());
download_session_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_SESSION_DOWNLOAD_COUNT, download_session_count);
label = new Label(sessions_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.session_upload_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label upload_session_count = new Label(sessions_stats,SWT.NONE);
upload_session_count.setFont(skin.getLabelFont());
upload_session_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_SESSION_UPLOAD_COUNT, upload_session_count);
Group peers_stats = new Group(content,SWT.NONE);
peers_stats.setText(_._("mainwindow.statisticstab.tab.general.group.peers"));
layout_data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING );
peers_stats.setLayoutData(layout_data);
layout = new GridLayout(2,false);
peers_stats.setLayout(layout);
label = new Label(peers_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.peer_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label peer_count = new Label(peers_stats,SWT.NONE);
peer_count.setFont(skin.getLabelFont());
peer_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_PEERS_COUNT, peer_count);
label = new Label(peers_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.download_peers") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label download_peers = new Label(peers_stats,SWT.NONE);
download_peers.setFont(skin.getLabelFont());
download_peers.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_PEERS_DOWNLOAD_COUNT, download_peers);
label = new Label(peers_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.upload_peers") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label upload_peers = new Label(peers_stats,SWT.NONE);
upload_peers.setFont(skin.getLabelFont());
upload_peers.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_PEERS_UPLOAD_COUNT, upload_peers);
new Label(peers_stats,SWT.NONE);
Group sesvers_stats = new Group(content,SWT.NONE);
sesvers_stats.setText(_._("mainwindow.statisticstab.tab.general.group.servers"));
layout_data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING );
sesvers_stats.setLayoutData(layout_data);
layout = new GridLayout(2,false);
sesvers_stats.setLayout(layout);
label = new Label(sesvers_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.server_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label server_count = new Label(sesvers_stats,SWT.NONE);
server_count.setFont(skin.getLabelFont());
server_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_SERVERS_COUNT, server_count);
label = new Label(sesvers_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.server_alive_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label server_alive_count = new Label(sesvers_stats,SWT.NONE);
server_alive_count.setFont(skin.getLabelFont());
server_alive_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_SERVERS_ALIVE_COUNT, server_alive_count);
label = new Label(sesvers_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.server_dead_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label server_dead_count = new Label(sesvers_stats,SWT.NONE);
server_dead_count.setFont(skin.getLabelFont());
server_dead_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_NET_SERVERS_DEAD_COUNT, server_dead_count);
label = new Label(sesvers_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.search_query_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label search_query_count = new Label(sesvers_stats,SWT.NONE);
search_query_count.setFont(skin.getLabelFont());
search_query_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.SEARCHES_COUNT, search_query_count);
layout_data = new GridData();
layout_data.horizontalSpan = 2;
new Label(sesvers_stats,SWT.NONE).setLayoutData(layout_data);
layout_data = new GridData();
layout_data.horizontalSpan = 2;
new Label(sesvers_stats,SWT.NONE).setLayoutData(layout_data);
Group sharing_stats = new Group(content,SWT.NONE);
sharing_stats.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
sharing_stats.setLayout(new GridLayout(2,false));
sharing_stats.setText(_._("mainwindow.statisticstab.tab.general.group.shared"));
label = new Label(sharing_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_files_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label shared_files_count = new Label(sharing_stats,SWT.NONE);
shared_files_count.setFont(skin.getLabelFont());
shared_files_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COUNT, shared_files_count);
label = new Label(sharing_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_partial_files") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label shared_partial_files = new Label(sharing_stats,SWT.NONE);
shared_partial_files.setFont(skin.getLabelFont());
shared_partial_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_PARTIAL_COUNT, shared_partial_files);
label = new Label(sharing_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_completed_files") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label shared_completed_files = new Label(sharing_stats,SWT.NONE);
shared_completed_files.setFont(skin.getLabelFont());
shared_completed_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COMPLETE_COUNT, shared_completed_files);
label = new Label(sharing_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_files_bytes") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label shared_files_bytes = new Label(sharing_stats,SWT.NONE);
shared_files_bytes.setFont(skin.getLabelFont());
shared_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_BYTES, shared_files_bytes);
label = new Label(sharing_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.completed_files_bytes") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label completed_files_bytes = new Label(sharing_stats,SWT.NONE);
completed_files_bytes.setFont(skin.getLabelFont());
completed_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COMPLETE_BYTES, completed_files_bytes);
label = new Label(sharing_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.general.label.partial_files_bytes") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
Label partial_files_bytes = new Label(sharing_stats,SWT.NONE);
partial_files_bytes.setFont(skin.getLabelFont());
partial_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_PARTIAL_BYTES, partial_files_bytes);
CTabItem jvm_stats = new CTabItem(stats_tabs,SWT.NONE);
jvm_stats.setText(_._("mainwindow.statisticstab.tab.jvm"));
content = new Composite(stats_tabs,SWT.NONE);
jvm_stats.setControl(content);
content.setLayout(new GridLayout(2,true));
Group jvm_general_stats = new Group(content,SWT.NONE);
jvm_general_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.general"));
layout_data = new GridData(GridData.FILL_HORIZONTAL);
jvm_general_stats.setLayoutData(layout_data);
layout = new GridLayout(2,false);
jvm_general_stats.setLayout(layout);
label = new Label(jvm_general_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_name") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
label = new Label(jvm_general_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(runtime_bean.getVmName());
label = new Label(jvm_general_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_vendor") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
label = new Label(jvm_general_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(runtime_bean.getVmVendor());
label = new Label(jvm_general_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_version") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
label = new Label(jvm_general_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(runtime_bean.getVmVersion());
label = new Label(jvm_general_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_uptime") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
jvm_uptime = new Label(jvm_general_stats,SWT.NONE);
jvm_uptime.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
jvm_uptime.setText(TimeFormatter.formatColon(runtime_bean.getUptime()/1000)+"");
Group heapmemory_stats = new Group(content,SWT.NONE);
heapmemory_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.heap_memory"));
layout_data = new GridData(GridData.FILL_HORIZONTAL);
heapmemory_stats.setLayoutData(layout_data);
layout = new GridLayout(2,false);
heapmemory_stats.setLayout(layout);
label = new Label(heapmemory_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_init") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
heapmemory_init = new Label(heapmemory_stats,SWT.NONE);
heapmemory_init.setFont(skin.getLabelFont());
heapmemory_init.setText(FileFormatter.formatFileSize(heap_memory.getInit()));
label = new Label(heapmemory_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_used") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
heapmemory_used = new Label(heapmemory_stats,SWT.NONE);
heapmemory_used.setFont(skin.getLabelFont());
heapmemory_used.setText(FileFormatter.formatFileSize(heap_memory.getUsed()));
label = new Label(heapmemory_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_max") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
heapmemory_max = new Label(heapmemory_stats,SWT.NONE);
heapmemory_max.setFont(skin.getLabelFont());
heapmemory_max.setText(FileFormatter.formatFileSize(heap_memory.getMax()));
new Label(heapmemory_stats,SWT.NONE);
Group nonheapmemory_stats = new Group(content,SWT.NONE);
nonheapmemory_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.nonheap_memory"));
layout_data = new GridData(GridData.FILL_HORIZONTAL);
nonheapmemory_stats.setLayoutData(layout_data);
layout = new GridLayout(2,false);
nonheapmemory_stats.setLayout(layout);
label = new Label(nonheapmemory_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_init") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
nonheapmemory_init = new Label(nonheapmemory_stats,SWT.NONE);
nonheapmemory_init.setFont(skin.getLabelFont());
nonheapmemory_init.setText(FileFormatter.formatFileSize(nonheap_memory.getInit()));
label = new Label(nonheapmemory_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_used") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
nonheapmemory_used = new Label(nonheapmemory_stats,SWT.NONE);
nonheapmemory_used.setFont(skin.getLabelFont());
nonheapmemory_used.setText(FileFormatter.formatFileSize(nonheap_memory.getUsed()));
label = new Label(nonheapmemory_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_max") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
nonheapmemory_max = new Label(nonheapmemory_stats,SWT.NONE);
nonheapmemory_max.setFont(skin.getLabelFont());
nonheapmemory_max.setText(FileFormatter.formatFileSize(nonheap_memory.getMax()));
label = new Label(nonheapmemory_stats,SWT.NONE);
Group thread_stats = new Group(content,SWT.NONE);
thread_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.threads"));
layout_data = new GridData(GridData.FILL_HORIZONTAL);
thread_stats.setLayoutData(layout_data);
layout = new GridLayout(2,false);
thread_stats.setLayout(layout);
label = new Label(thread_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.thread_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
thread_count = new Label(thread_stats,SWT.NONE);
thread_count.setFont(skin.getLabelFont());
thread_count.setText(thread_bean.getThreadCount()+"");
label = new Label(thread_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.daemon_thread_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
daemon_thread_count = new Label(thread_stats,SWT.NONE);
daemon_thread_count.setFont(skin.getLabelFont());
daemon_thread_count.setText(thread_bean.getDaemonThreadCount()+"");
label = new Label(thread_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.peak_thread_count") + " : ");
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
peak_thread_count = new Label(thread_stats,SWT.NONE);
peak_thread_count.setFont(skin.getLabelFont());
peak_thread_count.setText(thread_bean.getPeakThreadCount()+"");
label = new Label(thread_stats,SWT.NONE);
label.setFont(skin.getLabelFont());
label.setText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count") + " : ");
label.setToolTipText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count.tooltip"));
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
total_thread_count = new Label(thread_stats,SWT.NONE);
total_thread_count.setFont(skin.getLabelFont());
total_thread_count.setText(thread_bean.getTotalStartedThreadCount()+"");
total_thread_count.setToolTipText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count.tooltip"));
stats_tabs.setSelection(network_stats);
}