B4J Question Check for selection in RichTextFX [SOLVED]

Discussion in 'B4J Questions' started by ThRuST, Jul 2, 2019.

  1. ThRuST

    ThRuST Well-Known Member Licensed User

    As the title says, is there an easy way to do that? my mind is blank after a long day with code so.. :)

    Anyway, it's based on this

    when a button is clicked..

    Code:
    fx.Clipboard.SetString(CodeArea1.GetSelectedText) ' GetText selects all
     
    Last edited: Jul 2, 2019
  2. ThRuST

    ThRuST Well-Known Member Licensed User

    a new day, another solution enjoy :)

     
    Last edited: Jul 2, 2019
    Mashiane likes this.
  3. ThRuST

    ThRuST Well-Known Member Licensed User

    And here is the final preffered behavior. Depending on which TabPane is selected (Doc/Code as in Athena) , here's the logic.

    If nothing is selected in the RichTextFX, then ALL the contents is copied to the clipboard.
    If something is selected, that portion is copied to the clipboard.
    This means, if the view is empty the clipboard becomes empty as well.

    Info about project Athena can be found in B4J/Share my creations. Go here

     
    Last edited: Jul 2, 2019
    Mashiane likes this.
  4. Mashiane

    Mashiane Expert Licensed User

    Cool, I was looking at their website, https://github.com/FXMisc/RichTextFX for anything one could use. I need to educate myself about the JavaObject stuff hey. This is good work you are doing!!
     
  5. ThRuST

    ThRuST Well-Known Member Licensed User

    @Mashiane Thanks :) I had to search Google to find out about length. It's indeed very powerful and most useful. The FXnotify is useful but will probably not be needed because sound themes has proven to be much more convenient. The RichTextFX was wrapped by Stevel05 and can be found in the forum, so you can use the classes he implemented right outa the box. There's also the option to print. It depends on Java 8 as there were no Java 11 support at the time he wrapped it. Actually he called it RichViewFX and it's available here
     
    Mashiane likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice