Class: JLDrill::RunCommandContext

Inherits:
Context::Context show all
Defined in:
lib/jldrill/contexts/RunCommandContext.rb

Defined Under Namespace

Classes: CommandView

Instance Attribute Summary

Attributes inherited from Context::Context

#mainView, #parent, #viewBridge

Instance Method Summary collapse

Methods inherited from Context::Context

#addView, #isEntered?, #onExit, #peekAtView, #setupViews

Constructor Details

#initialize(viewBridge) ⇒ RunCommandContext

Returns a new instance of RunCommandContext.



10
11
12
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 10

def initialize(viewBridge)
	super(viewBridge)
end

Instance Method Details

#aboutObject



136
137
138
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 136

def about
    @parent.showAbout
end

#ackObject



132
133
134
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 132

def ack
    @parent.showAcknowlegements
end

#addNewVocabularyObject



128
129
130
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 128

def addNewVocabulary
    @parent.addNewVocabulary
end

#appendFileObject



68
69
70
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 68

def appendFile
    @parent.appendFile
end

#checkObject



96
97
98
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 96

def check
    @parent.showAnswer
end

#correctObject



104
105
106
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 104

def correct
    @parent.correct
end

#createNewObject



150
151
152
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 150

def createNew
    @parent.createNew
end

#createViewsObject



25
26
27
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 25

def createViews
    		@mainView = @viewBridge.CommandView.new(self)
end

#deleteVocabObject



124
125
126
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 124

def deleteVocab
    @parent.deleteVocabulary
end

#destroyViewsObject



29
30
31
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 29

def destroyViews
    @mainView = nil
end

#drillObject



92
93
94
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 92

def drill
    @parent.drill
end

#editVocabObject



120
121
122
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 120

def editVocab
    @parent.editVocabulary
end

#enter(parent) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 33

def enter(parent)
    super(parent)
          if !@parent.nil?
              if !@parent.quiz.nil?
                  @parent.quiz.publisher.subscribe(self, "load")
              end
          end
end

#exitObject



42
43
44
45
46
47
48
49
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 42

def exit
          if !@parent.nil?
              if !@parent.quiz.nil?
                  @parent.quiz.publisher.unsubscribe(self, "load")
              end
          end
    super
end

#getReviewModeObject



144
145
146
147
148
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 144

def getReviewMode
    retVal = false
    retVal = @parent.quiz.options.reviewMode unless @parent.quiz.nil?
    retVal
end

#incorrectObject



100
101
102
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 100

def incorrect
    @parent.incorrect
end

#infoObject



84
85
86
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 84

def info
    @parent.showQuizInfo
end

#learnObject



154
155
156
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 154

def learn
    @parent.learn
end

#loadExamplesObject



76
77
78
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 76

def loadExamples
	@parent.loadExamples
end

#loadReferenceObject



72
73
74
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 72

def loadReference
    @parent.loadReference
end

#loadUpdated(quiz) ⇒ Object



51
52
53
54
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 51

def loadUpdated(quiz)
    # This will update the toolbar based on the options.
    @mainView.update
end

#openObject



64
65
66
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 64

def open
    @parent.open
end

#optionsObject



112
113
114
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 112

def options
    @parent.setOptions
end

#quitObject



80
81
82
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 80

def quit
    @parent.quit
end

#removeDupsObject



158
159
160
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 158

def removeDups
    @parent.removeDups
end

#resetQuizObject



116
117
118
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 116

def resetQuiz
    @parent.reset
end

#saveObject



56
57
58
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 56

def save
    @parent.save
end

#saveAsObject



60
61
62
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 60

def saveAs
    @parent.saveAs
end

#setReviewMode(bool) ⇒ Object



140
141
142
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 140

def setReviewMode(bool)
    @parent.setReviewMode(bool)
end

#statisticsObject



88
89
90
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 88

def statistics
    @parent.showStatistics
end

#vocabTableObject



108
109
110
# File 'lib/jldrill/contexts/RunCommandContext.rb', line 108

def vocabTable
    @parent.showAllVocabulary
end