Class: Java::javafx::scene::control::TreeView

Inherits:
Object
  • Object
show all
Includes:
JRubyFX::DSL
Defined in:
lib/jrubyfx/core_ext/tree_view.rb

Overview

JRubyFX DSL extensions for JavaFX Tree views

Constant Summary

Constants included from JRubyFX::DSL

JRubyFX::DSL::NAME_TO_CLASSES, JRubyFX::DSL::NAME_TO_CLASS_NAME

Constants included from JRubyFX::FXImports

JRubyFX::FXImports::JFX_CLASS_HIERARCHY, JRubyFX::FXImports::LOCAL_NAME_MAP

Constants included from JRubyFX

JRubyFX::VERSION

Instance Method Summary collapse

Methods included from JRubyFX::DSL

compile_dsl, included, load_dsl, #logical_lookup, #self_test_lookup, write_color_method_converter, write_enum_converter, write_enum_method_converter, write_event_method

Methods included from JRubyFX::FXImports

#const_missing

Methods included from JRubyFX

#build, included, load_fx, #run_later, #with

Methods included from JRubyFX::Utils::CommonUtils

#attempt_conversion, #populate_properties, #split_args_from_properties

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object

Add any child tree items as the root node. Note, that there is only one root and successive tree_items in a tree_view will keep replacing the root.


35
36
37
38
39
# File 'lib/jrubyfx/core_ext/tree_view.rb', line 35

def method_missing(name, *args, &block)
  super.tap do |obj|
    set_root(obj) if obj.kind_of? TreeItem
  end
end

Instance Method Details

#tree_item(*args, &block) ⇒ Object

get_tree_item interferes with idiomatic construction of a root tree_item. We override and users should use get_tree_item(i) if they want the original method.


27
28
29
# File 'lib/jrubyfx/core_ext/tree_view.rb', line 27

def tree_item(*args, &block)
  method_missing(:tree_item, *args, &block)
end