@Nonnull public final IMPLTYPE addColumn (@Nullable final IHCCol <?> aCol) { if (aCol != null) { if (m_aColGroup == null) m_aColGroup = new HCColGroup (); m_aColGroup.addColumn (aCol); } return thisAsT (); }
/** * Add a new column. * * @param aCol * the column to add * @return this */ @Nonnull public HCColGroup addColumn (@Nullable final IHCCol <?> aCol) { if (aCol != null) addChild (aCol); return this; }
/** * Add a new column. * * @param nIndex * The index where the column should be added * @param aCol * the column to add * @return this */ @Nonnull public HCColGroup addColumnAt (@Nonnegative final int nIndex, @Nullable final IHCCol <?> aCol) { if (aCol != null) addChildAt (nIndex, aCol); return this; }
@Nonnull public final IMPLTYPE addColumnAt (@Nonnegative final int nIndex, @Nullable final IHCCol <?> aCol) { if (aCol != null) { if (m_aColGroup == null) m_aColGroup = new HCColGroup (); m_aColGroup.addColumnAt (nIndex, aCol); } return thisAsT (); }
@Nonnull @ReturnsMutableCopy default ICommonsList <? extends IHCCol <?>> getAllColumns () { final HCColGroup aColGroup = getColGroup (); return aColGroup != null ? aColGroup.getAllColumns () : new CommonsArrayList<> (); }
@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); } }
if (getColGroup () != null && getColGroup ().hasColumns ()) aElement.appendChild (getColGroup ().convertToMicroNode (aConversionSettings));
@Nonnull public HCColGroup addColumns (@Nullable final Iterable <? extends IHCCol <?>> aCols) { if (aCols != null) for (final IHCCol <?> aCol : aCols) addColumn (aCol); return this; }
/** * @return The number of contained columns. Always ≥ 0. */ @Nonnegative public int getColumnCount () { return getChildCount (); }
/** * Get the column at the specified index * * @param nIndex * The index to retrieve the column from * @return <code>null</code> if no such column exists */ @Nullable public IHCCol <?> getColumnOfIndex (final int nIndex) { return getChildAtIndex (nIndex); }
/** * Add a new column. * * @param nIndex * The index where the column should be added * @param aCol * the column to add * @return this * @deprecated Use {@link #addColumnAt(int,IHCCol)} instead */ @Deprecated @Nonnull public HCColGroup addColumn (@Nonnegative final int nIndex, @Nullable final IHCCol <?> aCol) { return addColumnAt (nIndex, aCol); }
/** * @return A list of all contained columns. Never <code>null</code>. */ @Nonnull @ReturnsImmutableObject public ICommonsList <IHCCol <?>> getAllColumns () { return getAllChildren (); }
return new HCCol (); case COLGROUP: return new HCColGroup (); case COMMAND: return new HCCommand ();
for (final IHCCol <?> aCol : aColGroup.getAllColumns ())
@Nonnull public HCColGroup addColumns (@Nullable final IHCCol <?>... aCols) { if (aCols != null) for (final IHCCol <?> aCol : aCols) addColumn (aCol); return this; }
for (final IHCCol <?> aCol : aColGroup.getAllColumns ())
else if (aParent instanceof HCColGroup && aNode instanceof HCCol) ((HCColGroup) aParent).addChild ((HCCol) aNode); else if (aParent instanceof HCDL && aNode instanceof IHCDefinitionItem <?>)