public boolean isLength () { return isRelativeLength () || this == ABSOLUTE_LENGTH; } }
/** * Check if the passed filename is a regular (not minified) CSS filename * * @param sFilename * The filename to check. * @return <code>true</code> if the passed filename is a regular CSS filename. */ public static boolean isRegularCSSFilename (@Nullable final String sFilename) { return isCSSFilename (sFilename) && !isMinifiedCSSFilename (sFilename); }
/** * @return The source location of this node. May be <code>null</code> if * neither begin token nor end token is present. */ @Nullable public CSSSourceLocation getSourceLocation () { final CSSSourceArea aFirstTokenArea = m_aFirstToken == null ? null : new CSSSourceArea (m_aFirstToken.beginLine, m_aFirstToken.beginColumn, m_aFirstToken.endLine, m_aFirstToken.endColumn); final CSSSourceArea aLastTokenArea = m_aLastToken == null ? null : new CSSSourceArea (m_aLastToken.beginLine, m_aLastToken.beginColumn, m_aLastToken.endLine, m_aLastToken.endColumn); if (aFirstTokenArea == null && aLastTokenArea == null) return null; return new CSSSourceLocation (aFirstTokenArea, aLastTokenArea); }
private void setLocation(ITree t, ICSSSourceLocationAware a) { CSSSourceLocation l = a.getSourceLocation(); int pos = lr.positionFor(l.getFirstTokenBeginLineNumber(), l.getFirstTokenBeginColumnNumber()); int end = lr.positionFor(l.getLastTokenEndLineNumber(), l.getLastTokenEndColumnNumber()); int length = end - pos + 1; t.setPos(pos + 1); t.setLength(length); }
/** * 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; }
public void checkVersionRequirements (@Nonnull final ICSSVersionAware aCSSObject) { final ECSSVersion eMinCSSVersion = aCSSObject.getMinimumCSSVersion (); if (m_eVersion.compareTo (eMinCSSVersion) < 0) throw new IllegalStateException ("This object cannot be serialized to CSS version " + m_eVersion.getVersion ().getAsString () + " but requires at least " + eMinCSSVersion.getVersion ().getAsString ()); }
/** * @return The location of the first token as a simple string. May be * <code>null</code>. */ @Nullable public String getFirstTokenLocationAsString () { return m_aFirstTokenArea == null ? null : m_aFirstTokenArea.getTokenLocationAsString (); }
/** * @return The line number where the first token begins (incl.). May be -1 if * not such token is available. */ @CheckForSigned public int getFirstTokenBeginLineNumber () { return m_aFirstTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aFirstTokenArea.getTokenBeginLineNumber (); }
/** * @return The column number where the first token begins (incl.). May be -1 * if not such token is available. */ @CheckForSigned public int getFirstTokenBeginColumnNumber () { return m_aFirstTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aFirstTokenArea.getTokenBeginColumnNumber (); }
/** * @return The column number where the first token ends (incl.). May be -1 if * not such token is available. */ @CheckForSigned public int getFirstTokenEndColumnNumber () { return m_aFirstTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aFirstTokenArea.getTokenEndColumnNumber (); }
/** * @return The line number where the fist token ends (incl.). May be -1 if not * such token is available. */ @CheckForSigned public int getLastTokenEndLineNumber () { return m_aLastTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aLastTokenArea.getTokenEndLineNumber (); }
/** * Get the contents of this object as a serialized CSS string for writing to * an output using the default writer settings. * * @return The content of this object as CSS string. Never <code>null</code>. * @see #getAsCSSString(ICSSWriterSettings, int) * @since 6.0.0 */ @Nonnull default String getAsCSSString () { return getAsCSSString (CSSWriterSettings.DEFAULT_SETTINGS); }
/** * 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; }
/** * @return The location of the last token as a simple string. May be * <code>null</code>. */ @Nullable public String getLastTokenLocationAsString () { return m_aLastTokenArea == null ? null : m_aLastTokenArea.getTokenLocationAsString (); }
/** * @return The line number where the last token begins (incl.). May be -1 if * not such token is available. */ @CheckForSigned public int getLastTokenBeginLineNumber () { return m_aLastTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aLastTokenArea.getTokenBeginLineNumber (); }
/** * @return The column number where the last token begins (incl.). May be -1 if * not such token is available. */ @CheckForSigned public int getLastTokenBeginColumnNumber () { return m_aLastTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aLastTokenArea.getTokenBeginColumnNumber (); }
/** * @return The column number where the last token ends (incl.). May be -1 if * not such token is available. */ @CheckForSigned public int getLastTokenEndColumnNumber () { return m_aLastTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aLastTokenArea.getTokenEndColumnNumber (); }
/** * @return The line number where the fist token ends (incl.). May be -1 if not * such token is available. */ @CheckForSigned public int getFirstTokenEndLineNumber () { return m_aFirstTokenArea == null ? CGlobal.ILLEGAL_UINT : m_aFirstTokenArea.getTokenEndLineNumber (); }
/** * Get the contents of this object as a serialized CSS string for writing to * an output. * * @param aSettings * The settings to be used to format the output. May not be * <code>null</code>. * @return The content of this object as CSS string. Never <code>null</code>. * @see #getAsCSSString(ICSSWriterSettings, int) * @since 5.0.4 */ @Nonnull default String getAsCSSString (@Nonnull final ICSSWriterSettings aSettings) { return getAsCSSString (aSettings, 0); }
@Nonnull public final THISTYPE setWidthPercentage (final double dPercentage) { m_sWidth = ECSSUnit.perc (dPercentage); return thisAsT (); }