Coder Social home page Coder Social logo

Comments (4)

TomasMikula avatar TomasMikula commented on May 18, 2024

You can already do that using these methods
getStyleSpans(int paragraph, int from, int to)
setStyleSpans(int paragraph, int from, StyleSpans styleSpans)
e.g.

int par = area.getCurrentParagraph();
int parLen = area.getParagraphs().get(par).length();
StyleSpans<S> styles = area.getStyleSpans(par, 0, parLen);
StyleSpans<S> newStyles = styles.mapStyles(...);
area.setStyleSpans(par, 0, newStyles);

from richtextfx.

 avatar commented on May 18, 2024

Nice! Thanks. That did it :D

On Wed, Apr 16, 2014 at 3:35 PM, TomasMikula [email protected]:

Closed #42 #42.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42
.

from richtextfx.

TomasMikula avatar TomasMikula commented on May 18, 2024

I added a convenience method, so the above code can now be rewritten as

int par = area.getCurrentParagraph();
StyleSpans<S> styles = area.getStyleSpans(par);
StyleSpans<S> newStyles = styles.mapStyles(...);
area.setStyleSpans(par, 0, newStyles);

from richtextfx.

 avatar commented on May 18, 2024

Thanks! I just downloaded it. It works fine.

On Wed, Apr 16, 2014 at 4:31 PM, TomasMikula [email protected]:

I added a convenience method, so the above code can now be rewritten as

int par = area.getCurrentParagraph();StyleSpans styles = area.getStyleSpans(par);

StyleSpans newStyles = styles.mapStyles(...);area.setStyleSpans(par, 0, newStyles);

Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-40665036
.

from richtextfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.