Class: Glimmer::SWT::TableEditor
Overview
Emulates SWT’s native org.eclipse.swt.custom.TableEditor
Constant Summary
ControlEditor::ATTRIBUTES
Instance Attribute Summary
#composite, #editor
Instance Method Summary
collapse
#initialize
Instance Method Details
#cancel! ⇒ Object
51
52
53
|
# File 'lib/glimmer/swt/table_editor.rb', line 51
def cancel!
done!
end
|
#done! ⇒ Object
59
60
61
62
|
# File 'lib/glimmer/swt/table_editor.rb', line 59
def done!
@table_item.cell_dom_element(@table_column_index).html(@old_value) unless @old_value.nil?
@old_value = nil
end
|
#editor=(editor_widget, table_item, table_column_index) ⇒ Object
Also known as:
set_editor, setEditor
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/glimmer/swt/table_editor.rb', line 30
def editor=(editor_widget, table_item, table_column_index)
@table_item = table_item
@table_column_index = table_column_index
@editor_widget = editor_widget
@old_value = table_item.cell_dom_element(table_column_index).html
table_item.cell_dom_element(table_column_index).html('')
editor_widget.render(custom_parent_dom_element: table_item.cell_dom_element(table_column_index))
editor_widget.dom_element.css('width', "#{minimumWidth}%") editor_widget.dom_element.css('height', "#{minimumHeight}px")
editor_widget.dom_element.add_class('table-editor')
editor_widget.dom_element.focus
editor_widget.dom_element.select
end
|
#save! ⇒ Object
55
56
57
|
# File 'lib/glimmer/swt/table_editor.rb', line 55
def save!
done!
end
|