APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jfx.incubator.scene.control.richtext.model

public abstract sealed Class StyleAttribute<T>

extends Object
permits StyleAttribute.CharacterStyleAttribute<X>, StyleAttribute.DocumentStyleAttribute<X>, StyleAttribute.InlineNodeStyleAttribute<X>, StyleAttribute.ParagraphStyleAttribute<X>
Class Inheritance
Known Direct Subclasses
jfx.incubator.scene.control.richtext.model.StyleAttribute.CharacterStyleAttribute, jfx.incubator.scene.control.richtext.model.StyleAttribute.DocumentStyleAttribute, jfx.incubator.scene.control.richtext.model.StyleAttribute.InlineNodeStyleAttribute, jfx.incubator.scene.control.richtext.model.StyleAttribute.ParagraphStyleAttribute
Type Parameters
<T>
the attribute value type
Imports
java.util.Objects

Style Attribute provides a way to specify style in the RichTextArea.
Since
24
See Also
StyleAttributeMap

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
StyleAttribute.CharacterStyleAttribute<X>

character style attribute

private static class
StyleAttribute.DocumentStyleAttribute<X>

document style attribute

private static class
StyleAttribute.InlineNodeStyleAttribute<X>

inline node style attribute

private static class
StyleAttribute.ParagraphStyleAttribute<X>

paragraph style attribute

Field Summary

Modifier and TypeField and Description
private final String
private final Class<T>

Constructor Summary

AccessConstructor and Description
private
StyleAttribute(String
the attribute name (cannot be null)
name
,
Class<T>
the attribute type (cannot be null)
type
)

Constructs the style attribute.

Method Summary

Modifier and TypeMethod and Description
public static <
the attribute value type
P
>
StyleAttribute<P>

Returns:

the new character attribute instance
character
(String
the attribute name
name
,
Class<P>
the attribute value type
type
)

Creates a character attribute.

public static <
the attribute value type
P
>
StyleAttribute<P>

Returns:

the new document attribute instance
document
(String
the attribute name
name
,
Class<P>
the attribute value type
type
)

Creates a document attribute.

public boolean
equals(Object x)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public String

Returns:

attribute name
getName
()

Attribute name.

public final Class<T>

Returns:

attribute type
getType
()

Returns the class corresponding to the attribute value.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public static <
the attribute value type
P
>
StyleAttribute<P>

Returns:

the new attribute instance
inlineNode
(String
the attribute name
name
,
Class<P>
the attribute value type
type
)

Creates an inline node character attribute.

public boolean

Returns:

true for a character attribute
isCharacterAttribute
()

Returns true if this instance is a character attribute.

public boolean

Returns:

true for a document attribute
isDocumentAttribute
()

Returns true if this instance is a document attribute.

public boolean

Returns:

true for an inline node attribute
isInlineNode
()

Returns true if this instance is an inline node character attribute.

public boolean

Returns:

true for a paragraph attribute
isParagraphAttribute
()

Returns true if this instance is a paragraph attribute.

public static <
the attribute value type
P
>
StyleAttribute<P>

Returns:

the new paragraph attribute instance
paragraph
(String
the attribute name
name
,
Class<P>
the attribute value type
type
)

Creates a paragraph attribute.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private final String name
typeback to summary
private final Class<T> type

Constructor Detail

StyleAttributeback to summary
private StyleAttribute(String name, Class<T> type)

Constructs the style attribute.

Parameters
name:String

the attribute name (cannot be null)

type:Class<T>

the attribute type (cannot be null)

Method Detail

characterback to summary
public static <P> StyleAttribute<P> character(String name, Class<P> type)

Creates a character attribute.

Parameters
<P>
the attribute value type
name:String

the attribute name

type:Class<P>

the attribute value type

Returns:StyleAttribute<P>

the new character attribute instance

Since
27
documentback to summary
public static <P> StyleAttribute<P> document(String name, Class<P> type)

Creates a document attribute.

Parameters
<P>
the attribute value type
name:String

the attribute name

type:Class<P>

the attribute value type

Returns:StyleAttribute<P>

the new document attribute instance

Since
27
equalsback to summary
public boolean equals(Object x)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getNameback to summary
public String getName()

Attribute name.

Returns:String

attribute name

getTypeback to summary
public final Class<T> getType()

Returns the class corresponding to the attribute value.

Returns:Class<T>

attribute type

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
inlineNodeback to summary
public static <P> StyleAttribute<P> inlineNode(String name, Class<P> type)

Creates an inline node character attribute.

Parameters
<P>
the attribute value type
name:String

the attribute name

type:Class<P>

the attribute value type

Returns:StyleAttribute<P>

the new attribute instance

Since
27
isCharacterAttributeback to summary
public boolean isCharacterAttribute()

Returns true if this instance is a character attribute.

Returns:boolean

true for a character attribute

Since
27
isDocumentAttributeback to summary
public boolean isDocumentAttribute()

Returns true if this instance is a document attribute.

Returns:boolean

true for a document attribute

Since
27
isInlineNodeback to summary
public boolean isInlineNode()

Returns true if this instance is an inline node character attribute.

Returns:boolean

true for an inline node attribute

Since
27
isParagraphAttributeback to summary
public boolean isParagraphAttribute()

Returns true if this instance is a paragraph attribute.

Returns:boolean

true for a paragraph attribute

paragraphback to summary
public static <P> StyleAttribute<P> paragraph(String name, Class<P> type)

Creates a paragraph attribute.

Parameters
<P>
the attribute value type
name:String

the attribute name

type:Class<P>

the attribute value type

Returns:StyleAttribute<P>

the new paragraph attribute instance

Since
27
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
jfx.incubator.scene.control.richtext.model back to summary

private final Class StyleAttribute.CharacterStyleAttribute<X>

extends StyleAttribute<X>
Class Inheritance

character style attribute

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
isCharacterAttribute()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isCharacterAttribute.

Returns true if this instance is a character attribute.

Inherited from jfx.incubator.scene.control.richtext.model.StyleAttribute:
characterdocumentequalsgetNamegetTypehashCodeinlineNodeisDocumentAttributeisInlineNodeisParagraphAttributeparagraphtoString

Constructor Detail

CharacterStyleAttributeback to summary
pack-priv CharacterStyleAttribute(String name, Class<X> type)

Method Detail

isCharacterAttributeback to summary
public boolean isCharacterAttribute()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isCharacterAttribute.

Doc from jfx.incubator.scene.control.richtext.model.StyleAttribute.isCharacterAttribute.

Returns true if this instance is a character attribute.

Annotations
@Override
jfx.incubator.scene.control.richtext.model back to summary

private final Class StyleAttribute.DocumentStyleAttribute<X>

extends StyleAttribute<X>
Class Inheritance

document style attribute

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
isDocumentAttribute()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isDocumentAttribute.

Returns true if this instance is a document attribute.

Inherited from jfx.incubator.scene.control.richtext.model.StyleAttribute:
characterdocumentequalsgetNamegetTypehashCodeinlineNodeisCharacterAttributeisInlineNodeisParagraphAttributeparagraphtoString

Constructor Detail

DocumentStyleAttributeback to summary
pack-priv DocumentStyleAttribute(String name, Class<X> type)

Method Detail

isDocumentAttributeback to summary
public boolean isDocumentAttribute()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isDocumentAttribute.

Doc from jfx.incubator.scene.control.richtext.model.StyleAttribute.isDocumentAttribute.

Returns true if this instance is a document attribute.

Annotations
@Override
jfx.incubator.scene.control.richtext.model back to summary

private final Class StyleAttribute.InlineNodeStyleAttribute<X>

extends StyleAttribute<X>
Class Inheritance

inline node style attribute

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
isCharacterAttribute()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isCharacterAttribute.

Returns true if this instance is a character attribute.

public boolean
isInlineNode()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isInlineNode.

Returns true if this instance is an inline node character attribute.

Inherited from jfx.incubator.scene.control.richtext.model.StyleAttribute:
characterdocumentequalsgetNamegetTypehashCodeinlineNodeisDocumentAttributeisParagraphAttributeparagraphtoString

Constructor Detail

InlineNodeStyleAttributeback to summary
pack-priv InlineNodeStyleAttribute(String name, Class<X> type)

Method Detail

isCharacterAttributeback to summary
public boolean isCharacterAttribute()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isCharacterAttribute.

Doc from jfx.incubator.scene.control.richtext.model.StyleAttribute.isCharacterAttribute.

Returns true if this instance is a character attribute.

Annotations
@Override
isInlineNodeback to summary
public boolean isInlineNode()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isInlineNode.

Doc from jfx.incubator.scene.control.richtext.model.StyleAttribute.isInlineNode.

Returns true if this instance is an inline node character attribute.

Annotations
@Override
jfx.incubator.scene.control.richtext.model back to summary

private final Class StyleAttribute.ParagraphStyleAttribute<X>

extends StyleAttribute<X>
Class Inheritance

paragraph style attribute

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
isParagraphAttribute()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isParagraphAttribute.

Returns true if this instance is a paragraph attribute.

Inherited from jfx.incubator.scene.control.richtext.model.StyleAttribute:
characterdocumentequalsgetNamegetTypehashCodeinlineNodeisCharacterAttributeisDocumentAttributeisInlineNodeparagraphtoString

Constructor Detail

ParagraphStyleAttributeback to summary
pack-priv ParagraphStyleAttribute(String name, Class<X> type)

Method Detail

isParagraphAttributeback to summary
public boolean isParagraphAttribute()

Overrides jfx.incubator.scene.control.richtext.model.StyleAttribute.isParagraphAttribute.

Doc from jfx.incubator.scene.control.richtext.model.StyleAttribute.isParagraphAttribute.

Returns true if this instance is a paragraph attribute.

Annotations
@Override