Sha256: fc99239d099ceb7d76205d77c2f490a973c0149160818c16adc639c0a2b3bc62

Contents?: true

Size: 797 Bytes

Versions: 20

Compression:

Stored size: 797 Bytes

Contents

require 'omf-web/widget/abstract_widget'

module OMF::Web::Widget::Layout

  # Implements a layout which displays widgets in a 
  # horizontal layout which should wrap around.
  #
  class FlowLayout < OMF::Web::Widget::AbstractWidget
    
    def initialize(opts)
      super opts
      widgets = opts[:widgets]
      @widgets = widgets.collect {|w| OMF::Web::Widget.create_widget(w) }
    end

    def content()
      OMF::Web::Theme.require 'flow_renderer'
      OMF::Web::Theme::FlowRenderer.new(self, @widgets, @opts)
    end
      

    def collect_data_sources(ds_set)
      @widgets.each {|w| w.collect_data_sources(ds_set) }
      ds_set
    end
    
    def name
      @opts[:name] || "Unknown - Set :name property"
    end
    
    def layout?
      return true
    end
    

  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
omf_web-1.2.9 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.8 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.7 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.6 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.5 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.4 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.3 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.2 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.1 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.2.0 lib/omf-web/widget/layout/flow_layout.rb
omf_web-1.0.0 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9.9 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9.8 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9.7 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9.6 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9.5 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9.4 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9.3 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9.1 lib/omf-web/widget/layout/flow_layout.rb
omf_web-0.9 lib/omf-web/widget/layout/flow_layout.rb