Changeset 6921 for lang/scala/sandbox
- Timestamp:
- 02/19/08 17:32:50 (9 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/scala/sandbox/src/jp/gr/java_conf/mizu/gui/GUIBuilder.scala
r6919 r6921 13 13 14 14 trait GUIBuilder { 15 val context :DynamicVariable[AnyRef] = new DynamicVariable[AnyRef](null) 15 private val _context :DynamicVariable[AnyRef] = new DynamicVariable[AnyRef](null) 16 def context :AnyRef = _context.value 17 def context_=(value :AnyRef) { _context.value = value } 18 def withContext(value :AnyRef)(thunk : => Unit) { 19 _context.withValue(value)(thunk) 20 } 16 21 def setProperty(target :AnyRef, property :Symbol, value :Any) { 17 22 invoke(target, "set" + property.name.capitalize, value) … … 21 26 } 22 27 def asContainer :Container = { 23 context .valuematch {28 context match { 24 29 case frame:JFrame => frame.getContentPane 25 30 case container:Container => container … … 32 37 case (property:Symbol, value:Any) => setProperty(frame, property, value) 33 38 } 34 context.withValue(frame)(thunk)39 withContext(frame)(thunk) 35 40 frame 36 41 } … … 55 60 asContainer.setLayout(layoutManager) 56 61 } 62 def pack { 63 context match { case frame:JFrame => frame.pack } 64 } 57 65 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)