Class: Redcar::FilterCommand::FilterSpeedbar

Inherits:
Speedbar
  • Object
show all
Includes:
Observable
Defined in:
lib/filter_command/filter_speedbar.rb

Instance Method Summary collapse

Constructor Details

#initializeFilterSpeedbar

Returns a new instance of FilterSpeedbar.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/filter_command/filter_speedbar.rb', line 7

def initialize
  win = Redcar.app.focussed_window
  if win and tab = win.focussed_notebook_tab and tab.is_a?(Redcar::EditTab)
    command.value = tab.edit_view.document.selected_text
    input = 'None'
  end
  set_commands
  input_type.items  = FilterCommand::Evaluator.input_types
  input_type.value  = input || FilterCommand::History.input_type
  output_type.items = FilterCommand::OutputFormat.formats.keys.sort
  output_type.value = FilterCommand::History.output_type
end

Instance Method Details

#closeObject



36
37
38
39
# File 'lib/filter_command/filter_speedbar.rb', line 36

def close
  @command_widget = nil
  @font.dispose if @font and not @font.disposed?
end

#set_commandsObject



20
21
22
23
# File 'lib/filter_command/filter_speedbar.rb', line 20

def set_commands
  command.items = FilterCommand::History.command_list[0..10]
  command.value = FilterCommand::History.command
end

#set_fontObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/filter_command/filter_speedbar.rb', line 25

def set_font
  @font = Swt::Graphics::Font.new(
    ApplicationSWT.display,
    EditView.font,
    EditView.font_size,
    Swt::SWT::NORMAL)
  win = Redcar.app.focussed_window
  @command_widget = win.speedbar.controller.focussable_widgets.first
  @command_widget.font = @font
end