@Nonnull public BootstrapNavbar addButton (@Nonnull final EBootstrapNavbarPosition ePos, @Nonnull final IHCElement <?> aButton) { aButton.addClass (CBootstrapCSS.NAVBAR_BTN); return _addNode (ePos, aButton); }
public static void applyFormControlValidityState (@Nullable final Iterable <? extends IHCElement <?>> aCtrls, @Nullable final IErrorList aErrorList) { if (aCtrls != null && aErrorList != null) { final boolean bIsInvalid = aErrorList.containsAtLeastOneError (); for (final IHCElement <?> aCurCtrl : aCtrls) if (bIsInvalid) { // Required so that error text is shown aCurCtrl.addClass (CBootstrapCSS.IS_INVALID); } } }
public static void applyFormControlValidityState (@Nullable final IHCElement <?> aElement, @Nullable final IErrorList aErrorList) { ValueEnforcer.notNull (aElement, "Element"); if (aErrorList != null) if (aErrorList.containsAtLeastOneError ()) { // Required so that error text is shown aElement.addClass (CBootstrapCSS.IS_INVALID); } }
@Nonnull public static HCSpan createIconStack (@Nonnull final IHCElement <?> aLargeIcon, @Nonnull final IHCElement <?> aSmallIcon) { final HCSpan ret = new HCSpan ().addClasses (CFontAwesome5CSS.FA_STACK, CFontAwesome5CSS.FA_LG); ret.addChild (aLargeIcon.addClass (CFontAwesome5CSS.FA_STACK_2X)); ret.addChild (aSmallIcon.addClass (CFontAwesome5CSS.FA_STACK_1X)); return ret; }
@Nonnull public static HCSpan createIconStack (@Nonnull final IHCElement <?> aLargeIcon, @Nonnull final IHCElement <?> aSmallIcon) { final HCSpan ret = new HCSpan ().addClasses (CFontAwesome4CSS.FA_STACK, CFontAwesome4CSS.FA_LG); ret.addChild (aLargeIcon.addClass (CFontAwesome4CSS.FA_STACK_2X)); ret.addChild (aSmallIcon.addClass (CFontAwesome4CSS.FA_STACK_1X)); return ret; }
@Nonnull private BootstrapNavbar _addNode (@Nonnull final EBootstrapNavbarPosition ePos, @Nullable final IHCElement <?> aNode) { if (aNode != null) aNode.addClass (ePos); if (ePos.isFixed ()) m_aHeader.addChild (aNode); else m_aContent.addChild (aNode); return this; }
public static void makeFormControlStatic (@Nullable final IHCNode aNode) { if (aNode != null) { if (aNode instanceof IHCElement <?>) { if (!(aNode instanceof IHCControl <?>) && !(aNode instanceof IHCScript <?>)) ((IHCElement <?>) aNode).addClass (CBootstrapCSS.FORM_CONTROL_STATIC); } else { // Descend only in non-elements - e.g. HCNodeList aNode.forAllChildren (aChild -> makeFormControlStatic (aChild)); } } } }
public void applyTo (@Nonnull final IHCElement <?> aElement) { ValueEnforcer.notNull (aElement, "Element"); int nLastPartCount = -1; if (m_eXS != null) { aElement.addClass (m_eXS); nLastPartCount = m_eXS.getParts (); } // Apply only if different from the previous part count if (m_eSM != null && m_eSM.getParts () != nLastPartCount) { aElement.addClass (m_eSM); nLastPartCount = m_eSM.getParts (); } if (m_eMD != null && m_eMD.getParts () != nLastPartCount) { aElement.addClass (m_eMD); nLastPartCount = m_eMD.getParts (); } if (m_eLG != null && m_eLG.getParts () != nLastPartCount) { aElement.addClass (m_eLG); nLastPartCount = m_eLG.getParts (); } }
if (m_eXS != null) aElement.addClass (m_eXS); nLastPartCount = m_eXS.getParts (); aElement.addClass (m_eSM); nLastPartCount = m_eSM.getParts (); aElement.addClass (m_eMD); nLastPartCount = m_eMD.getParts (); aElement.addClass (m_eLG); nLastPartCount = m_eLG.getParts (); aElement.addClass (m_eXL); nLastPartCount = m_eXL.getParts ();
if (m_eXS != null && m_eXS.getParts () > 0) aElement.addClass (m_eXS.getCSSClassOffset ()); nLastPartCount = m_eXS.getParts (); aElement.addClass (m_eSM.getCSSClassOffset ()); nLastPartCount = m_eSM.getParts (); aElement.addClass (m_eMD.getCSSClassOffset ()); nLastPartCount = m_eMD.getParts (); aElement.addClass (m_eLG.getCSSClassOffset ()); nLastPartCount = m_eLG.getParts (); aElement.addClass (m_eXL.getCSSClassOffset ()); nLastPartCount = m_eXL.getParts ();
aHelpTextNode.addClass (CBootstrapCSS.SR_ONLY);