Class: Redcar::EditView::ChangeLanguageCommand::ChangeLanguageDialog

Inherits:
FilterListDialog show all
Defined in:
plugins/edit_view/lib/edit_view/commands/change_language_command.rb

Constant Summary

Constant Summary

Constants included from Observable

Observable::ASPECTS

Instance Attribute Summary

Attributes included from Model

#controller

Instance Method Summary (collapse)

Methods inherited from FilterListDialog

#close, #filter_and_rank_by, #moved_to, #open, #step?, #step_time

Methods included from Observable

#add_listener, #notify_listeners, #remove_listener

Methods included from ReentryHelpers

#ignore, #ignore_changes

Constructor Details

- (ChangeLanguageDialog) initialize(tab)

A new instance of ChangeLanguageDialog



7
8
9
10
# File 'plugins/edit_view/lib/edit_view/commands/change_language_command.rb', line 7

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

Instance Method Details

- (Object) selected(name, ix)



19
20
21
22
# File 'plugins/edit_view/lib/edit_view/commands/change_language_command.rb', line 19

def selected(name, ix)
  @tab.edit_view.grammar = name
  close
end

- (Object) update_list(filter)



12
13
14
15
16
17
# File 'plugins/edit_view/lib/edit_view/commands/change_language_command.rb', line 12

def update_list(filter)
  bundles  = JavaMateView::Bundle.bundles.to_a
  grammars = bundles.map {|b| b.grammars.to_a}.flatten
  names    = grammars.map {|g| g.name}.sort_by {|name| name.downcase }
  filter_and_rank_by(names, filter)
end