Class: ActiveWindow::ActiveCompositeColumn

Inherits:
ActiveColumn show all
Defined in:
lib/active_window/active_column.rb

Overview

pack multiple columns into one

Constant Summary

Constants inherited from ActiveColumn

ActiveWindow::ActiveColumn::ClassesToSymbols

Instance Attribute Summary

Attributes inherited from ActiveColumn

#id, #name

Instance Method Summary collapse

Methods inherited from ActiveColumn

create, #data_class, #data_value, #hide!, #renderer, #virtual?, #visible?

Constructor Details

#initialize(name, opts = {}) ⇒ ActiveCompositeColumn

Returns a new instance of ActiveCompositeColumn.



199
200
201
202
203
# File 'lib/active_window/active_column.rb', line 199

def initialize(name, opts={})
  self.name = name
  @virtual = true
  @visible = true
end

Instance Method Details

#add(child_column, expand = true) ⇒ Object

Raises:

  • (ArgumentError)


207
208
209
210
211
212
213
# File 'lib/active_window/active_column.rb', line 207

def add(child_column, expand=true)
  raise ArgumentError, "give an ActiveColumn, not #{child_column.inspect}" unless child_column.is_a?(ActiveColumn)
  child_column.hide!
  rend = child_column.renderer
  column.pack_start(rend, expand)
  column.add_attribute(rend, child_column.attribute, child_column.id)
end

#viewObject



204
205
206
# File 'lib/active_window/active_column.rb', line 204

def view
  column
end