@Nullable public IHCNode build () { if (m_aPrefixes.isEmpty () && m_aSuffixes.isEmpty ()) return m_aInput; final HCDiv aInputGroup = new HCDiv ().addClasses (CBootstrapCSS.INPUT_GROUP, m_eSize); for (final IHCNode aPrefix : m_aPrefixes) { if (aPrefix instanceof BootstrapButton) aInputGroup.addChild (new HCSpan ().addClass (CBootstrapCSS.INPUT_GROUP_BTN).addChild (aPrefix)); else aInputGroup.addChild (new HCSpan ().addClass (CBootstrapCSS.INPUT_GROUP_ADDON).addChild (aPrefix)); } aInputGroup.addChild (m_aInput); for (final IHCNode aSuffix : m_aSuffixes) { if (aSuffix instanceof BootstrapButton) aInputGroup.addChild (new HCSpan ().addClass (CBootstrapCSS.INPUT_GROUP_BTN).addChild (aSuffix)); else aInputGroup.addChild (new HCSpan ().addClass (CBootstrapCSS.INPUT_GROUP_ADDON).addChild (aSuffix)); } return aInputGroup; } }
@Override @Nonnull public HCSpan createUploadButton (@Nonnull final IWebPageExecutionContext aWPEC) { final Locale aDisplayLocale = aWPEC.getDisplayLocale (); return new HCSpan ().addClasses (CBootstrapCSS.BTN, EBootstrapButtonType.SUCCESS) .setRole (EHTMLRole.BUTTON) .addChild (EWebBasicsText.FILE_SELECT.getDisplayText (aDisplayLocale)); }
@Nonnull public IHCElement <?> getAsNode () { final HCSpan ret = new HCSpan (); ret.addClasses (CSS_CLASS_ICON_FAMFAM, this); return ret; }
@Nonnull public static HCSpan createIconStack (@Nonnull final IHCElement <?> aLargeIcon, @Nonnull final IHCElement <?> aSmallIcon) { final HCSpan ret = new HCSpan ().addClasses (CFontAwesomeCSS.FA_STACK, CFontAwesomeCSS.FA_LG); ret.addChild (aLargeIcon.addClass (CFontAwesomeCSS.FA_STACK_2X)); ret.addChild (aSmallIcon.addClass (CFontAwesomeCSS.FA_STACK_1X)); return ret; }
@Nonnull public HCNodeList build () { registerExternalResources (m_eLanguage); // Create control final BootstrapInputGroup aBIG = new BootstrapInputGroup (m_aEdit); for (final IHCNode aPrefix : m_aPrefixes) aBIG.addPrefix (aPrefix); for (final IHCNode aSuffix : m_aSuffixes) aBIG.addSuffix (aSuffix); if (m_bShowResetButton) aBIG.addSuffix (EBootstrapIcon.REMOVE.getAsNode ()); // It's either a div or an edit IHCElement <?> aCtrl = (IHCElement <?>) aBIG.build (); if (aCtrl == m_aEdit) { // No input group created - wrap in dummy span aCtrl = new HCSpan ().setID (m_sContainerID).addClass (CSS_CLASS_DATE).addChild (aCtrl); } else aCtrl.setID (m_sContainerID).addClass (CSS_CLASS_DATE); // Assemble return new HCNodeList ().addChild (aCtrl).addChild (new BootstrapDateTimePickerJS (this)); }
@Nonnull public static IHCNode createSimpleTooltip (@Nonnull final String sTitle) { final HCSpan aSpan = new HCSpan ().addChild (EBootstrapIcon.QUESTION_SIGN.getAsNode ()); final BootstrapTooltip aTooltip = new BootstrapTooltip (aSpan).setTitle (sTitle); return new HCNodeList ().addChild (aSpan).addChild (aTooltip); }
@Nullable public IHCElement <?> getIconAsNode () { return m_eIcon == null ? null : m_eIcon.getAsNode ().addClass (CBootstrapCSS.FORM_CONTROL_FEEDBACK); } }
@Nonnull public HCSpan getAsNode () { return applyToNode (new HCSpan ()); }
@Nonnull public BootstrapPagination addItemActive (@Nullable final String sContent) { if (StringHelper.hasText (sContent)) addItemActive (HCSpan.create (sContent)); return this; }
@Nonnull public static IHCNode createSimpleTooltip (@Nonnull final IHCNode aTitle) { final HCSpan aSpan = new HCSpan ().addChild (EBootstrapIcon.QUESTION_SIGN.getAsNode ()); final BootstrapTooltip aTooltip = new BootstrapTooltip (aSpan).setTitle (aTitle); return new HCNodeList ().addChild (aSpan).addChild (aTooltip); }
@Nonnull public IHCElement <?> getAsNode () { final HCSpan ret = new HCSpan (); ret.addClasses (CSS_CLASS_ICON_FAMFAM_FLAG, this); return ret; }
@Nonnull public BootstrapPagination addItemDisabled (@Nullable final String sContent) { if (StringHelper.hasText (sContent)) addItemDisabled (HCSpan.create (sContent)); return this; }
public BootstrapNavbar (@Nonnull final EBootstrapNavbarType eType, final boolean bCollapsible, @Nonnull final Locale aDisplayLocale) { addClasses (CBootstrapCSS.NAVBAR, CBootstrapCSS.NAVBAR_DEFAULT, eType); setRole (EHTMLRole.NAVIGATION); m_aContainer = addAndReturnChild (new BootstrapContainer ()); m_aHeader = m_aContainer.addAndReturnChild (new BootstrapNavbarHeader ()); // Create the main container m_aContent = m_aContainer.addAndReturnChild (new HCDiv ()); if (bCollapsible) { // Create a per-instance class for collapsing final String sCollapseTarget = "navbar" + GlobalIDFactory.getNewIntID (); // Responsive toggle final HCButton aToggle = m_aHeader.addAndReturnChild (new HCButton ()); aToggle.addClass (CBootstrapCSS.NAVBAR_TOGGLE); aToggle.setDataAttr ("toggle", "collapse"); aToggle.setDataAttr ("target", "#" + sCollapseTarget); aToggle.addChild (new HCSpan ().addClass (CBootstrapCSS.SR_ONLY) .addChild (EBootstrapText.TOOGLE_NAVIGATION.getDisplayText (aDisplayLocale))); aToggle.addChild (new HCSpan ().addClass (CBootstrapCSS.ICON_BAR)); aToggle.addChild (new HCSpan ().addClass (CBootstrapCSS.ICON_BAR)); aToggle.addChild (new HCSpan ().addClass (CBootstrapCSS.ICON_BAR)); m_aContent.addClasses (CBootstrapCSS.COLLAPSE, CBootstrapCSS.NAVBAR_COLLAPSE).setID (sCollapseTarget); } }
aRow.addCell (new HCSpan ().addChild (sProviderName).addClass (CSS_CLASS_NOWRAP)); aRow.addCell (aService.getType ()); aRow.addCell (aService.getAlgorithm ()); aRow.addCell (new HCSpan ().addChild (sProviderName).addClass (CSS_CLASS_NOWRAP)); aRow.addCell (aService.getType ()); aRow.addCell (aService.getAlgorithm ());