Class: Glimmer::SWT::EventListenerProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/glimmer/swt/event_listener_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element_proxy:, event:, dom_element:, selector:, listener:) ⇒ EventListenerProxy

Returns a new instance of EventListenerProxy.



6
7
8
9
10
11
12
13
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 6

def initialize(element_proxy:, event:, dom_element:, selector:, listener:)
  @element_proxy = element_proxy
  @event = event
  @dom_element = dom_element
  @selector = selector
  @listener = listener
  @original_event_listener = original_event_listener
end

Instance Attribute Details

#dom_elementObject (readonly)

Returns the value of attribute dom_element.



4
5
6
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 4

def dom_element
  @dom_element
end

#element_proxyObject (readonly)

Returns the value of attribute element_proxy.



4
5
6
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 4

def element_proxy
  @element_proxy
end

#eventObject (readonly)

Returns the value of attribute event.



4
5
6
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 4

def event
  @event
end

#listenerObject (readonly)

Returns the value of attribute listener.



4
5
6
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 4

def listener
  @listener
end

#original_event_listenerObject (readonly)

Returns the value of attribute original_event_listener.



4
5
6
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 4

def original_event_listener
  @original_event_listener
end

#selectorObject (readonly)

Returns the value of attribute selector.



4
5
6
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 4

def selector
  @selector
end

Instance Method Details

#registerObject Also known as: observe, reregister



15
16
17
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 15

def register
  @dom_element.on(@event, @delegate)
end

#unregisterObject Also known as: unobserve, deregister



21
22
23
# File 'lib/glimmer/swt/event_listener_proxy.rb', line 21

def unregister
  @dom_element.off(@event, @delegate)
end