Class: VER::Executor::ExLabel

Inherits:
Entry show all
Defined in:
lib/ver/executor/label.rb

Constant Summary collapse

COMPLETERS =
{
  'edit'         => :ExPath,
  'fuzzy'        => :ExFuzzyFileFinder,
  'grep'         => :ExGrep,
  'grep_buffers' => :ExGrepBuffers,
  'locate'       => :ExLocate,
  'method'       => :ExMethod,
  'open'         => :ExPath,
  'syntax'       => :ExSyntax,
  'theme'        => :ExTheme,
  'write'        => :ExWrite,
  'buffer'       => :ExBuffer,
}

Constants inherited from VER::Entry

VER::Entry::BACKWARD_WORD, VER::Entry::FORWARD_WORD

Instance Attribute Summary

Attributes inherited from Entry

#callback, #caller, #parent, #tabcount, #tree, #update_on_change, #ybar

Attributes included from Keymapped

#major_mode

Instance Method Summary collapse

Methods inherited from Entry

#accept_line, #after_update, #cancel, #completed=, #completion, #destroy, #initialize, #next_line, #on_delete, #on_insert, #prev_line, #speed_selection, #subset, #sync_value_with_tree_selection, #tree_selection_value, #update_items, #update_only

Methods included from Keymapped

#minor_mode, #minor_mode?

Methods inherited from VER::Entry

#accept_line, #beginning_of_history, #cursor=, #delete, #delete_motion, #end_of_history, #end_of_line, #error, #insert, #insert_selection, #insert_string, #insert_tab, #kill_end_of_line, #kill_motion, #kill_next_char, #kill_next_word, #kill_prev_char, #kill_prev_word, #message, #next_char, #next_history, #next_word, #prev_char, #prev_word, #previous_history, #quit, #sel_end_of_line, #sel_next_char, #sel_next_word, #sel_prev_char, #sel_prev_word, #sel_start_of_line, #start_of_line, #style, #transpose_chars, #value=, #virtual_movement

Constructor Details

This class inherits a constructor from VER::Executor::Entry

Instance Method Details

#action(name) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/ver/executor/label.rb', line 43

def action(name)
  completer_name = COMPLETERS.fetch(name)
  completer = Executor.const_get(completer_name)
  entry = callback.use_entry(completer)

  self.value = completer_name
  configure(state: :disabled, takefocus: false)

  entry.focus
  entry.update_only
rescue KeyError
end

#choices(name) ⇒ Object



39
40
41
# File 'lib/ver/executor/label.rb', line 39

def choices(name)
  subset(name, COMPLETERS.keys)
end

#setupObject



29
30
31
32
33
34
35
36
37
# File 'lib/ver/executor/label.rb', line 29

def setup
  tree.configure(
    show: [],
    columns: %w[ex],
    displaycolumns: %w[ex],
  )
  tree.heading('ex', text: 'Execution Method')
  update_only
end