Class BsModal

java.lang.Object
com.oorian.html.Element<BsModal>
com.oorian.html.HtmlElement<BsModal>
com.oorian.html.StyledElement<BsModal>
com.oorian.bootstrap.BootstrapComponent<BsModal>
com.oorian.bootstrap.interactive.BsModal

public class BsModal extends BootstrapComponent<BsModal>
Bootstrap modal component.

Usage:


 BsModal modal = new BsModal()
     .setTitle("Confirm Action")
     .setBody(content)
     .setSize(Size.LG)
     .setCentered(true)
     .setStaticBackdrop(true);
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new modal.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a button that triggers this modal.
    Gets the modal ID for trigger buttons.
    protected void
     
    setBody(com.oorian.html.Element content)
    Sets the modal body content.
    Sets the modal body text.
    setCentered(boolean centered)
    Sets whether the modal is vertically centered.
    setFade(boolean fade)
    Sets whether the modal has fade animation.
    setFooter(com.oorian.html.Element content)
    Sets the modal footer content.
    setFullscreen(boolean fullscreen)
    Sets the modal to fullscreen.
    Sets the modal to fullscreen below a breakpoint.
    setKeyboard(boolean keyboard)
    Sets whether ESC key closes the modal.
    setScrollable(boolean scrollable)
    Sets whether the modal body is scrollable.
    setSize(Size size)
    Sets the modal size.
    setStaticBackdrop(boolean staticBackdrop)
    Sets whether clicking backdrop closes the modal.
    Sets the modal title.

    Methods inherited from class com.oorian.html.StyledElement

    addClass, addStyle, addStyle, addStyleAttribute, deselect, getHtml, getStyle, hide, isDisplayed, onHidden, onHide, onShow, onShown, removeClass, select, setAlignContent, setAlignContent, setAlignItems, setAlignItems, setAlignSelf, setAlignSelf, setAnimation, setAnimationDelay, setAnimationDelay, setAnimationDelay, setAnimationDirection, setAnimationDirection, setAnimationDuration, setAnimationDuration, setAnimationDuration, setAnimationFillMode, setAnimationFillMode, setAnimationIterationCount, setAnimationIterationCount, setAnimationIterationCount, setAnimationName, setAnimationPlayState, setAnimationPlayState, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setBackfaceVisibility, setBackfaceVisibility, setBackground, setBackground, setBackgroundAttachment, setBackgroundAttachment, setBackgroundBlendMode, setBackgroundBlendMode, setBackgroundClip, setBackgroundClip, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundOrigin, setBackgroundOrigin, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundRepeat, setBackgroundRepeat, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottomColor, setBorderBottomColor, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomStyle, setBorderBottomStyle, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderImage, setBorderImage, setBorderImageOutset, setBorderImageRepeat, setBorderImageSlice, setBorderImageSource, setBorderImageWidth, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeftColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftStyle, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRightColor, setBorderRightColor, setBorderRightStyle, setBorderRightStyle, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderStyle, setBorderStyle, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTopColor, setBorderTopColor, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopStyle, setBorderTopStyle, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBottom, setBottom, setBottom, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxSizing, setBoxSizing, setBreakAfter, setBreakBefore, setBreakInside, setClass, setClear, setClear, setClip, setColGap, setColGap, setColor, setColor, setColumnCount, setColumnCount, setColumnFill, setColumnFill, setColumnGap, setColumnRule, setColumnRuleColor, setColumnRuleColor, setColumnRuleStyle, setColumnRuleStyle, setColumnRuleWidth, setColumnRuleWidth, setColumns, setColumns, setColumns, setColumnSpan, setColumnWidth, setColumnWidth, setColumnWidth, setCounterIncrement, setCounterReset, setCursor, setCursor, setDirection, setDirection, setDisabledClass, setDisabledStyle, setDisplay, setDisplay, setFilter, setFlex, setFlexBasis, setFlexDirection, setFlexDirection, setFlexFlow, setFlexGrow, setFlexGrow, setFlexShrink, setFlexShrink, setFlexWrap, setFlexWrap, setFloat, setFloat, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFontFace, setFontFamily, setFontFamily, setFontFeatureSettings, setFontKerning, setFontLanguageOverride, setFontSize, setFontSize, setFontSize, setFontSizeAdjust, setFontStretch, setFontStretch, setFontStyle, setFontStyle, setFontSynthesis, setFontVariant, setFontVariant, setFontVariantAlternates, setFontVariantCaps, setFontVariantEastAsian, setFontVariantLigatures, setFontVariantNumeric, setFontVariantPosition, setFontWeight, setFontWeight, setGap, setGap, setGap, setGap, setHangingPunctuation, setHangingPunctuation, setHeight, setHeight, setHeight, setHyphens, setImageOrientation, setImageRendering, setImageResolution, setImeMode, setJustifyContent, setJustifyContent, setKeyFrames, setLeft, setLeft, setLeft, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLineBreak, setLineHeight, setLineHeight, setLineHeight, setLineHeight, setMargin, setMargin, setMargin, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMarginTop, setMark, setMarkAfter, setMarkBefore, setMarks, setMarqueeDirection, setMarqueePlayCount, setMarqueeSpeed, setMarqueeStyle, setMask, setMaskType, setMaxHeight, setMaxHeight, setMaxHeight, setMaxHeightToWindowHeight, setMaxWidth, setMaxWidth, setMaxWidth, setMaxWidthToWindowWidth, setMinHeight, setMinHeight, setMinHeight, setMinHeightToWindowHeight, setMinWidth, setMinWidth, setMinWidth, setMinWidthToWindowWidth, setNavDown, setNavIndex, setNavIndex, setNavLeft, setNavRight, setNavUp, setNormalClass, setNormalStyle, setObjectFit, setObjectPosition, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateTo, setOnDblClick, setOnDblClickChange, setOpacity, setOpacity, setOrder, setOrder, setOrphans, setOutline, setOutline, setOutline, setOutline, setOutlineColor, setOutlineColor, setOutlineOffset, setOutlineOffset, setOutlineOffset, setOutlineStyle, setOutlineStyle, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOverClass, setOverflow, setOverflow, setOverflow, setOverflowWrap, setOverflowX, setOverflowX, setOverflowY, setOverflowY, setOverStyle, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPaddingTop, setPageBreakAfter, setPageBreakAfter, setPageBreakBefore, setPageBreakBefore, setPageBreakInside, setPageBreakInside, setPerspective, setPerspective, setPerspective, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPhonemes, setPosition, setPosition, setPosition, setPosition, setPosition, setPressedClass, setPressedStyle, setQuotes, setResize, setResize, setResizeToWindowHeight, setResizeToWindowHeight, setResizeToWindowWidth, setRest, setRestAfter, setRestBefore, setRight, setRight, setRight, setRowGap, setRowGap, setSelected, setSelectedClass, setSelectedStyle, setShow, setSize, setSize, setSize, setStyle, setStyle, setTabSize, setTabSize, setTabSize, setTabSize, setTextAlign, setTextAlign, setTextAlignLast, setTextAlignLast, setTextCombineUpright, setTextCombineWeight, setTextDecoration, setTextDecoration, setTextDecorationColor, setTextDecorationColor, setTextDecorationLine, setTextDecorationLine, setTextDecorationStyle, setTextDecorationStyle, setTextIndent, setTextIndent, setTextIndent, setTextIndent, setTextJustify, setTextJustify, setTextOrientation, setTextOverflow, setTextOverflow, setTextSelectDisabled, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextTransform, setTextTransform, setTextUnderlinePosition, setTop, setTop, setTop, setTransform, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformStyle, setTransformStyle, setTransition, setTransitionDelay, setTransitionDelay, setTransitionDelay, setTransitionDuration, setTransitionDuration, setTransitionDuration, setTransitionProperty, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setUnicodeBidi, setUnicodeBidi, setVerticalAlign, setVerticalAlign, setVisibility, setVisibility, setVoiceBalance, setVoiceDuration, setVoicePitch, setVoicePitchRange, setVoiceRate, setVoiceStress, setVoiceVolume, setWhiteSpace, setWhiteSpace, setWidows, setWidth, setWidth, setWidth, setWordBreak, setWordBreak, setWordSpacing, setWordSpacing, setWordSpacing, setWordSpacing, setWordWrap, setWordWrap, setWritingMode, setZIndex, setZIndex, show, updateStyle, updateStyle

    Methods inherited from class com.oorian.html.HtmlElement

    addLineBreak, addLineOfText, addLineOfText, addLineOfText, addParagraph, addSpacer, addText, addText, addText, addText, clearOnClick, disable, enable, isDisabled, isEnabled, onDisabled, onEnabled, setDisabled, setDraggable, setDropAllowed, setEnabled, setFocus, setOnBlur, setOnChange, setOnClick, setOnClickChange, setOnDocumentResize, setOnFocus, setOnKeyDown, setOnKeyPressed, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOutChangeClass, setOnMouseOutChangeStyle, setOnMouseOutChangeStyle, setOnMouseOver, setOnMouseOverChangeClass, setOnMouseOverChangeStyle, setOnMouseOverChangeStyle, setOnMouseOverShow, setOnMouseUp, setOnPageLoad, setOnResize, setOnWheel, setOnWindowResize, setText, setText, setText, setText, setTooltip

    Methods inherited from class com.oorian.html.Element

    addAttribute, addAttribute, addAttribute, addAttribute, addElement, addElements, assignId, click, containsElement, containsElement, create, dispatchEvent, dispatchEvent, dispatchEvent, dispatchEvent, equals, excludeId, executeJs, executeJs, executeJs, getActionId, getAllDescendants, getAncestor, getAttribute, getAttributes, getDescendantCount, getElement, getElementById, getElementCount, getElements, getElements, getElementsByTagName, getHtml, getId, getInnerHtml, getInnerHtml, getNextSibling, getPage, getParent, getPrevSibling, getTagName, getTextContent, getUrl, hasAttribute, hasElements, insertElement, isChildOf, isCreated, isDescendantOf, isDescendantOf, isInitialized, loadScript, loadScript, navigateBack, navigateForward, navigateTo, navigateToReferrer, onCallback, onCreated, onElementAdded, onElementRemoved, onInitialized, onJsReturn, onPageLoaded, onPageUnloaded, onRefresh, onRemovedFromPage, onUpdated, onUserEvent, openInNewWindow, openInNewWindow, prewrite, recreate, refresh, refresh, registerAddition, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerSubtraction, registerUpdate, removeAllElements, removeAttribute, removeAttribute, removeElement, removeElement, removeFromParent, requestCallback, requestCallback, requestCallback, requestCallback, resetId, scrollTo, scrollToBottom, scrollToTop, self, sendCommand, sendUpdate, setActionId, setAriaAtomic, setAriaBusy, setAriaChecked, setAriaCheckedMixed, setAriaControls, setAriaCurrent, setAriaDescribedBy, setAriaDisabled, setAriaErrorMessage, setAriaExpanded, setAriaHasPopup, setAriaHasPopup, setAriaHidden, setAriaInvalid, setAriaLabel, setAriaLabelledBy, setAriaLevel, setAriaLive, setAriaModal, setAriaOwns, setAriaPressed, setAriaRequired, setAriaSelected, setAriaValueRange, setAriaValueText, setComponent, setConsumeEvent, setElement, setElements, setId, setOnScroll, setOnScrollEnd, setPage, setParent, setRole, setRole, setTabIndex, setTagName, toString, unregisterListener, update, updateAttributes, write

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BsModal

      public BsModal()
      Creates a new modal.
  • Method Details

    • getModalId

      public String getModalId()
      Gets the modal ID for trigger buttons.
      Returns:
      The modal ID
    • setTitle

      public BsModal setTitle(String title)
      Sets the modal title.
      Overrides:
      setTitle in class com.oorian.html.Element<BsModal>
      Parameters:
      title - The title text
      Returns:
      This modal for method chaining
    • setBody

      public BsModal setBody(com.oorian.html.Element content)
      Sets the modal body content.
      Parameters:
      content - The body content element
      Returns:
      This modal for method chaining
    • setBodyText

      public BsModal setBodyText(String text)
      Sets the modal body text.
      Parameters:
      text - The body text
      Returns:
      This modal for method chaining
    • setFooter

      public BsModal setFooter(com.oorian.html.Element content)
      Sets the modal footer content.
      Parameters:
      content - The footer content element
      Returns:
      This modal for method chaining
    • setSize

      public BsModal setSize(Size size)
      Sets the modal size.
      Parameters:
      size - The size (SM, LG, XL)
      Returns:
      This modal for method chaining
    • setCentered

      public BsModal setCentered(boolean centered)
      Sets whether the modal is vertically centered.
      Parameters:
      centered - True for centered
      Returns:
      This modal for method chaining
    • setScrollable

      public BsModal setScrollable(boolean scrollable)
      Sets whether the modal body is scrollable.
      Parameters:
      scrollable - True for scrollable
      Returns:
      This modal for method chaining
    • setStaticBackdrop

      public BsModal setStaticBackdrop(boolean staticBackdrop)
      Sets whether clicking backdrop closes the modal.
      Parameters:
      staticBackdrop - True to prevent backdrop click close
      Returns:
      This modal for method chaining
    • setKeyboard

      public BsModal setKeyboard(boolean keyboard)
      Sets whether ESC key closes the modal.
      Parameters:
      keyboard - True to allow keyboard close
      Returns:
      This modal for method chaining
    • setFade

      public BsModal setFade(boolean fade)
      Sets whether the modal has fade animation.
      Parameters:
      fade - True for fade animation
      Returns:
      This modal for method chaining
    • setFullscreen

      public BsModal setFullscreen(boolean fullscreen)
      Sets the modal to fullscreen.
      Parameters:
      fullscreen - True for fullscreen
      Returns:
      This modal for method chaining
    • setFullscreenBelow

      public BsModal setFullscreenBelow(String breakpoint)
      Sets the modal to fullscreen below a breakpoint.
      Parameters:
      breakpoint - The breakpoint (sm, md, lg, xl, xxl)
      Returns:
      This modal for method chaining
    • createTriggerButton

      public BsButton createTriggerButton(String buttonText)
      Creates a button that triggers this modal.
      Parameters:
      buttonText - The button text
      Returns:
      A button configured to open this modal
    • initialize

      protected void initialize()
      Overrides:
      initialize in class BootstrapComponent<BsModal>