Class: CWM::Tree
- Inherits:
-
CustomWidget
- Object
- AbstractWidget
- CustomWidget
- CWM::Tree
- Defined in:
- library/cwm/src/lib/cwm/tree.rb
Overview
A tree of nested TreeItems
Instance Attribute Summary
Attributes inherited from AbstractWidget
#handle_all_events, #widget_id
Instance Method Summary collapse
- #change_items(items) ⇒ Object
- #contents ⇒ Object
- #items ⇒ Enumerable<TreeItem>
-
#new_item(*args, **kwargs) ⇒ Object
An alias for TreeItem.new.
-
#value ⇒ Object
FIXME: CurrentBranch? item id uniqueness? TODO: extract value/value= to CurrentItemBasedWidget or declare: value_property :CurrentItem.
- #value=(val) ⇒ Object
Methods inherited from CustomWidget
#cwm_contents, #cwm_definition, #find_ids, #ids_in_contents
Methods inherited from AbstractWidget
#cleanup, #cwm_definition, #disable, #displayed?, #enable, #enabled?, #focus, #fun_ref, #handle, #help, #init, #label, #my_event?, #opt, #refresh_help, #store, #validate, widget_type=
Instance Method Details
#change_items(items) ⇒ Object
64 65 66 67 |
# File 'library/cwm/src/lib/cwm/tree.rb', line 64 def change_items(items) item_terms = items.map(&:ui_term) Yast::UI.ChangeWidget(Id(), :Items, item_terms) end |
#contents ⇒ Object
37 38 39 40 |
# File 'library/cwm/src/lib/cwm/tree.rb', line 37 def contents item_terms = items.map(&:ui_term) Tree(Id(), Opt(:notify), label, item_terms) end |
#items ⇒ Enumerable<TreeItem>
59 60 61 |
# File 'library/cwm/src/lib/cwm/tree.rb', line 59 def items [] end |
#new_item(*args, **kwargs) ⇒ Object
An alias for TreeItem.new
54 55 56 |
# File 'library/cwm/src/lib/cwm/tree.rb', line 54 def new_item(*args, **kwargs) TreeItem.new(*args, **kwargs) end |
#value ⇒ Object
FIXME: CurrentBranch? item id uniqueness? TODO: extract value/value= to CurrentItemBasedWidget or declare: value_property :CurrentItem
45 46 47 |
# File 'library/cwm/src/lib/cwm/tree.rb', line 45 def value Yast::UI.QueryWidget(Id(), :CurrentItem) end |
#value=(val) ⇒ Object
49 50 51 |
# File 'library/cwm/src/lib/cwm/tree.rb', line 49 def value=(val) Yast::UI.ChangeWidget(Id(), :CurrentItem, val) end |