Anonymous avatar Anonymous committed 5a079f4

simplify ThemeSuport using self types

Comments (0)

Files changed (1)


 import de.matthiasmann.twl.{Widget=>TWLWidget, Event=>TWLEvent}
-trait ThemeSupport extends TWLWidget {
+trait ThemeSupport extends TWLWidget { this:TWLWidget =>
     def theme = getTheme
     def theme_= (t:String) { setTheme(t) }
     def visible = isVisible
     lazy val contents = new WidgetContent(this)
     var actions:PartialFunction[Action, Boolean] = TWL.emptyActions
-    def getTheme:String
-    def setTheme(t:String)
-    def isVisible:Boolean
-    def setVisible(b:Boolean)
-    def isClip:Boolean
-    def setClip(b:Boolean)
-    def setCanAcceptKeyboardFocus(b:Boolean)
-    def getX:Int
-    def getY:Int
-    def getWidth:Int
-    def getHeight:Int
-    def getInnerWidth:Int
-    def getInnerHeight:Int
-    def getMinWidth:Int
-    def getMinHeight:Int
-    def getMaxWidth:Int
-    def getMaxHeight:Int
-    def setSize(w:Int, h:Int):Boolean
-    def setPosition(x:Int, y:Int):Boolean
-    def setInnerSize(w:Int, h:Int):Boolean
-    def setMinSize(w:Int, h:Int)
-    def setMaxSize(w:Int, h:Int)
-    def getPreferredWidth:Int
-    def getPreferredHeight:Int
-    def getTooltipContent:AnyRef
-    def setTooltipContent(t:AnyRef)
     protected override def handleKeyStrokeAction(action:String, event:TWLEvent):Boolean = {
         def invoke(action:Action) = actions.isDefinedAt(action) && actions(action)
         if((actions ne TWL.emptyActions) && (event.getType match {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.