Package org.patternfly.component.code
Class CodeBlock
- java.lang.Object
-
- org.patternfly.component.BaseComponent<HTMLDivElement,CodeBlock>
-
- org.patternfly.component.code.CodeBlock
-
- All Implemented Interfaces:
Attachable,Container<HTMLDivElement,CodeBlock>,Finder<HTMLDivElement>,HasElement<HTMLDivElement,CodeBlock>,HasHTMLElement<HTMLDivElement,CodeBlock>,IsElement<HTMLDivElement>,TypedBuilder<HTMLDivElement,CodeBlock>,Component
public class CodeBlock extends BaseComponent<HTMLDivElement,CodeBlock> implements Attachable
A code block is a component that contains 2 or more lines of read-only code. The code in a code block can be copied to the clipboard.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_TRUNCATE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CodeBlockadd(CodeBlockHeader header)CodeBlockaddAction(CodeBlockAction action)CodeBlockaddHeader(CodeBlockHeader header)voidattach(MutationRecord mutationRecord)Stringcode()CodeBlockcode(String code)static CodeBlockcodeBlock()static CodeBlockcodeBlock(String code)CodeBlockthat()CodeBlocktruncate()Same as truncate(3)CodeBlocktruncate(int truncate)-
Methods inherited from class org.patternfly.component.BaseComponent
componentType, element
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.elemento.Attachable
detach
-
Methods inherited from interface org.jboss.elemento.Container
add, add, addAll, addAll, addAll, addAll, addAll
-
Methods inherited from interface org.jboss.elemento.HasElement
add, apply, aria, aria, aria, attr, attr, attr, css, id, id, innerHtml, on, textContent, toggle, toggle, toggle
-
Methods inherited from interface org.jboss.elemento.HasHTMLElement
data, hidden, style, title
-
-
-
-
Field Detail
-
DEFAULT_TRUNCATE
public static final int DEFAULT_TRUNCATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
codeBlock
public static CodeBlock codeBlock()
-
attach
public void attach(MutationRecord mutationRecord)
- Specified by:
attachin interfaceAttachable
-
that
public CodeBlock that()
- Specified by:
thatin interfaceTypedBuilder<HTMLDivElement,CodeBlock>
-
addHeader
public CodeBlock addHeader(CodeBlockHeader header)
-
add
public CodeBlock add(CodeBlockHeader header)
-
addAction
public CodeBlock addAction(CodeBlockAction action)
-
truncate
public CodeBlock truncate()
Same as truncate(3)
-
truncate
public CodeBlock truncate(int truncate)
-
code
public String code()
-
-