Class: RSwing::Components::TextField

Inherits:
JTextField
  • Object
show all
Includes:
Component
Defined in:
lib/rswing/components/text_field.rb

Constant Summary

Constants included from Events::FocusEvents

Events::FocusEvents::FocusListener

Constants included from Events::PropertyChanged

Events::PropertyChanged::PropertyChangeListener

Constants included from Events::InputMethodEvents

Events::InputMethodEvents::InputMethodListener

Constants included from Events::HierarchyBoundsEvents

Events::HierarchyBoundsEvents::HierarchyBoundsListener

Constants included from Events::KeyEvents

Events::KeyEvents::KeyListener

Constants included from Events::MouseWheelEvents

Events::MouseWheelEvents::MouseWheelListener

Constants included from Events::MouseMotionEvents

Events::MouseMotionEvents::MouseMotionListener

Constants included from Events::MouseEvents

Events::MouseEvents::MouseListener

Constants included from Events::ComponentEvents

Events::ComponentEvents::ComponentListener

Instance Method Summary collapse

Methods included from Events::FocusEvents

event_mappings

Methods included from Events::InputMethodEvents

event_mappings

Methods included from Events::HierarchyBoundsEvents

event_mappings

Methods included from Events::KeyEvents

event_mappings

Methods included from Events::MouseMotionEvents

event_mappings

Methods included from Events::MouseEvents

event_mappings

Methods included from Events::ComponentEvents

event_mappings

Constructor Details

#initialize(options = {}) ⇒ TextField

Valid options are:

  1. :text => "text" (default: “”)

  2. :columns => 5 (default: 10)

  3. :doc => nil (default: nil)

  4. :font => nil (default nil)

  5. :visible => false (default: true)

  6. :editable => false (default: true)

  7. :belongs_to => container (default: nil)

  8. :name => :text_field (default: nil)



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/rswing/components/text_field.rb', line 36

def initialize(options = {})
  if(options.empty?)
    super()
  else
    if(doc = Options.value_for(options => :doc))
      super(doc, Options.value_for(options => :text), Options.value_for(options => :columns))
    else
      super(Options.value_for(options => :text), Options.value_for(options => :columns))
    end
  end
  
  Container.add_if_requested(self, options)
end