Interface Window

All Superinterfaces:
ActionsHolder, Component, Component.BelongToFrame, Component.HasCaption, Component.HasDescription, Component.HasIcon, ComponentContainer, ExpandingLayout, Frame, HasComponents, HasMargin, HasSpacing, HasSubParts, OrderedContainer, SupportsExpandRatio
All Known Subinterfaces:
DialogWindow, RootWindow, TabWindow, WindowImplementation
All Known Implementing Classes:
DialogWindowImpl, RootWindowImpl, TabWindowImpl, WindowImpl

public interface Window extends Frame, Component.HasCaption, Component.HasIcon
Represents an independent window of application.
  • Field Details

  • Method Details

    • setCloseable

      void setCloseable(boolean closeable)
      Sets the closable status for the window.
      Parameters:
      closeable - closeable flag
    • isCloseable

      boolean isCloseable()
      Returns:
      true if the window can be closed by user with close button or keyboard shortcut
    • setMinWidth

      void setMinWidth(String minWidth)
      Sets minimum CSS width for window layout. Examples: "640px", "auto".
      Parameters:
      minWidth - minimum width
    • getMinWidth

      @Nullable String getMinWidth()
      Returns:
      previously set minimal CSS width or null
    • setMaxWidth

      void setMaxWidth(String maxWidth)
      Sets maximum CSS width for window layout. Examples: "640px", "100%".
      Parameters:
      maxWidth - maximum width
    • getMaxWidth

      @Nullable String getMaxWidth()
      Returns:
      previously set maximum CSS width or null
    • setMinHeight

      void setMinHeight(String minHeight)
      Sets minimum CSS height for window layout. Examples: "640px", "auto".
      Parameters:
      minHeight - minimum height
    • getMinHeight

      @Nullable String getMinHeight()
      Returns:
      previously set minimum CSS height or null
    • setMaxHeight

      void setMaxHeight(String maxHeight)
      Sets maximum CSS height for window layout. Examples: "640px", "100%".
      Parameters:
      maxHeight - maximum height
    • getMaxHeight

      @Nullable String getMaxHeight()
      Returns:
      previously set maximum CSS height or null
    • getFrameOwner

      Screen getFrameOwner()
      Specified by:
      getFrameOwner in interface Frame
      Returns:
      UI controller of the window
      See Also:
    • getContext

      WindowContext getContext()
      Specified by:
      getContext in interface Frame
      Returns:
      current window context
    • setFocusComponent

      void setFocusComponent(@Nullable String componentId)
      Sets a component to be focused after the screen is opened.
      Parameters:
      componentId - component's ID in XML. If null, then first focusable component will be focused
    • getFocusComponent

      @Nullable String getFocusComponent()
      Returns:
      an ID of the component which is set to be focused after the screen is opened
    • validate

      boolean validate(List<Validatable> fields)
      Checks validity by invoking validators on specified components which support them and show validation result notification.
      Specified by:
      validate in interface Frame
      Returns:
      true if the validation was successful, false if there were any problems
    • validateAll

      boolean validateAll()
      Checks validity by invoking validators on all components which support them and show validation result notification.
      Specified by:
      validateAll in interface Frame
      Returns:
      true if the validation was successful, false if there were any problems
    • addBeforeWindowCloseListener

      Subscription addBeforeWindowCloseListener(Consumer<Window.BeforeCloseEvent> listener)
      Registers a new before window close listener.
      Parameters:
      listener - the listener to register
      Returns:
      a registration object for removing an event listener added to a window