Class: JLDrill::GetFilenameContext
- Inherits:
-
Context::Context
- Object
- Context::Context
- JLDrill::GetFilenameContext
- Defined in:
- lib/jldrill/contexts/GetFilenameContext.rb
Defined Under Namespace
Classes: FilenameSelectorView
Constant Summary collapse
- OPEN =
0
- SAVE =
1
Instance Attribute Summary collapse
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Attributes inherited from Context::Context
#mainView, #parent, #viewBridge
Instance Method Summary collapse
- #createViews ⇒ Object
- #destroyViews ⇒ Object
- #enter(parent, type) ⇒ Object
-
#initialize(viewBridge) ⇒ GetFilenameContext
constructor
A new instance of GetFilenameContext.
Methods inherited from Context::Context
#addView, #exit, #isEntered?, #onExit, #peekAtView, #setupViews
Constructor Details
#initialize(viewBridge) ⇒ GetFilenameContext
Returns a new instance of GetFilenameContext.
16 17 18 19 20 |
# File 'lib/jldrill/contexts/GetFilenameContext.rb', line 16 def initialize(viewBridge) super(viewBridge) @filename = nil @directory = nil end |
Instance Attribute Details
#directory ⇒ Object
Returns the value of attribute directory.
13 14 15 |
# File 'lib/jldrill/contexts/GetFilenameContext.rb', line 13 def directory @directory end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
13 14 15 |
# File 'lib/jldrill/contexts/GetFilenameContext.rb', line 13 def filename @filename end |
Instance Method Details
#createViews ⇒ Object
43 44 45 |
# File 'lib/jldrill/contexts/GetFilenameContext.rb', line 43 def createViews @mainView = @viewBridge.FilenameSelectorView.new(self) end |
#destroyViews ⇒ Object
47 48 49 50 |
# File 'lib/jldrill/contexts/GetFilenameContext.rb', line 47 def destroyViews @mainView.destroy if !@mainView.nil? @mainView = nil end |
#enter(parent, type) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/jldrill/contexts/GetFilenameContext.rb', line 52 def enter(parent, type) super(parent) @mainView.directory = @directory @mainView.run(type) filename = @mainView.filename if !filename.nil? @filename = filename @directory = @mainView.directory end self.exit @filename end |