public class Paragraph
extends java.lang.Object
Constructor and Description |
---|
Paragraph(boolean richtext,
boolean editable,
RichTextArea parent)
creates an empty paragraph
|
Paragraph(java.lang.String simpletext,
boolean richtext,
boolean editable,
RichTextArea parent)
creates a paragraph with the text in input (can have formatting if rich text)
|
Modifier and Type | Method and Description |
---|---|
void |
dirtyhackcaretminus()
specific hack for ASCII character 22
|
void |
displayCaretAt(int selectionintextflow) |
protected void |
displaySelection() |
java.lang.String |
dropText()
provides the encoded text description of the paragraph following Open Lowcode
rich text
|
Paragraph |
generateParagraphAfterNextBreak()
returns a paragraph with all formatted text after the carret, and, if
existing, any text after the first carriage return in current formatted text
|
Paragraph |
generateParagraphBeforePreviousBreak()
returns a paragraph with all formatted text before the carret, and, if
existing, any text before the last carriage return in current formatted text
before the caret
|
Paragraph |
generateParagraphbetweenBreak()
generates a paragraph between two carriage returns
|
protected int |
getCharAt(int charIndex) |
int |
getCharNb() |
int |
getCharSelectionOnCoordinates(double x,
double y)
selects the char corresponding to points x and y
|
int |
getLastLine() |
int |
getLineForCarret() |
javafx.scene.Node |
getNode() |
float |
getXOffSetForSelection() |
void |
giveBackFocus()
gets back the focus on this item
|
boolean |
hasSelection() |
boolean |
hasSignificantContent() |
protected void |
hideSelection() |
protected void |
hideSelectionAndResetIndex() |
void |
insertBoldIndicator(boolean selected)
insert bold indicator
|
void |
insertColorIndicator(javafx.scene.paint.Color value)
inserts a color indicator at the current caret position
|
void |
insertItalicIndicator(boolean selected)
insert italic indicator
|
void |
insertTextAtFirst(java.lang.String text)
inserts text at the beginning
|
boolean |
isNormal() |
boolean |
isSelectionAtFirstLine() |
boolean |
isSelectionAtLastLine() |
void |
reformatTextFollowingParagraph()
reformats the text
|
java.lang.String |
returnSelectedText() |
void |
setBulletParagraph()
sets the paragraph to bullet point
|
void |
setNormalParagraph()
sets the paragraph to normal
|
void |
setSelectionat(int line,
float caretindex)
sets the selection for the given line, with the given caret index
|
void |
setTitleParagraph()
sets the paragraph to title
|
public Paragraph(java.lang.String simpletext, boolean richtext, boolean editable, RichTextArea parent)
simpletext
- simple textrichtext
- true if rich text formatting is possibleeditable
- true if editableparent
- parent rich text areapublic Paragraph(boolean richtext, boolean editable, RichTextArea parent)
richtext
- true if richtexteditable
- true if editableparent
- the parent richtextareapublic java.lang.String dropText()
public boolean hasSelection()
public java.lang.String returnSelectedText()
public int getCharNb()
public void setBulletParagraph()
public void setTitleParagraph()
public void setNormalParagraph()
public void reformatTextFollowingParagraph()
public javafx.scene.Node getNode()
public void displayCaretAt(int selectionintextflow)
selectionintextflow
- displays the caret at the given selection in the
text flowpublic boolean isSelectionAtFirstLine()
public boolean isSelectionAtLastLine()
public int getLastLine()
public float getXOffSetForSelection()
public void setSelectionat(int line, float caretindex)
line
- an integer between 0 and the index of last linecaretindex
- actual position of thecaret in pixelspublic int getLineForCarret()
public int getCharSelectionOnCoordinates(double x, double y)
x
- x mouse click coordinatey
- y mouse clock coordinateprotected void hideSelection()
protected void hideSelectionAndResetIndex()
protected void displaySelection()
protected int getCharAt(int charIndex)
public boolean hasSignificantContent()
public void giveBackFocus()
public void dirtyhackcaretminus()
public void insertColorIndicator(javafx.scene.paint.Color value)
value
- color indicatorpublic void insertBoldIndicator(boolean selected)
selected
- true to put bold, false, to put back to normalpublic void insertItalicIndicator(boolean selected)
selected
- true to start an italic section, false to end an italic
sectionpublic Paragraph generateParagraphBeforePreviousBreak()
public Paragraph generateParagraphAfterNextBreak()
public Paragraph generateParagraphbetweenBreak()
public boolean isNormal()
public void insertTextAtFirst(java.lang.String text)
text
- text to insert (can be encoded rich text)