Search code examples
gwthtml5-canvasdomino-ui

is there any way using gwt canvas in domino-ui other than HTMLCanvasElement


I have a big project using other UI which has a big portion of it using the GWT canvas and if I am thinking to use the domino-ui I prefer to keep the GWT canvas code.


Solution

  • Yes you can. Either you use elemental2 canvas, Or you use GWT canvas and wrap it as an element. you need to include this dependency

    <dependency>
        <groupId>org.jboss.gwt.elemento</groupId>
        <artifactId>elemento-widget</artifactId>
        <version>${use elemento version here}</version>
    </dependency>
    

    Then you can wrap a canvas as element using this

    Widgets.asElement(myGwtCanvas)
    

    And don't forget about the inheritance of this GWT module