Skip to content

Commit

Permalink
#59: Added HtmlRenderer wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Kerola committed Jan 10, 2015
1 parent 0c8484a commit 3e1d604
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
14 changes: 14 additions & 0 deletions addon/src/main/scala/vaadin/scala/renderer/HtmlRenderer.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package vaadin.scala.renderer

import com.vaadin.ui.renderer.{ HtmlRenderer => VaadinHtmlRenderer }
import vaadin.scala.renderer.mixins.HtmlRendererMixin

package mixins {
trait HtmlRendererMixin extends AbstractRendererMixin
}

/**
* @see com.vaadin.ui.renderer.HtmlRenderer
* @author Henri Kerola / Vaadin
*/
class HtmlRenderer extends AbstractRenderer[String](new VaadinHtmlRenderer with HtmlRendererMixin)
14 changes: 13 additions & 1 deletion addon/src/test/scala/vaadin/scala/tests/GridTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.mockito.{ ArgumentCaptor, Mockito }
import vaadin.scala.mixins.GridMixin
import vaadin.scala._
import vaadin.scala.Grid.HeightMode
import vaadin.scala.renderer.TextRenderer
import vaadin.scala.renderer.{ HtmlRenderer, TextRenderer }

/**
*
Expand Down Expand Up @@ -158,11 +158,23 @@ class GridTests extends ScaladinTestSuite {
assert(column.renderer.isInstanceOf[TextRenderer])

val textRenderer = new TextRenderer
assert(textRenderer.p.isInstanceOf[com.vaadin.ui.renderer.TextRenderer])
column.renderer = textRenderer

assert(textRenderer == column.renderer)
}

test("Column.renderer") {
val column = grid.addColumn[String]("myColumn")

val htmlRenderer = new HtmlRenderer
assert(htmlRenderer.p.isInstanceOf[com.vaadin.ui.renderer.HtmlRenderer])

column.renderer = htmlRenderer

assert(htmlRenderer == column.renderer)
}

test("Column.converter") {
val column = grid.addColumn[java.lang.Boolean]("myColumn")

Expand Down

0 comments on commit 3e1d604

Please sign in to comment.