# The contents of this file are subject to the Mozilla Public License # Version 1.1 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the # License for the specific language governing rights and limitations # under the License. # # The Initial Developer of the Original Code is Johannes Rudolph. # Portions created by the Initial Developer are Copyright (C) 2006 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Johannes Rudolph require 'swt' require 'test/unit' module SWT class SWTTest < Test::Unit::TestCase include_class 'java.lang.Thread' do "JavaThread" end def test_swt_container shell=SWT::Builder.go do shell "Testprogramm",2 do tree(:verticalFill=>true,:horizontalFill=>true) do child do object{JavaThread.currentThread} label{|x| x} children(lambda{|x|x.getStackTrace}) do label{|x| x} leaf {|x|"Datei: #{x.getFileName}"} leaf {|x|"Zeilennummer: #{x.getLineNumber}"} end end end container 2 do group "Wurst",2 do labeledText "Katastrophe:" labeledText "Butterbrot:" end group "Buttons",1 do button "Hallo" button "Gustav das Brot" end end end end end end end