Class: Clevic::BooleanDelegate

Inherits:
Delegate show all
Defined in:
lib/clevic/swing/boolean_delegate.rb

Instance Attribute Summary

Attributes inherited from Delegate

#entity, #field, #parent

Instance Method Summary collapse

Methods inherited from Delegate

#attribute, #editorEvent, #entity_class, #full_edit, #initialize, #inspect, #is_combo?, #minimal_edit, #needs_pre_selection?, #show_message, #updateEditorGeometry

Methods included from FieldValuer

#attribute_value, #attribute_value=, #display_value, #edit_value, #edit_value=, #find_related, #raw_value, #text_value=, #tooltip, valuer, #valuer, #writer

Constructor Details

This class inherits a constructor from Clevic::Delegate

Instance Method Details

#editorObject



10
11
12
13
14
15
# File 'lib/clevic/swing/boolean_delegate.rb', line 10

def editor
  @editor ||= javax.swing.JCheckBox.new.tap do |e|
    # TODO this is common to all delegates
    e.horizontal_alignment = field.swing_alignment
  end
end

#init_component(cell_editor) ⇒ Object



6
7
8
# File 'lib/clevic/swing/boolean_delegate.rb', line 6

def init_component( cell_editor )
  editor.selected = attribute_value
end

#nativeObject



21
22
23
# File 'lib/clevic/swing/boolean_delegate.rb', line 21

def native
  java.lang.Boolean
end

#valueObject



17
18
19
# File 'lib/clevic/swing/boolean_delegate.rb', line 17

def value
  editor.selected
end