Class: JLDrill::SetOptionsContext::OptionsView
- Inherits:
-
Context::View
- Object
- Context::View
- JLDrill::SetOptionsContext::OptionsView
- Defined in:
- lib/jldrill/contexts/SetOptionsContext.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from Context::View
Instance Method Summary collapse
-
#destroy ⇒ Object
Destroy the options window.
-
#exit ⇒ Object
This is a convenience method for the tests so that they have something to catch rather than the exit() on the context.
-
#initialize(context) ⇒ OptionsView
constructor
A new instance of OptionsView.
-
#optionsSet=(bool) ⇒ Object
Indicate that the options have been modified or not.
-
#optionsSet? ⇒ Boolean
Returns true if the options have been modified.
-
#run ⇒ Object
Display the options dialog and get input from the user.
-
#setDictionaryFilename(filename) ⇒ Object
Update the UI with the filename of the dictionary.
-
#update(options) ⇒ Object
Update the UI with the options passed in.
Methods inherited from Context::View
#addView, #getWidget, #removeView, #removingViewFrom, #viewAddedTo
Constructor Details
#initialize(context) ⇒ OptionsView
Returns a new instance of OptionsView.
21 22 23 24 25 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 21 def initialize(context) super(context) @optionsSet = false @options = Options.new(nil) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
19 20 21 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 19 def @options end |
Instance Method Details
#destroy ⇒ Object
Destroy the options window
28 29 30 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 28 def destroy # Please define in the concrete class end |
#exit ⇒ Object
This is a convenience method for the tests so that they have something to catch rather than the exit() on the context.
62 63 64 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 62 def exit @context.exit end |
#optionsSet=(bool) ⇒ Object
Indicate that the options have been modified or not.
33 34 35 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 33 def (bool) @optionsSet = bool end |
#optionsSet? ⇒ Boolean
Returns true if the options have been modified
38 39 40 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 38 def return @optionsSet end |
#run ⇒ Object
Display the options dialog and get input from the user
54 55 56 57 58 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 54 def run # Please write the code for the concrete class and then # call super(). This will simply exit the context. exit end |
#setDictionaryFilename(filename) ⇒ Object
Update the UI with the filename of the dictionary
49 50 51 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 49 def setDictionaryFilename(filename) # Please override in the concrete class end |
#update(options) ⇒ Object
Update the UI with the options passed in
43 44 45 46 |
# File 'lib/jldrill/contexts/SetOptionsContext.rb', line 43 def update() @options.assign() # Call super() first and then write UI specific code end |