Class: InitialFocusSettingWindowListener

Inherits:
WindowAdapter
  • Object
show all
Defined in:
lib/life_game_viewer/view/life_game_viewer_frame.rb

Overview

When added as a listener to a given window, will cause the passed component to own focus when the window first opens.

Instance Method Summary collapse

Constructor Details

#initialize(component_requesting_focus) ⇒ InitialFocusSettingWindowListener

Returns a new instance of InitialFocusSettingWindowListener.



212
213
214
215
# File 'lib/life_game_viewer/view/life_game_viewer_frame.rb', line 212

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

Instance Method Details

#windowOpened(event) ⇒ Object



217
218
219
# File 'lib/life_game_viewer/view/life_game_viewer_frame.rb', line 217

def windowOpened(event)
  @component_requesting_focus.requestFocus
end