Class OverlayAutoAddController<C extends Component>

java.lang.Object
com.vaadin.flow.component.shared.internal.OverlayAutoAddController<C>
Type Parameters:
C - Type of the component that uses this controller.
All Implemented Interfaces:
Serializable

public class OverlayAutoAddController<C extends Component> extends Object implements Serializable
An internal controller for automatically adding a component to the UI when it's opened. Not intended to be used publicly.
See Also:
  • Constructor Details

    • OverlayAutoAddController

      public OverlayAutoAddController(C component)
    • OverlayAutoAddController

      public OverlayAutoAddController(C component, SerializableSupplier<ModalityMode> modalityModeSupplier)
  • Method Details

    • add

      public void add()
      Adds the component to the UI if it is not already attached, regardless of the current opened state of the component. Allows components with custom opening logic, such as ContextMenu, to add themselves to the UI and reuse the automatic removal logic when the component is closed.
    • remove

      public void remove()
      Force remove the component from the UI in case it was auto-added. Can be used by components with custom closing logic. For example, Notification removes itself from the UI whenever it is detached.
    • setSkipOnNavigation

      public void setSkipOnNavigation(boolean skipOnNavigation)
      Sets whether to skip auto-adding when the UI navigates to a new view before the component is opened.
      Parameters:
      skipOnNavigation - whether to skip auto-adding on navigation