/** * Add multiple cells, one for each passed element. * * @param aCellChildren * The list of elements for which new cells should be created. May be * <code>null</code>. * @return this (the table row) */ @Nonnull public HCRow addCells (@Nullable final IHCNode... aCellChildren) { if (aCellChildren != null) for (final IHCNode aCellChild : aCellChildren) addCell (aCellChild); return this; }
public void onCounter (@Nonnull final String sName, @Nonnull final IStatisticsHandlerCounter aHandler) { if (aHandler.getInvocationCount () > 0) aTableCounter.addBodyRow ().addCells (sName, "", Integer.toString (aHandler.getInvocationCount ()), Long.toString (aHandler.getCount ())); }
@Nonnull default IMPLTYPE addSpanningBodyContent (@Nullable final IHCNode aNode) { addBodyRow ().addAndReturnCell (aNode).setColspan (getColumnCount ()); return thisAsT (); }
public DataTablesServerDataRow (@Nonnull final HCRow aRow) { if (aRow.hasAnyStyle ()) LOGGER.warn ("Cell has styles assigned which will be lost: " + aRow.getAllStyles ()); m_sRowID = aRow.getID (); m_sRowClass = aRow.getAllClassesAsString (); for (final Map.Entry <IMicroQName, String> aEntry : aRow.customAttrs ().entrySet ()) { final IMicroQName aAttrName = aEntry.getKey (); if (CHTMLAttributes.isDataAttrName (aAttrName)) { // Data attribute if (m_aRowData == null) m_aRowData = new CommonsLinkedHashMap <> (); m_aRowData.put (aAttrName, aEntry.getValue ()); } else { // Custom non-data attribute if (m_aRowAttr == null) m_aRowAttr = new CommonsLinkedHashMap <> (); m_aRowAttr.put (aAttrName, aEntry.getValue ()); } } m_aCells = new CommonsArrayList <> (aRow.getCellCount ()); for (final IHCCell <?> aCell : aRow.getChildren ()) m_aCells.add (new DataTablesServerDataCell (aCell)); }
aTable.addHeaderRow ().addCells (EText.MSG_NAME.getDisplayText (aDisplayLocale), EText.MSG_VALUE.getDisplayText (aDisplayLocale)); for (final Map.Entry <String, ICommonsList <String>> aEntry : aRequestScope.headers () aTable.addBodyRow ().addCell (aEntry.getKey ()).addCell (HCExtHelper.list2divList (aEntry.getValue ())); aTable.addHeaderRow ().addCells (EText.MSG_NAME.getDisplayText (aDisplayLocale), EText.MSG_VALUE.getDisplayText (aDisplayLocale), EText.MSG_DETAILS.getDisplayText (aDisplayLocale)); aTable.addBodyRow ().addCell (aEntry.getKey ()).addCell (aCookie.getValue ()).addCell (sOther); aTable.addHeaderRow ().addCells (EText.MSG_NAME.getDisplayText (aDisplayLocale), EText.MSG_VALUE.getDisplayText (aDisplayLocale)); for (final Map.Entry <String, String> aEntry : RequestLogger.getRequestParameterMap (aHttpRequest).entrySet ()) aTable.addBodyRow ().addCell (aEntry.getKey ()).addCell (aEntry.getValue ()); aTable.addHeaderRow ().addCells (EText.MSG_NAME.getDisplayText (aDisplayLocale), EText.MSG_TYPE.getDisplayText (aDisplayLocale), EText.MSG_VALUE.getDisplayText (aDisplayLocale)); .addCell (aEntry.getKey ()) .addCell (ClassHelper.getClassLocalName (aEntry.getValue ())) .addCell (String.valueOf (aEntry.getValue ())); aTable.addHeaderRow ().addCells (EText.MSG_NAME.getDisplayText (aDisplayLocale), EText.MSG_VALUE.getDisplayText (aDisplayLocale)); for (final Map.Entry <String, String> aEntry : RequestLogger.getRequestFieldMap (aHttpRequest).entrySet ())
Integer.toString (GlobalIDFactory.getNewIntID ()); final HCRow aRow = new HCRow (); sIdentifierID, SUFFIX_SCHEME); aRow.addCell (new HCEdit (new RequestField (sFieldScheme, aExistingIdentifier == null ? null : aExistingIdentifier.getScheme ())) .setPlaceholder ("Identifier scheme"), sIdentifierID, SUFFIX_VALUE); aRow.addCell (new HCEdit (new RequestField (sFieldValue, aExistingIdentifier == null ? null : aExistingIdentifier.getValue ())) .setPlaceholder ("Identifier value"), SMPCommonUI.createStandaloneError (aFormErrors.getListOfField (sFieldValue), aDisplayLocale)); aRow.addCell (new BootstrapButton (EBootstrapButtonSize.MINI).setIcon (EDefaultIcon.DELETE) .setOnClick (JQuery.idRef (aRow).remove ()));
final int nDepth = getLevel (); final HCRow aRow = aTable.addBodyRow (); aRow.addCell (aNI.getName ()); final IHCCell <?> aCell = aRow.addAndReturnCell (aNI.getDisplayName ()); if (nDepth > 0) aCell.addStyle (CCSSProperties.PADDING_LEFT.newValue (ECSSUnit.em (nDepth))); aRow.addCell (aMAC == null ? "" : StringHelper.getHexEncoded (aMAC)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); aRow.addCell (EPhotonCoreText.getYesOrNo (aNI.isUp (), aDisplayLocale)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); aRow.addCell (EPhotonCoreText.getYesOrNo (aNI.isLoopback (), aDisplayLocale)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); aRow.addCell (EPhotonCoreText.getYesOrNo (aNI.isPointToPoint (), aDisplayLocale)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); aRow.addCell (EPhotonCoreText.getYesOrNo (aNI.supportsMulticast (), aDisplayLocale)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); {}
@Override protected void onFinalizeNodeState (@Nonnull final IHCConversionSettingsToNode aConversionSettings, @Nonnull final IHCHasChildrenMutable <?, ? super IHCNode> aTargetNode) { super.onFinalizeNodeState (aConversionSettings, aTargetNode); /* * bug fix for IE9 table layout bug * (http://msdn.microsoft.com/en-us/library/ms531161%28v=vs.85%29.aspx) IE9 * only interprets column widths if the first row does not use colspan (i.e. * at least one row does not use colspan) */ if (m_aColGroup != null && m_aColGroup.hasColumns () && hasBodyRows () && getFirstBodyRow ().isColspanUsed ()) { // Create a dummy row with explicit widths final HCRow aRow = new HCRow (false).addClass (CSS_FORCE_COLSPAN); for (final IHCCol <?> aCol : m_aColGroup.getAllColumns ()) { final IHCCell <?> aCell = aRow.addAndReturnCell (HCEntityNode.newNBSP ()); final int nWidth = StringParser.parseInt (aCol.getWidth (), -1); if (nWidth >= 0) aCell.addStyle (CCSSProperties.WIDTH.newValue (ECSSUnit.px (nWidth))); } addBodyRowAt (0, aRow); } }
/** * Add an empty cell at the specified index. * * @param nIndex * The index where the cell should be added * @return The created cell. Never <code>null</code>. * @deprecated Use {@link #addCellAt(int)} instead */ @Deprecated @Nonnull public IHCCell <?> addCell (@Nonnegative final int nIndex) { return addCellAt (nIndex); }
final int [] aRowRowSpans = new int [aBodyRow.getCellCount ()]; int nCellIndex = 0; boolean bRowHasRowSpans = false; for (final IHCCell <?> aCell : aBodyRow.getAllChildren ())
@Nonnull public final HCRow addRowAt (@Nonnegative final int nIndex) { final HCRow aRow = new HCRow (m_bHeaderOrFooter); addChildAt (nIndex, aRow); return aRow; }
nCells += aRow.getCellCount ();
/** * Add a single new cell and add the passed element. * * @param nIndex * The index where the cell should be added * @param aCellChild * The element to add. May be <code>null</code>. * @return The created cell. Never <code>null</code>. * @deprecated Use {@link #addAndReturnCellAt(int,IHCNode)} instead */ @Deprecated @Nonnull @CheckReturnValue public IHCCell <?> addAndReturnCell (@Nonnegative final int nIndex, @Nullable final IHCNode aCellChild) { return addAndReturnCellAt (nIndex, aCellChild); }
aTable.addHeaderRow ().addCells ("Scheme", "Value"); for (final SMPBusinessCardIdentifier aIdentifier : aEntity.identifiers ()) aTable.addBodyRow ().addCells (aIdentifier.getScheme (), aIdentifier.getValue ()); aForm2.addFormGroup (new BootstrapFormGroup ().setLabel ("Identifiers").setCtrl (aTable)); aTable.addHeaderRow ().addCells ("Type", "Name", "Phone number", "Email address"); for (final SMPBusinessCardContact aContact : aEntity.contacts ()) aBodyRow.addCells (aContact.getType (), aContact.getName (), aContact.getPhoneNumber ()); aBodyRow.addCell (HCA_MailTo.createLinkedEmail (aContact.getEmail ()));
Integer.toString (GlobalIDFactory.getNewIntID ()); final HCRow aRow = new HCRow (); : aExistingIdentifier.getScheme ())).setPlaceholder ("Identifier scheme"); aCtrl.addClass (CBootstrapCSS.FORM_CONTROL); aRow.addCell (aCtrl, BootstrapFormHelper.createDefaultErrorNode (aFormErrors.getListOfField (sFieldScheme), aDisplayLocale)); : aExistingIdentifier.getValue ())).setPlaceholder ("Identifier value"); aCtrl.addClass (CBootstrapCSS.FORM_CONTROL); aRow.addCell (aCtrl, BootstrapFormHelper.createDefaultErrorNode (aFormErrors.getListOfField (sFieldValue), aDisplayLocale)); aRow.addCell (new BootstrapButton (EBootstrapButtonSize.SMALL).setIcon (EDefaultIcon.DELETE) .setOnClick (JQuery.idRef (aRow).remove ()));
final int nDepth = getLevel (); final HCRow aRow = aTable.addBodyRow (); aRow.addCell (aNI.getName ()); final IHCCell <?> aCell = aRow.addAndReturnCell (aNI.getDisplayName ()); if (nDepth > 0) aCell.addStyle (CCSSProperties.PADDING_LEFT.newValue (ECSSUnit.em (nDepth))); aRow.addCell (aMAC == null ? "" : StringHelper.getHexEncoded (aMAC)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); aRow.addCell (EPhotonCoreText.getYesOrNo (aNI.isUp (), aDisplayLocale)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); aRow.addCell (EPhotonCoreText.getYesOrNo (aNI.isLoopback (), aDisplayLocale)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); aRow.addCell (EPhotonCoreText.getYesOrNo (aNI.isPointToPoint (), aDisplayLocale)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); aRow.addCell (EPhotonCoreText.getYesOrNo (aNI.supportsMulticast (), aDisplayLocale)); aRow.addCell (new HCEM ().addChild (EText.MSG_ERROR.getDisplayText (aDisplayLocale))); {}
/** * Add a single new cell and add the passed element. * * @param nIndex * The index where the cell should be added * @param aChild * The element to add. May be <code>null</code>. * @return this (the table row) * @deprecated Use {@link #addCellAt(int,IHCNode)} instead */ @Deprecated @Nonnull public HCRow addCell (@Nonnegative final int nIndex, @Nullable final IHCNode aChild) { return addCellAt (nIndex, aChild); }
@Nonnull public final HCRow addRow () { final HCRow aRow = new HCRow (m_bHeaderOrFooter); addChild (aRow); return aRow; }
/** * Add a single new cell and add the passed elements. * * @param nIndex * The index where the cell should be added * @param aCellChildren * The list of elements to add. May be <code>null</code>. * @return The created cell. Never <code>null</code>. * @deprecated Use {@link #addAndReturnCellAt(int,IHCNode...)} instead */ @Deprecated @Nonnull @CheckReturnValue public IHCCell <?> addAndReturnCell (@Nonnegative final int nIndex, @Nullable final IHCNode... aCellChildren) { return addAndReturnCellAt (nIndex, aCellChildren); }
/** * Add multiple cells, one for each passed element. * * @param aCellChildren * The list of elements for which new cells should be created. May be * <code>null</code>. * @return this (the table row) */ @Nonnull public HCRow addCells (@Nullable final Iterable <? extends IHCNode> aCellChildren) { if (aCellChildren != null) for (final IHCNode aCellChild : aCellChildren) addCell (aCellChild); return this; }