Sha256: ef0aa8fa3910bad986eaf541d208478dd38fbda200b3d380a161c4c489ae97b9

Contents?: true

Size: 681 Bytes

Versions: 10

Compression:

Stored size: 681 Bytes

Contents

require 'clevic/swing/combo_delegate'

module Clevic

# Edit a relation from an id and display a list of relevant entries.
#
# attribute is the method to call on the row entity to retrieve the related object.
# 
# The ids of the model objects are stored in the item data
# and the item text is fetched from them using attribute_path.
class RelationalDelegate < ComboDelegate
  def initialize( field )
    super
  end

  # use the Clevic::ComboBox class because JCombobox is remarkably stupid
  # about far too many things.
  def combo_class
    ComboBox
  end

  # don't allow new values
  def restricted?
    true
  end
end

end

require 'clevic/delegates/relational_delegate.rb'

Version data entries

10 entries across 10 versions & 1 rubygems

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