swt練習

import org.eclipse.swt.widgets;

object Main {
  def main(args: Array[String]) {
    val display = new widgets.Display();
    val shell = new widgets.Shell(display);
    shell.open();
    // loop
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()){
        display.sleep();
      }
    }
    display.dispose();
  }
}

disposeは「始末する」ととると意味がわかる

Shell

http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fwidgets%2FShell.html

import org.eclipse.swt.widgets.Widgetを祖先にもつウインドウクラス。
displayを引数に生成したものはいわゆるトップレベルウィンドウになるようだ。