Class: Redcar::Declarations::OutlineViewDialog

Inherits:
FilterListDialog show all
Includes:
Model, Observable
Defined in:
plugins/declarations/lib/declarations/commands.rb

Constant Summary

Constant Summary

Constants included from Observable

Observable::ASPECTS

Instance Attribute Summary (collapse)

Attributes included from Model

#controller

Instance Method Summary (collapse)

Methods included from Observable

#add_listener, #notify_listeners, #remove_listener

Methods included from ReentryHelpers

#ignore, #ignore_changes

Methods inherited from FilterListDialog

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

Constructor Details

- (OutlineViewDialog) initialize(document)

A new instance of OutlineViewDialog



84
85
86
87
88
89
90
91
92
93
94
95
# File 'plugins/declarations/lib/declarations/commands.rb', line 84

def initialize(document)
  @document = document
  file = Declarations::File.new(@document.path)
  file.add_tags_for_paths(@document.path)
  @tags = file.tags
  @all = []
  @tags.each do |name, path, match|
    kind = Declarations.match_kind(path, match)
    @all << {:name => name, :icon => Declarations.icon_for_kind(kind), :path => path, :match => match}
  end
  super()
end

Instance Attribute Details

- (Object) document

Returns the value of attribute document



81
82
83
# File 'plugins/declarations/lib/declarations/commands.rb', line 81

def document
  @document
end

- (Object) last_list

Returns the value of attribute last_list



82
83
84
# File 'plugins/declarations/lib/declarations/commands.rb', line 82

def last_list
  @last_list
end

Instance Method Details

- (Object) selected(item, ix)



101
102
103
104
105
106
# File 'plugins/declarations/lib/declarations/commands.rb', line 101

def selected(item, ix)
  close
  Redcar.app.navigation_history.save(@document) if @document
  DocumentSearch::FindNextRegex.new(Regexp.new(Regexp.quote(item[:match])), true).run_in_focussed_tab_edit_view
  Redcar.app.navigation_history.save(@document) if @document
end

- (Object) update_list(filter)



97
98
99
# File 'plugins/declarations/lib/declarations/commands.rb', line 97

def update_list(filter)
  filter_and_rank_by(@all, filter) {|h| h[:name]}
end