Skip to content

Instantly share code, notes, and snippets.

View wudong's full-sized avatar

Wudong Liu wudong

  • UBS
  • Colchester, UK
View GitHub Profile
function activateActivityTracker() {
window.addEventListener("mousemove", userActivityThrottler);
window.addEventListener("scroll", userActivityThrottler);
window.addEventListener("keydown", userActivityThrottler);
window.addEventListener("resize", userActivityThrottler);
}
var userActivityThrottlerTimeout = null
function userActivityThrottler() {
@wudong
wudong / tablecolumnlayout_example.java
Created February 5, 2013 12:25
Use TableColumnLayout to automatically change the table column width when resizing.
// 1
Composite comp = new Composite(shell, SWT.NONE);
Table table = new Table(comp, SWT.BORDER SWT.V_SCROLL);
table.setHeaderVisible(true);
table.setLinesVisible(true);
// 2
TableColumn column1 = new TableColumn(table, SWT.NONE);
column1.setText("Column 1");
TableColumn column2 = new TableColumn(table, SWT.NONE);
column2.setText("Column 2");