Comments (9)
To confirm, a paragraph is collection of styled texts that is separated
from others by a new line before it and after it. right?
Yes, basically. More precisely, a paragraph is a sequence of styled texts
and an optional line terminator. All paragraphs in a StyledDocument except
the last one do have a line terminator.
Would it be possible to provide a method to get Paragraph at caret?
You can already do that:
area.getParagraphs().get(area.getCurrentParagraph());
Probably outside your scope, not sure. but do you plan to provide
paragraph alignment options?
I don't have any concrete plans, but this falls under issue #6.
from richtextfx.
Thanks. How about the start and end of a paragraph? or set style for a
whole paragraph?
On Wed, Apr 16, 2014 at 11:36 AM, TomasMikula [email protected]:
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/41
.
from richtextfx.
just found a "restyle" ! thanks that shoul ddo it :)
On Wed, Apr 16, 2014 at 11:46 AM, Maher Elkhaldi [email protected]:
Thanks. How about the start and end of a paragraph? or set style for a
whole paragraph?On Wed, Apr 16, 2014 at 11:36 AM, TomasMikula [email protected]:
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/41
.
from richtextfx.
Just note that paragraph.restyle(newStyle)
doesn't change the paragraph in the text area. It creates and returns a new one. To change the style of a paragraph in a text area, you use area.setStyle(paragraphIndex, newStyle)
.
from richtextfx.
Hmm OK. And to get the index of the paragraph at caret I would do indexOf
right?
On Apr 16, 2014 11:53 AM, "TomasMikula" [email protected] wrote:
Just note that paragraph.restyle(newStyle) doesn't change the paragraph
in the text area. It creates and returns a new one. To change a style of a
paragraph in a text area, you use area.setStyle(paragraphIndex, newStyle).—
Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-40637475
.
from richtextfx.
I got the paragraph with currentParagrapht.
Is there a way to get its indexRange from the area?
from richtextfx.
The reason I need this is that I am applying a size change to a paragraph, but it it has different styled texts. so I only want to update the size. so I am using the styles.map method. for that, I need to set styleSpans to the range, where the paragraph starts and ends.
I found a full length method, but trying to figure out a way to get the start location of a paragraph.
from richtextfx.
moved this to another issue an enhancement request :)
from richtextfx.
Per-paragraph alignment is now supported with the latest SNAPSHOT.
from richtextfx.
Related Issues (20)
- Cannot copy long text to clipboard HOT 3
- Q: Any missing APIs in JavaFX which are needed for this project? HOT 13
- wrapTextProperty() is temporarily ignored when inserting characters on a long line HOT 3
- Support entirely RTL documents HOT 22
- Execution failed for task ':richtextfx-demos:configJavafxRun'. HOT 2
- Update the Copyright Year in LICENSE file HOT 1
- 关于图文编辑jvm崩溃的问题 HOT 5
- Is this project even usable with a modern JDK and modular JavaFX? HOT 3
- Question: setStyle() is not reflected in paragraph.styledSegments until there is more than 1 paragraph. HOT 1
- Q: does styling without providing the index range work? HOT 2
- Any efficient way to setStyle for multiple positions? HOT 2
- Question regarding nodeFactory - custom Node implementation instead of TextExt HOT 5
- How to avoid setStyleSpans being an action for undo? HOT 2
- choose ColorPicker update codearea text color HOT 1
- \r and \r\n HOT 1
- codeArea.getVisibleParagraphs() find lost some line HOT 1
- Question: When I call the codeArea.replaceText() method, the styling is scrambled
- RichTextDemo Fonts Don't Display Correctly HOT 2
- how can I optimize the highlight performance HOT 1
- Getting No toolkit found in intellij HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from richtextfx.