Commits

Anonymous committed 68d6bc3

don't use anonymous classes - as these require reflection to invoke methods

Comments (0)

Files changed (2)

src/de/matthiasmann/twlscala/FileSelector.scala

 
     def fileFilter = getFileFilter
     def fileFilter_= (filter:FileFilter) { setFileFilter(filter) }
-    lazy val fileFilters = new {
-        def += (filter:FileFilter) { addFileFilter(filter); this }
-        def -= (filter:FileFilter) { removeFileFilter(filter); this }
-        def clear { removeAllFileFilters }
-    }
+    def fileFilters = new FileFilterHelper()
 
     def createJavaFileSystemModel { fileSystemModel = new JavaFileSystemModel }
     def FileFilter(name:String, f:(File)=>Boolean) = new FileFilter(name, new FileSystemModel.FileFilter {
             publish(FileSelectorCanceled(FileSelector.this))
         }
     })
+
+    class FileFilterHelper private[twlscala] () {
+        def += (filter:FileFilter) { addFileFilter(filter) }
+        def -= (filter:FileFilter) { removeFileFilter(filter) }
+        def ++= (xs:Iterable[FileFilter]) { xs foreach addFileFilter }
+        def clear { removeAllFileFilters }
+    }
 }

src/de/matthiasmann/twlscala/PropertySheet.scala

 class PropertySheet extends TWLPropertySheet with ThemeSupport {
     theme = "propertysheet"
     def properties = new PropertyList(getPropertyList)
-    def factories = new {
+    def factories = new FactoriesHelper()
+
+    class FactoriesHelper private[twlscala] () {
         def +=[T] (f:TWLPropertySheet.PropertyEditorFactory[T])(implicit m:Manifest[T]) {
             registerPropertyEditorFactory(m.erasure.asInstanceOf[Class[T]], f)
         }