Class: Watobo::Plugin::Crawler::Gui::FormFieldsTable

Inherits:
FXTable
  • Object
show all
Defined in:
plugins/crawler/gui/auth_frame.rb

Instance Method Summary collapse

Constructor Details

#initialize(owner, opts = {}) ⇒ FormFieldsTable

Returns a new instance of FormFieldsTable.



46
47
48
49
50
51
52
53
54
55
56
57
# File 'plugins/crawler/gui/auth_frame.rb', line 46

def initialize(owner, opts={})
  super(owner, opts)

  @event_dispatcher_listeners = Hash.new
  initTable()

  self.connect(SEL_COMMAND, method(:onTableClick))

  self.columnHeader.connect(SEL_COMMAND) do |sender, sel, index|
  # self.fitColumnsToContents(index)
  end
end

Instance Method Details

#add_field(field) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'plugins/crawler/gui/auth_frame.rb', line 59

def add_field(field)
  lastRowIndex = self.getNumRows
  self.appendRows(1)
  self.setItemData(lastRowIndex, 0, field)
  self.setItemText(lastRowIndex, 0, field.name)
  self.getItem(lastRowIndex, 0).justify = FXTableItem::LEFT
  self.setItemText(lastRowIndex, 1, field.type)
  puts field.methods.sort
  self.getItem(lastRowIndex, 1).justify = FXTableItem::LEFT
  self.setItemText(lastRowIndex, 2, field.value)
  self.getItem(lastRowIndex, 2).justify = FXTableItem::LEFT

end

#clear_fieldsObject



42
43
44
# File 'plugins/crawler/gui/auth_frame.rb', line 42

def clear_fields
  initTable
end

#clearEvents(event) ⇒ Object



32
33
34
# File 'plugins/crawler/gui/auth_frame.rb', line 32

def clearEvents(event)
  @event_dispatcher_listener[event].clear
end

#subscribe(event, &callback) ⇒ Object



28
29
30
# File 'plugins/crawler/gui/auth_frame.rb', line 28

def subscribe(event, &callback)
  (@event_dispatcher_listeners[event] ||= []) << callback
end

#update_fieldsObject



36
37
38
39
40
# File 'plugins/crawler/gui/auth_frame.rb', line 36

def update_fields
  self.getNumRows.times do |i|
    self.getItemData(i,0).value = self.getItemText(i,2)
  end
end