Class TvmApplication

  • All Implemented Interfaces:
    UiApplication

    public abstract class TvmApplication
    extends Object
    implements UiApplication
    Base class for you main application to build your client with TeaVM.
    Example:
     public class MyTvmApp extends TvmApplication {
    
       protected void start() {
         MyApp myApp = new MyApp();
         myApp.run();
       }
    
       public static void main(String[] args) {
         new MyTvmApp().run();
       }
     }
     
    Since:
    1.0.0
    • Constructor Detail

      • TvmApplication

        public TvmApplication()
        The constructor.
    • Method Detail

      • getContextPath

        public static String getContextPath()
        Returns:
        the context path of this application. So if your application is running in the root context this should be "/" what is the default. Otherwise you can set the context path according to your app (e.g. "/my-cool-app/" or even "/my-cool-app/index.html").
      • setContextPath

        protected static void setContextPath​(String contextPath)
        Parameters:
        contextPath - new value of getContextPath().
      • isUseAnchor

        public static boolean isUseAnchor()
        Returns:
        true to use the anchor (the URL part starting with the hash sign '#') for state management and UiPlaces.
      • setUseAnchor

        public static void setUseAnchor​(boolean useAnchor)
        Parameters:
        useAnchor - new value of isUseAnchor().