Class SJSeparator

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.Div
com.vaadin.swingbridge.surrogates.SJSeparator
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.html.Div>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasOrderedComponents, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasText, ComponentMixin, ContainerMixin, JComponentMixin, Serializable

public class SJSeparator extends com.vaadin.flow.component.html.Div implements JComponentMixin
Surrogate for JSeparator (SD_sjseparator) — a standalone visual divider on top of a Vaadin Div (same peer SJPanel / SJToolBar use).
  var form = new SJPanel();                    // BoxLayout(Y_AXIS)
  form.add(nameRow);
  form.add(new SJSeparator());                 // full-width Lumo hairline
  form.add(addressRow);

  var cols = new SJPanel();                     // horizontal row
  cols.add(left);
  cols.add(new SJSeparator(SwingConstants.VERTICAL)); // full-height bar
  cols.add(right);
A separator carries no interactive surface — no clicks, model, value, or event fan-out — so unlike SJButton / SJSlider there is nothing to bridge back to Swing listeners. Its one property is orientation, which drives the CSS in applyOrientationCss(): a 1px Lumo-toned bar that align-self:stretches to fill the cross axis of any flex parent (BoxLayout, FlowLayout, JToolBar row). A bare new SJSeparator() is therefore visible without the caller dialing in a preferred size.

Menu separators are drawn inline by the menu tree (SD_sjmenubar), and SJToolBar.addSeparator's bar by the toolbar itself (SD_sjtoolbar), so neither routes through here.

Cross-axis fill needs a flex parent

align-self:stretch fills the cross axis in flex layouts (BoxLayout, FlowLayout — the mixin's setLayout writes inline-flex). In a BorderLayout region the separator fills its region for the same reason; a GridBagLayout cell that isn't told to fill may render the bar at its 1px intrinsic size — an accepted R_layouts_close_enough cosmetic gap, not a structural one (the divider is still in the right place, just not stretched).
See Also:
  • Constructor Details

    • SJSeparator

      public SJSeparator()
    • SJSeparator

      public SJSeparator(int orientation)
  • Method Details

    • getOrientation

      public int getOrientation()
    • setOrientation

      public void setOrientation(int orientation)
      Sets HORIZONTAL / VERTICAL, repaints the bar, and fires "orientation" PCE on actual change.
      Throws:
      IllegalArgumentException - on any other value (matches JDK, R_match_swing_errors).
    • getUIClassID

      public String getUIClassID()
      Swing constant for L&F lookup; SeparatorUI isn't pluggable here.
      Specified by:
      getUIClassID in interface JComponentMixin
    • updateUI

      public void updateUI()
      L&F swap — no-op for us; Vaadin owns the DOM.
      Specified by:
      updateUI in interface JComponentMixin
    • setUI

      public void setUI(SeparatorUI ui)
      L&F surgery isn't modelled; WARN so integration gaps surface.
    • paramString

      protected String paramString()
      JDK JSeparator.paramString reports only orientation, already public.
    • getAccessibleContext

      public AccessibleContext getAccessibleContext()