Class WindowManagerWrapper

  • All Implemented Interfaces:
    WindowManager

    public abstract class WindowManagerWrapper
    extends Object
    implements WindowManager

    A base class for wrapper implementations of the WindowManager interface.

    An instance of this class is initialized with a reference to a WindowManager object. All methods simply delegate to this object.

    This class is especially useful if a custom implementation of WindowManager is to be created based on an existing implementation. Then only the methods to be customized have to be implemented. All other methods can still delegate to the existing implementation.

    Version:
    $Id: WindowManagerWrapper.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • WindowManagerWrapper

        protected WindowManagerWrapper​(WindowManager wrapped)
        Creates a new instance of WindowManagerWrapper and initializes it with the wrapped WindowManager. Note: This method does not check whether the passed in WindowManager object is null because we do not want to enforce this restriction on all subclasses. The passed in wrapped window manager is stored in an internal field and can be accessed using the getWrappedWindowManager() method. If a subclass needs another mechanism to access the wrapped manager, it has to override the getWrappedWindowManager() method.
        Parameters:
        wrapped - the wrapped WindowManager
    • Method Detail

      • getWrappedWindowManager

        public WindowManager getWrappedWindowManager()
        Returns a reference to the wrapped WindowManager.
        Returns:
        the wrapped WindowManager
      • createFrame

        public Window createFrame​(WindowBuilderData builderData,
                                  WindowData data,
                                  Window wnd)
                           throws WindowBuilderException
        Creates a frame window (a main frame). Just delegates to the wrapped WindowManager object.
        Specified by:
        createFrame in interface WindowManager
        Parameters:
        builderData - the builder data object
        data - the data defining the window to create
        wnd - the window object; if null, a new window is to be created; otherwise this window object must be initialized
        Returns:
        the new window
        Throws:
        WindowBuilderException - if an error occurs
      • createInternalFrame

        public Window createInternalFrame​(WindowBuilderData builderData,
                                          WindowData data,
                                          Window wnd)
                                   throws WindowBuilderException
        Creates an internal frame window. Just delegates to the wrapped WindowManager object.
        Specified by:
        createInternalFrame in interface WindowManager
        Parameters:
        builderData - the builder data object
        data - the data defining the window to create
        wnd - the window object; if null, a new window is to be created; otherwise this window object must be initialized
        Returns:
        the new window
        Throws:
        WindowBuilderException - if an error occurs
      • createDialog

        public Window createDialog​(WindowBuilderData builderData,
                                   WindowData data,
                                   boolean modal,
                                   Window wnd)
                            throws WindowBuilderException
        Creates a modal or non modal dialog. Just delegates to the wrapped WindowManager object.
        Specified by:
        createDialog in interface WindowManager
        Parameters:
        builderData - the builder data object
        data - the data defining the window to create
        modal - the modal flag
        wnd - the window object; if null, a new window is to be created; otherwise this window object must be initialized
        Returns:
        the new window
        Throws:
        WindowBuilderException - if an error occurs