Sha256: 0dc6853d5c25260277b7a1197464b8a74c5c4f7a654b45aba86cd6b553b62564

Contents?: true

Size: 685 Bytes

Versions: 3

Compression:

Stored size: 685 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

3 entries across 3 versions & 1 rubygems

Version Path
clevic-0.13.0.b9 lib/clevic/swing/relational_delegate.rb
clevic-0.13.0.b6 lib/clevic/swing/relational_delegate.rb
clevic-0.13.0.b5 lib/clevic/swing/relational_delegate.rb