Sha256: 600a50c3d7ea1c264ece3e99ec804c162b3ede9ce0d7228b9ded20fd1bcb9952

Contents?: true

Size: 1.19 KB

Versions: 10

Compression:

Stored size: 1.19 KB

Contents

require 'clevic/field_valuer.rb'

module Clevic

# This has both a field and an entity, so it's a perfect candidate
# for including FieldValuer, which it does.
class Delegate
  include FieldValuer

  def initialize( field )
    super()
    @field = field
  end

  # This is the ORM entity instance for which this delegate
  # is editing a single field. It needs to be the entire entity
  # so we can set the edited field value on it.
  attr_accessor :entity

  # The parent widget of this delegate / this delegate's widget
  attr_accessor :parent

  # the Clevic::Field instance which this delegate edits.
  attr_reader :field

  def attribute
    field.attribute
  end

  def entity_class
    field.entity_class
  end

  # assume this is not a combo delegate. That will come later.
  def is_combo?
    false
  end

  # change the visual state of the editor to the biggest / most
  # space-consuming it can be. This grew out of combo boxes having
  # a drop-down that can show or hide.
  def full_edit
  end

  # change the visual state of the editor to the smallest / least
  # space-consuming it can be. This grew out of combo boxes having
  # a drop-down that can show or hide.
  def minimal_edit
  end
end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
clevic-0.14.6 lib/clevic/delegate.rb
clevic-0.14.5 lib/clevic/delegate.rb
clevic-0.14.4 lib/clevic/delegate.rb
clevic-0.14.3 lib/clevic/delegate.rb
clevic-0.14.2 lib/clevic/delegate.rb
clevic-0.14.1 lib/clevic/delegate.rb
clevic-0.14.0 lib/clevic/delegate.rb
clevic-0.13.0.b12 lib/clevic/delegate.rb
clevic-0.13.0.b11 lib/clevic/delegate.rb
clevic-0.13.0.b10 lib/clevic/delegate.rb