Class LegacyApplication

  • All Implemented Interfaces:
    ErrorHandler, Serializable

    @Deprecated
    public abstract class LegacyApplication
    extends Object
    implements ErrorHandler
    Deprecated.
    As of 7.0. This class is only intended to ease migration and should not be used for new projects.
    A special application designed to help migrating applications from Vaadin 6 to Vaadin 7. The legacy application supports setting a main window, adding additional browser level windows and defining the theme for the entire application.
    Since:
    7.0
    See Also:
    Serialized Form
    • Constructor Detail

      • LegacyApplication

        public LegacyApplication()
        Deprecated.
    • Method Detail

      • setMainWindow

        public void setMainWindow​(LegacyWindow mainWindow)
        Deprecated.
        Sets the main window of this application. Setting window as a main window of this application also adds the window to this application.
        Parameters:
        mainWindow - the UI to set as the default window
      • doInit

        public void doInit​(URL url)
        Deprecated.
      • init

        protected abstract void init()
        Deprecated.
      • getMainWindow

        public LegacyWindow getMainWindow()
        Deprecated.
        Gets the mainWindow of the application.

        The main window is the window attached to the application URL ( getURL()) and thus which is show by default to the user.

        Note that each application must have at least one main window.

        Returns:
        the UI used as the default window
      • setTheme

        public void setTheme​(String theme)
        Deprecated.
        Sets the application's theme.

        Note that this theme can be overridden for a specific UI with VaadinSession#getThemeForUI(UI). Setting theme to be null selects the default theme. For the available theme names, see the contents of the VAADIN/themes directory.

        Parameters:
        theme - the new theme for this application.
      • getTheme

        public String getTheme()
        Deprecated.
        Gets the application's theme. The application's theme is the default theme used by all the uIs for which a theme is not explicitly defined. If the application theme is not explicitly set, null is returned.
        Returns:
        the name of the application's theme.
      • getWindow

        public LegacyWindow getWindow​(String name)
        Deprecated.

        Gets a UI by name. Returns null if the application is not running or it does not contain a window corresponding to the name.

        Parameters:
        name - the name of the requested window
        Returns:
        a UI corresponding to the name, or null to use the default window
      • addWindow

        public void addWindow​(LegacyWindow uI)
        Deprecated.
        Adds a new browser level window to this application. Please note that UI doesn't have a name that is used in the URL - to add a named window you should instead use #addWindow(UI, String)
        Parameters:
        uI - the UI window to add to the application
        See Also:
        #addWindow(UI, String)
      • removeWindow

        public void removeWindow​(LegacyWindow uI)
        Deprecated.
        Removes the specified window from the application. This also removes all name mappings for the window (see and #getWindowName(UI).

        Note that removing window from the application does not close the browser window - the window is only removed from the server-side.

        Parameters:
        uI - the UI to remove
      • getWindows

        public Collection<LegacyWindow> getWindows()
        Deprecated.
        Gets the set of windows contained by the application.

        Note that the returned set of windows can not be modified.

        Returns:
        the unmodifiable collection of windows.
      • error

        public void error​(ErrorEvent event)
        Deprecated.
        Description copied from interface: ErrorHandler
        Invoked when an error occurs.
        Specified by:
        error in interface ErrorHandler
        Parameters:
        event - the fired event.
      • close

        public void close()
        Deprecated.
      • isRunning

        public boolean isRunning()
        Deprecated.
      • getURL

        public URL getURL()
        Deprecated.
      • getLogoutURL

        public String getLogoutURL()
        Deprecated.
        Returns the URL user is redirected to on application close. If the URL is null, the application is closed normally as defined by the application running environment.

        Desktop application just closes the application window and web-application redirects the browser to application main URL.

        Returns:
        the URL.
      • setLogoutURL

        public void setLogoutURL​(String logoutURL)
        Deprecated.
        Sets the URL user is redirected to on application close. If the URL is null, the application is closed normally as defined by the application running environment: Desktop application just closes the application window and web-application redirects the browser to application main URL.
        Parameters:
        logoutURL - the logoutURL to set.