/** * Set the width in percent relative to the parent object * * @param nWidth * The width in percent. Should be between 0 and 100 * @return this */ @Nonnull public final HCSWFObject setWidthPerc (final int nWidth) { m_sWidth = ECSSUnit.perc (nWidth); return this; }
@Override public boolean equals (final Object o) { if (o == this) return true; if (o == null || !getClass ().equals (o.getClass ())) return false; final CSSSimpleValueWithUnit rhs = (CSSSimpleValueWithUnit) o; return EqualsHelper.equals (m_aValue, rhs.m_aValue) && m_eUnit.equals (rhs.m_eUnit); }
/** * @param nValue * value to format * @return <code>value + "em"</code> */ @Nonnull @Nonempty public static String em (final int nValue) { return EM.format (nValue); }
@Override protected void onAfterContainer (@Nonnull final ISimpleWebExecutionContext aSWEC, @Nonnull final BootstrapContainer aContainer, @Nonnull final BootstrapRow aRow, @Nonnull final HCDiv aContentCol) { // Add the logo on top aContentCol.addChildAt (0, new HCDiv ().addStyle (CCSSProperties.MARGIN_TOP.newValue (ECSSUnit.em (1))) .addChild (SMPRendererPublic.createLogoBig (aSWEC))); // Add the version number in the login screen aContentCol.addChild (new HCDiv ().addStyle (CCSSProperties.MARGIN_TOP.newValue (ECSSUnit.em (1))) .addChild (new HCSmall ().addChild (CSMP.getApplicationTitleAndVersion ()))); } }
@Override public void customizeNode (@Nonnull final IHCHasChildrenMutable <?, ? super IHCNode> aParentElement, @Nonnull final IHCNode aNode, @Nonnull final EHTMLVersion eHTMLVersion) { if (aNode instanceof HCImg) { final HCImg aImg = (HCImg) aNode; final ScalableSize aExtent = aImg.getExtent (); // Workaround for IE if a CSS contains "width:auto" and/or "height:auto" // See e.g. https://github.com/twitter/bootstrap/issues/1899 if (aExtent != null) { aImg.addStyles (CCSSProperties.WIDTH.newValue (ECSSUnit.px (aExtent.getWidth ())), CCSSProperties.HEIGHT.newValue (ECSSUnit.px (aExtent.getHeight ()))); } } else if (aNode instanceof IHCControl <?>) { BootstrapHelper.markAsFormControl ((IHCControl <?>) aNode); } } }
public void onInternalError (@Nullable final Throwable t, @Nonnull final String sErrorID, @Nonnull final Locale aDisplayLocale) { m_aParentNode.addChild (new HCH1 ().addChild (EPhotonCoreText.INTERNAL_ERROR_TITLE.getDisplayText (aDisplayLocale))); m_aParentNode.addChild (new HCDiv ().addChildren (HCExtHelper.nl2brList (EPhotonCoreText.INTERNAL_ERROR_DESCRIPTION.getDisplayTextWithArgs (aDisplayLocale, sErrorID)))); // Show stack trace details if (GlobalDebug.isDebugMode () && t != null) { // Get error stack trace final String sStackTrace = StackTraceHelper.getStackAsString (t, false); final HCTextArea aStackTrace = new HCTextArea ("callstack").setValue (sStackTrace) .setRows (20) .addStyle (CCSSProperties.WIDTH.newValue (ECSSUnit.perc (98))) .addStyle (CCSSProperties.FONT_SIZE.newValue (ECSSUnit.pt (10))) .addStyle (CCSSProperties.FONT_FAMILY.newValue (CCSSValue.FONT_MONOSPACE)); m_aParentNode.addChild (aStackTrace); } } }
sRealValue = sRealValue.substring (0, sRealValue.length () - eUnit.getName ().length ()).trim (); final BigDecimal aValue = StringParser.parseBigDecimal (sRealValue); if (aValue != null)
final IHCCell <?> aCell = aRow.addAndReturnCell (aNI.getDisplayName ()); if (nDepth > 0) aCell.addStyle (CCSSProperties.PADDING_LEFT.newValue (ECSSUnit.em (nDepth)));
@Nonnull public static HCSpan createEmptyAction () { return new HCSpan ().addClass (CSS_CLASS_EMPTY_ACTION) .addStyle (CCSSProperties.DISPLAY_INLINE_BLOCK) .addStyle (CCSSProperties.WIDTH.newValue (ECSSUnit.px (16))); }
/** * @param nValue * value to format * @return <code>value + "px"</code> */ @Nonnull @Nonempty public static String px (final int nValue) { return PX.format (nValue); }
final IHCCell <?> aCell = aRow.addAndReturnCell (aNI.getDisplayName ()); if (nDepth > 0) aCell.addStyle (CCSSProperties.PADDING_LEFT.newValue (ECSSUnit.em (nDepth)));
/** * Set the height in percent relative to the parent object * * @param nHeight * The height in percent. Should be between 0 and 100 * @return this */ @Nonnull public final HCSWFObject setHeightPerc (final int nHeight) { m_sHeight = ECSSUnit.perc (nHeight); return this; }
@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); } }
/** * @param nValue * value to format * @return <code>value + "rem"</code> */ @Nonnull @Nonempty public static String rem (final int nValue) { return REM.format (nValue); }
final IHCCell <?> aCell = aRow.addAndReturnCell (aNI.getDisplayName ()); if (nDepth > 0) aCell.addStyle (CCSSProperties.PADDING_LEFT.newValue (ECSSUnit.em (nDepth)));
/** * Set the width in percent. * * @param dPerc * percentage width. * @return this */ @Nonnull default IMPLTYPE setWidthPerc (@Nonnegative final double dPerc) { return setWidth (ECSSUnit.perc (dPerc)); }
/** * @param nValue * value to format * @return <code>value + "vmax"</code> * @since 5.0.4 */ @Nonnull @Nonempty public static String vmax (final int nValue) { return VMAX.format (nValue); }
@Nonnull public final THISTYPE setWidthPercentage (final double dPercentage) { m_sWidth = ECSSUnit.perc (dPercentage); return thisAsT (); }
/** * @param aValue * Value to format. May not be <code>null</code>. * @return <code>value + "vmax"</code> * @since 5.0.4 */ @Nonnull @Nonempty public static String vmax (@Nonnull final BigDecimal aValue) { return VMAX.format (aValue); }
@Nonnull public final THISTYPE setHeightPercentage (final double dPercentage) { m_sHeight = ECSSUnit.perc (dPercentage); return thisAsT (); }