Class Container
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
- Direct Known Subclasses:
JComponent, Panel, ScrollPane, Window
-
Field Summary
Fields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidprotected voidvoidvoidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) protected voidaddSlotChild(Component comp, int index) Insertcompinto this container's component list and reparent it to this container without mirroring into the peer DOM and without notifying the layout manager.voidbooleanareFocusTraversalKeysSet(int id) intvoidDeprecated.voiddoLayout()findComponentAt(int x, int y) protected voidfireHierarchyEvent(int id, Component changed, Container changedParent, long flags) Fires aHierarchyEventon this component.floatfloatgetComponent(int n) getComponentAt(int x, int y) intintgetComponentZOrder(Component comp) getFocusTraversalKeys(int id) getMousePosition(boolean allowChildren) insets()voidbooleanbooleanbooleanisFocusCycleRoot(Container container) final booleanbooleanbooleanvoidlayout()voidlist(PrintStream out, int indent) voidlist(PrintWriter out, int indent) locate(int x, int y) voidvoidprotected Stringcom.vaadin.flow.dom.ElementPeer-side element that child peers get attached to, and that built-in LayoutManagers write container-wide CSS to per D_layout_css_on_content.voidvoidprotected voidprotected voidvoidremove(int index) voidvoidvoidvoidprotected voidremoveSlotChild(Component comp) Mirror ofaddSlotChild(Component, int)for removal.voidsetComponentZOrder(Component comp, int index) voidsetFocusCycleRoot(boolean focusCycleRoot) voidsetFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes) voidfinal voidsetFocusTraversalPolicyProvider(boolean provider) voidsetLayout(LayoutManager mgr) voidvoidvoidvalidate()protected voidMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, applyVisibleToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, fireComponentEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isThemeDefault, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, peerIs, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Constructor Details
-
Container
public Container() -
Container
protected Container(com.vaadin.flow.component.Component peer) -
Container
protected <P extends com.vaadin.flow.component.Component> Container(Class<P> peerType, Supplier<? extends P> peerFactory) The lazy form: seeComponent(Class, java.util.function.Supplier).
-
-
Method Details
-
peerContentElement
public com.vaadin.flow.dom.Element peerContentElement()Peer-side element that child peers get attached to, and that built-in LayoutManagers write container-wide CSS to per D_layout_css_on_content. Defaults to the container's own peer element; subclasses whose peer has internal structure (e.g. JFrame with a title-bar + content slot) override this to redirect children to the content slot. Index positions passed to addImpl apply within this element only.EHelper.applyContainerCss(Element, String, Map)gates LayoutManager writes on this element being a plain <div>; non-Div peers fall through toEHelper.onUnsupportedPeerShape(String, String).Visibility is
publicso cross-package layout managers (e.g.vaadinx.swing.BoxLayout, whose JDK package isjavax.swingnotjava.awt) can resolve the dispatch element. Same-package layouts (FlowLayout,BorderLayout) reach in identically. -
remove
-
remove
public void remove(int index) -
update
-
add
-
add
-
add
-
add
-
add
-
list
-
list
-
validate
-
print
-
paramString
- Overrides:
paramStringin classComponent
-
removeAll
public void removeAll() -
getComponent
-
invalidate
public void invalidate()- Overrides:
invalidatein classComponent
-
countComponents
public int countComponents() -
getComponents
-
insets
-
getInsets
-
addImpl
-
addSlotChild
Insertcompinto this container's component list and reparent it to this container without mirroring into the peer DOM and without notifying the layout manager. Mirror ofaddImpl(Component, Object, int)for slot-based containers whose peer manages its own child DOM (VaadinScroller.setContent,SplitLayout.setPrimary/Secondary, …) — the AWT-side bookkeeping (`components`, parent linkage, COMPONENT_ADDED + HIERARCHY_CHANGED) still needs to land sogetComponents()/getComponentCount()reflect the JDK tree shape per R_swing_is_truth. Without this seam, slot-based subclasses either skipcomponentsentirely (silent wrong tree shape) or callsuper.addImpland end up with phantom peer-DOM insertions fighting the slot setter. -
removeSlotChild
Mirror ofaddSlotChild(Component, int)for removal. Unlinkscompfromcomponents+ clears parent + fires AWT events, without touching the peer DOM. No-op ifcompisn't a child of this container. -
fireHierarchyEvent
Description copied from class:ComponentFires aHierarchyEventon this component. Container overrides to also recurse into descendants — AWT semantics for PARENT_CHANGED / DISPLAYABILITY_CHANGED / SHOWING_CHANGED, where the entire reparented subtree observes the change.- Overrides:
fireHierarchyEventin classComponent
-
getComponentZOrder
-
removeNotify
public void removeNotify()- Overrides:
removeNotifyin classComponent
-
isFocusCycleRoot
- Overrides:
isFocusCycleRootin classComponent
-
isFocusCycleRoot
public boolean isFocusCycleRoot() -
getFocusTraversalPolicy
-
getComponentCount
public int getComponentCount() -
addNotify
-
layout
-
isValidateRoot
public boolean isValidateRoot() -
validateTree
protected void validateTree() -
doLayout
-
preferredSize
- Overrides:
preferredSizein classComponent
-
minimumSize
- Overrides:
minimumSizein classComponent
-
getMaximumSize
- Overrides:
getMaximumSizein classComponent
-
getAlignmentX
public float getAlignmentX()- Overrides:
getAlignmentXin classComponent
-
getAlignmentY
public float getAlignmentY()- Overrides:
getAlignmentYin classComponent
-
paint
-
processContainerEvent
-
processEvent
- Overrides:
processEventin classComponent
-
getComponentAt
- Overrides:
getComponentAtin classComponent
-
getComponentAt
- Overrides:
getComponentAtin classComponent
-
deliverEvent
Deprecated.- Overrides:
deliverEventin classComponent
-
locate
-
findComponentAt
-
findComponentAt
-
isFocusTraversalPolicyProvider
public final boolean isFocusTraversalPolicyProvider() -
applyComponentOrientation
- Overrides:
applyComponentOrientationin classComponent
-
addPropertyChangeListener
- Overrides:
addPropertyChangeListenerin classComponent
-
addPropertyChangeListener
- Overrides:
addPropertyChangeListenerin classComponent
-
addContainerListener
-
getLayout
-
setComponentZOrder
-
setLayout
-
getPreferredSize
- Overrides:
getPreferredSizein classComponent
-
getMinimumSize
- Overrides:
getMinimumSizein classComponent
-
paintComponents
-
printComponents
-
removeContainerListener
-
getContainerListeners
-
getMousePosition
- Throws:
HeadlessException
-
isAncestorOf
-
setFocusTraversalKeys
- Overrides:
setFocusTraversalKeysin classComponent
-
getFocusTraversalKeys
- Overrides:
getFocusTraversalKeysin classComponent
-
areFocusTraversalKeysSet
public boolean areFocusTraversalKeysSet(int id) - Overrides:
areFocusTraversalKeysSetin classComponent
-
setFocusTraversalPolicy
-
isFocusTraversalPolicySet
public boolean isFocusTraversalPolicySet() -
setFocusCycleRoot
public void setFocusCycleRoot(boolean focusCycleRoot) -
setFocusTraversalPolicyProvider
public final void setFocusTraversalPolicyProvider(boolean provider) -
transferFocusDownCycle
public void transferFocusDownCycle()
-