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
An internal controller for automatically adding a component to the UI when
it's opened. Not intended to be used publicly.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOverlayAutoAddController(C component) OverlayAutoAddController(C component, SerializableSupplier<ModalityMode> modalityModeSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd()Adds the component to the UI if it is not already attached, regardless of the current opened state of the component.voidremove()Force remove the component from the UI in case it was auto-added.voidsetSkipOnNavigation(boolean skipOnNavigation) Sets whether to skip auto-adding when the UI navigates to a new view before the component is opened.
-
Constructor Details
-
OverlayAutoAddController
-
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.
-