# 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 'java' module SWT def self.object_tree(o) require 'apps/objecttree' JRubyUtils::RubyObjectBrowser.object_tree o end class TreeCommand def initialize(parent) @parent=parent end def accept(child) child end def stacktrace "in #{self.class}\n#{@parent.stacktrace if @parent}" end end class SimpleCommand0 res.getParent.removeTreeListener li end end parent.getParent.addTreeListener li end end class LabelCommandRealSWT::BORDER},&block) opts[:style] or opts[:style]=RealSWT::BORDER res=Tree.new(@parent,opts[:style]) init_control res,opts builder=TreeBuilder.new &block #puts builder.current builder.run res res.pack return res end unless Builder.methods.include? :method_missing alias :old_method_missing method_missing end def method_missing(id,*args) #puts "ID:#{id.class.inspect}\t\targs:#{args.join ','}\t#{id=~/labeled(\w+)/}" if id.to_s=~/labeled(\w+)/ label args.shift method($1.downcase).call *args else old_method_missing id,args end end def Builder.run(shell) d=shell.getDisplay while(!shell.isDisposed&&shell.isVisible) do while(d.readAndDispatch) do end d.sleep end end end end