Package com.oorian.css
Class ClassRule
java.lang.Object
com.oorian.css.CssElement
com.oorian.css.CssRule
com.oorian.css.ClassRule
- All Implemented Interfaces:
AnimationIntf<CssRule>,BackgroundIntf<CssRule>,com.oorian.css.BasicBoxIntf<CssRule>,com.oorian.css.BasicUserInterfaceIntf<CssRule>,BorderIntf<CssRule>,com.oorian.css.ColorIntf<CssRule>,CountersIntf<CssRule>,com.oorian.css.CssStyleIntf<CssRule>,com.oorian.css.FilterEffectsIntf<CssRule>,com.oorian.css.FlexibleBoxLayoutIntf<CssRule>,com.oorian.css.FontIntf<CssRule>,com.oorian.css.GeneratedContentForPagedMediaIntf<CssRule>,com.oorian.css.ImageValuesAndReplacedContentIntf<CssRule>,com.oorian.css.ListIntf<CssRule>,com.oorian.css.MarqueeIntf<CssRule>,com.oorian.css.MaskingIntf<CssRule>,com.oorian.css.MultiColumnLayoutIntf<CssRule>,PagedMediaIntf<CssRule>,com.oorian.css.SpeechIntf<CssRule>,com.oorian.css.TableIntf<CssRule>,com.oorian.css.TextDecorationIntf<CssRule>,com.oorian.css.TextIntf<CssRule>,com.oorian.css.TransformIntf<CssRule>,com.oorian.css.TransitionIntf<CssRule>,com.oorian.css.WritingModeIntf<CssRule>
Represents a CSS rule that targets elements by their class attribute.
ClassRule provides multiple ways to create class-based CSS selectors:
- By explicit class name string
- By Java Class object (converts package.ClassName to package-classname)
- By the rule's own class (for self-referencing component styles)
Example usage:
ClassRule buttonStyle = new ClassRule("btn-primary");
buttonStyle.setBackgroundColor(Color.BLUE);
buttonStyle.setColor(Color.WHITE);
// Generates: .btn-primary { background-color: blue; color: white; }
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a class rule using this object's own class name.Constructs a class rule using a Java Class object's canonical name.Constructs a class rule using a Java Class object's canonical name with a suffix.Constructs a class rule targeting elements with the specified CSS class. -
Method Summary
Methods inherited from class com.oorian.css.CssRule
addAdjacentSibling, addChild, addDescendant, addGeneralSibling, addPseudoElement, addSelector, addSelector, addStyleAttribute, addStyleAttribute, getFullSelectors, getSelectors, getStyle, setActiveStyle, setActiveStyle, setAfterStyle, setAfterStyle, setAlignContent, setAlignContent, setAlignItems, setAlignItems, setAlignSelf, setAlignSelf, setAnimation, setAnimationDelay, setAnimationDelay, setAnimationDelay, setAnimationDirection, setAnimationDirection, setAnimationDuration, setAnimationDuration, setAnimationDuration, setAnimationFillMode, setAnimationFillMode, setAnimationIterationCount, setAnimationIterationCount, setAnimationIterationCount, setAnimationName, setAnimationPlayState, setAnimationPlayState, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setBackdropFilter, setBackdropFilter, setBackfaceVisibility, setBackfaceVisibility, setBackground, setBackground, setBackgroundAttachment, setBackgroundAttachment, setBackgroundBlendMode, setBackgroundBlendMode, setBackgroundClip, setBackgroundClip, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBackgroundOrigin, setBackgroundOrigin, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundRepeat, setBackgroundRepeat, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBeforeStyle, setBeforeStyle, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottomColor, setBorderBottomColor, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomStyle, setBorderBottomStyle, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderCollapse, setBorderCollapse, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderImage, setBorderImage, setBorderImageOutset, setBorderImageRepeat, setBorderImageSlice, setBorderImageSource, setBorderImageWidth, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeftColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftStyle, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRightColor, setBorderRightColor, setBorderRightStyle, setBorderRightStyle, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderSpacing, setBorderSpacing, setBorderSpacing, setBorderSpacing, setBorderSpacing, setBorderSpacing, setBorderStyle, setBorderStyle, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTopColor, setBorderTopColor, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopStyle, setBorderTopStyle, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBottom, setBottom, setBottom, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxSizing, setBoxSizing, setBreakAfter, setBreakBefore, setBreakInside, setCaptionSide, setCaptionSide, setCheckedStyle, setCheckedStyle, setClear, setClear, setClip, setClipPath, setClipPath, setColGap, setColGap, setColor, setColor, setColumnCount, setColumnCount, setColumnFill, setColumnFill, setColumnGap, setColumnRule, setColumnRuleColor, setColumnRuleColor, setColumnRuleStyle, setColumnRuleStyle, setColumnRuleWidth, setColumnRuleWidth, setColumns, setColumns, setColumns, setColumnSpan, setColumnWidth, setColumnWidth, setColumnWidth, setCounterIncrement, setCounterReset, setCursor, setCursor, setDirection, setDirection, setDisabledStyle, setDisabledStyle, setDisplay, setDisplay, setEmptyCells, setEmptyCells, setEmptyStyle, setEmptyStyle, setEnabledStyle, setEnabledStyle, setFilter, setFilter, setFirstChildStyle, setFirstChildStyle, setFirstLetterStyle, setFirstLetterStyle, setFirstLineStyle, setFirstLineStyle, setFirstOfTypeStyle, setFirstOfTypeStyle, setFlex, setFlexBasis, setFlexDirection, setFlexDirection, setFlexFlow, setFlexGrow, setFlexGrow, setFlexShrink, setFlexShrink, setFlexWrap, setFlexWrap, setFloat, setFloat, setFocusStyle, setFocusStyle, setFocusVisibleStyle, setFocusVisibleStyle, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFontFace, setFontFamily, setFontFamily, setFontFeatureSettings, setFontKerning, setFontLanguageOverride, setFontSize, setFontSize, setFontSize, setFontSizeAdjust, setFontStretch, setFontStretch, setFontStyle, setFontStyle, setFontSynthesis, setFontVariant, setFontVariant, setFontVariantAlternates, setFontVariantCaps, setFontVariantEastAsian, setFontVariantLigatures, setFontVariantNumeric, setFontVariantPosition, setFontWeight, setFontWeight, setGap, setGap, setGap, setGap, setHangingPunctuation, setHangingPunctuation, setHeight, setHeight, setHeight, setHoverStyle, setHoverStyle, setHyphens, setImageOrientation, setImageRendering, setImageResolution, setImeMode, setInRangeStyle, setInRangeStyle, setInvalidStyle, setInvalidStyle, setJustifyContent, setJustifyContent, setKeyFrames, setLastChildStyle, setLastChildStyle, setLastOfTypeStyle, setLastOfTypeStyle, setLeft, setLeft, setLeft, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLineBreak, setLineHeight, setLineHeight, setLineHeight, setLineHeight, setLinkStyle, setLinkStyle, setListStyle, setListStyleImage, setListStylePosition, setListStylePosition, setListStyleType, setListStyleType, setMargin, setMargin, setMargin, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMarginTop, setMark, setMarkAfter, setMarkBefore, setMarkerStyle, setMarkerStyle, setMarks, setMarqueeDirection, setMarqueePlayCount, setMarqueeSpeed, setMarqueeStyle, setMask, setMaskType, setMaxHeight, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setMinWidth, setNavDown, setNavIndex, setNavIndex, setNavLeft, setNavRight, setNavUp, setNthChild, setNthChild, setObjectFit, setObjectPosition, setOnlyChildStyle, setOnlyChildStyle, setOnlyOfTypeStyle, setOnlyOfTypeStyle, setOpacity, setOpacity, setOptionalStyle, setOptionalStyle, setOrder, setOrder, setOrphans, setOutline, setOutline, setOutline, setOutline, setOutlineColor, setOutlineColor, setOutlineOffset, setOutlineOffset, setOutlineOffset, setOutlineStyle, setOutlineStyle, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOutOfRangeStyle, setOutOfRangeStyle, setOverflow, setOverflow, setOverflow, setOverflowWrap, setOverflowX, setOverflowX, setOverflowY, setOverflowY, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPaddingTop, setPageBreakAfter, setPageBreakAfter, setPageBreakBefore, setPageBreakBefore, setPageBreakInside, setPageBreakInside, setParentSelector, setPerspective, setPerspective, setPerspective, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPhonemes, setPosition, setPosition, setPosition, setPosition, setPosition, setQuotes, setReadOnlyStyle, setReadOnlyStyle, setReadWriteStyle, setReadWriteStyle, setRequiredStyle, setRequiredStyle, setResize, setResize, setRest, setRestAfter, setRestBefore, setRight, setRight, setRight, setRootStyle, setRootStyle, setRowGap, setRowGap, setSelectionStyle, setSelectionStyle, setSize, setSize, setSize, setStyle, setStyle, setTableLayout, setTableLayout, setTabSize, setTabSize, setTabSize, setTabSize, setTargetStyle, setTargetStyle, setTextAlign, setTextAlign, setTextAlignLast, setTextAlignLast, setTextCombineUpright, setTextCombineWeight, setTextDecoration, setTextDecoration, setTextDecorationColor, setTextDecorationColor, setTextDecorationLine, setTextDecorationLine, setTextDecorationStyle, setTextDecorationStyle, setTextIndent, setTextIndent, setTextIndent, setTextIndent, setTextJustify, setTextJustify, setTextOrientation, setTextOverflow, setTextOverflow, setTextSelectDisabled, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextTransform, setTextTransform, setTextUnderlinePosition, setTop, setTop, setTop, setTransform, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformStyle, setTransformStyle, setTransition, setTransitionDelay, setTransitionDelay, setTransitionDelay, setTransitionDuration, setTransitionDuration, setTransitionDuration, setTransitionProperty, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setUnicodeBidi, setUnicodeBidi, setValidStyle, setValidStyle, setVerticalAlign, setVerticalAlign, setVisibility, setVisibility, setVisitedStyle, setVisitedStyle, setVoiceBalance, setVoiceDuration, setVoicePitch, setVoicePitchRange, setVoiceRate, setVoiceStress, setVoiceVolume, setWhiteSpace, setWhiteSpace, setWidows, setWidth, setWidth, setWidth, setWordBreak, setWordBreak, setWordSpacing, setWordSpacing, setWordSpacing, setWordSpacing, setWordWrap, setWordWrap, setWritingMode, setZIndex, setZIndex, toStringMethods inherited from class com.oorian.css.CssElement
addNewLine, create, initializeChildren
-
Constructor Details
-
ClassRule
Constructs a class rule targeting elements with the specified CSS class.- Parameters:
className- The CSS class name to target (without the "." prefix).
-
ClassRule
Constructs a class rule using a Java Class object's canonical name.The class name is converted to CSS format by replacing dots with dashes and converting to lowercase (e.g., com.example.MyClass becomes com-example-myclass).
- Parameters:
cls- The Java Class whose name will be converted to a CSS class selector.
-
ClassRule
Constructs a class rule using a Java Class object's canonical name with a suffix.The class name is converted to CSS format and appended with the specified suffix.
- Parameters:
cls- The Java Class whose name will be converted to a CSS class selector.classSuffix- A suffix to append to the generated class name.
-
ClassRule
public ClassRule()Constructs a class rule using this object's own class name.Useful for creating self-referencing component styles where the CSS class name matches the Java class name.
-
-
Method Details
-
getName
Returns the CSS class name for this rule.- Returns:
- The class name (without the "." prefix).
-