Class: Context::View
Overview
This is the abstract view class
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #addView(view) ⇒ Object
-
#close ⇒ Object
Concrete classes should override this method.
-
#getWidget ⇒ Object
Concrete classes should override this method.
-
#initialize(context) ⇒ View
constructor
A new instance of View.
- #notifyKey(widget, key) ⇒ Object
-
#open ⇒ Object
Concrete classes should override this method.
- #removeView(view) ⇒ Object
Constructor Details
#initialize(context) ⇒ View
Returns a new instance of View.
6 7 8 |
# File 'lib/Context/View.rb', line 6 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/Context/View.rb', line 5 def context @context end |
Instance Method Details
#addView(view) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/Context/View.rb', line 10 def addView(view) myWidget = getWidget() if(myWidget != nil) newWidget = view.getWidget() if !newWidget.nil? myWidget.add(newWidget) newWidget.addedTo(myWidget) end end end |
#close ⇒ Object
Concrete classes should override this method
37 38 |
# File 'lib/Context/View.rb', line 37 def close end |
#getWidget ⇒ Object
Concrete classes should override this method
41 42 43 |
# File 'lib/Context/View.rb', line 41 def getWidget return nil end |
#notifyKey(widget, key) ⇒ Object
45 46 47 |
# File 'lib/Context/View.rb', line 45 def notifyKey(, key) @context.notifyKey(self, key) end |
#open ⇒ Object
Concrete classes should override this method
33 34 |
# File 'lib/Context/View.rb', line 33 def open end |
#removeView(view) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/Context/View.rb', line 21 def removeView(view) myWidget = getWidget() if(myWidget != nil) oldWidget = view.getWidget() if !oldWidget.nil? myWidget.remove(oldWidget) oldWidget.removedFrom(myWidget) end end end |