Skip to content

Instantly share code, notes, and snippets.

@LoganBarnett
Created October 1, 2008 21:11
Show Gist options
  • Save LoganBarnett/14194 to your computer and use it in GitHub Desktop.
Save LoganBarnett/14194 to your computer and use it in GitHub Desktop.
class CallView < ApplicationView
set_java_class 'call.CallFrame'
CONTRACT_TYPE_TRANSLATION = {nil => nil, '' => '', 'Current' => 'Current', 'current' => 'Current'}
#customer fields
map :view => "customer_name_combo_box.selected_item", :model => :customer_name, :ignoring => :action
map :view => "customer_name_combo_box.model", :transfer => :customer_names, :using => [:to_combo_box_model, nil]
map :view => "contact_name_text_field.text", :model => :contact_name
map :view => "address_text_field.text", :model => :street_address
map :view => "city_text_field.text", :model => :city
map :view => "state_combo_box.selected_item", :model => :state
map :view => "state_combo_box.model", :transfer => :states, :using => [:to_combo_box_model, nil]
map :view => "zip_text_field.text", :model => :zip_code
map :view => "phone_number_text_field.text", :model => :phone_number
def to_combo_box_model(items)
Java::javax::swing::DefaultComboBoxModel.new items.to_java(:string)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment