Class: Redcar::FilterCommand::FilterSpeedbar
- Inherits:
-
Speedbar
- Object
- Speedbar
- Redcar::FilterCommand::FilterSpeedbar
- Includes:
- Observable
- Defined in:
- lib/filter_command/filter_speedbar.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize ⇒ FilterSpeedbar
constructor
A new instance of FilterSpeedbar.
- #set_commands ⇒ Object
- #set_font ⇒ Object
Constructor Details
#initialize ⇒ FilterSpeedbar
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
#close ⇒ Object
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_commands ⇒ Object
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_font ⇒ Object
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..controller..first @command_widget.font = @font end |