Skip to content

Commit

Permalink
changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed May 17, 2017
1 parent 24ac69c commit d1821d6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions library/cwm/src/lib/cwm/table.rb
Expand Up @@ -29,7 +29,7 @@ class Table < CustomWidget
# then in #init call #change_items method, so it will be filled when all widgets are at place
# and just filling its content.
#
# @example for table with two collumns
# @example for table with two columns
# def items
# [
# [:first_user, "Joe", "Doe"],
Expand All @@ -41,6 +41,8 @@ def items
end

# change list on fly with argument. Useful when content of widget is changed.
# @note items and change_items is consistent with ItemsSelection mixin, just format of
# items is different due to nature of Table content.
# @param items_list [Array<Array<Object>>] same format as {#items}
def change_items(items_list)
Yast::UI.ChangeWidget(Id(widget_id), :Items, format_items(items_list))
Expand All @@ -60,13 +62,13 @@ def value=(id)
Yast::UI.ChangeWidget(Id(widget_id), :SelectedItems, Array[id])
end

# modifies single cell
# Replaces content of single cell
# @param id [Object] id of row ( the first element in #items )
# @param collumn_number [Integer] index of cell in row. Index start with 0 for first cell.
# @param column_number [Integer] index of cell in row. Index start with 0 for first cell.
# @param cell_content [String, Yast::Term, Object] Content of cell. Support same stuff as #items
# @note more efficient for bigger tables then changing everything with #change_items
def modify_cell(id, collumn_number, cell_content)
Yast::UI.ChangeWidget(Id(widget_id), Cell(id, collumn_number), cell_content)
def change_cell(id, column_number, cell_content)
Yast::UI.ChangeWidget(Id(widget_id), Cell(id, column_number), cell_content)
end

# Resulting table as YUI term.
Expand Down

0 comments on commit d1821d6

Please sign in to comment.