I just want to implement some code folding between brackets or carets like other java IDEs: eclipse, netbeans, intellij using codearea control of richtextfx library. Please give me some code hints? thank you.
How to indicate fold unfold icon at the line indicator in codearea of richtextfx control java
162 Views Asked by garawaa garawaa At
1
There are 1 best solutions below
Related Questions in JAVAFX
- Function for making the code wait in javafx
- JavaFX build generating a blank gui with primary view and secondary view buttons
- JavaFX SwingNode instantiation fails with exception
- I want to understand modularity in java. When compiling my app I have a ResolutionException
- Importing Jython into a JavaFX application
- gluon attach audio doesn't play any sound on android
- Using javaFx, how to distinguish between return-key and enter-key on the numpad?
- Displaying a Hashmap in a TableView in JavaFX
- HBox doesn't fill parent GridPane when rotated by 90 degrees
- Run java program
- Setting up MongoDB with JavaFX in Intellij, MongoDB external Jar files throwing errors
- JavaFX not support GPU hardware decoding?
- JavaFX resize ImageView in center of BorderPane
- In Javafx how to access object of a component which is under an overridden method? Problem related with TableView
- How to style rounded corners of a TextArea in JavaFX
Related Questions in FOLD
- creating variables from data after using the fold command
- Applying a function to all elements of a tree in Python
- error: cannot convert 'std::optional<int>' to 'const int' in initialization
- Early return from within a fold
- foldM with monad State does not type check
- Haskell foldr1 lambda function which adds tuple values
- How do you do a parallel fold on a Kotlin sequence?
- How to evaluate a function with curried argument in haskell?
- Is foldl or foldr more efficient for intercalating list elements?
- FoldLeft/FoldRight: Scala Compile-Errors
- Building a string using fold, and would like to speed it up by assigning the correct capacity
- Idiomatic Kotlin Value Mapping
- C++ variadic template 'contains no parameter packs' when constexpr if should avoid?
- Double fold expression to replace branching statement
- XCode - stop unfolding by default
Related Questions in RICHTEXTFX
- How do you get a paragraph number for a given position in a RichTextFX CodeArea?
- How to indicate fold unfold icon at the line indicator in codearea of richtextfx control java
- RichTextFx VirtualizedScrollPane flickers when text wraps as you type
- JavaFX Spell checker using RichTextFX how to create right click suggestions
- How to get notified when changes in the document actually happens?
- How to make text blink using JavaFX CSS?
- How to make outer pane scroll instead of inner one
- JLanguageTool is running slow
- RichTextFX: Highlighting a Word in StyleClassedTextArea not working
- JavaFX - RichTextFX - How to change highlight text color
- Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: This ParagraphText is not the parent of the given shape
- Autocompletion in codearea in javafx
- RichTextFX CodeArea Force Caret to Last Paragraph
- How to implement RichTextFX in JavaFX project
- RichTextFx not working in JavaFX, CodeArea not not showing up (Errors)
Related Questions in UNFOLD
- XCode - stop unfolding by default
- Is there an unfolding-folding operation, that will perform a matrix repetition in pytorch?
- How to indicate fold unfold icon at the line indicator in codearea of richtextfx control java
- How to solve Unfold.effects crash?
- How to manage Unfold precompiling error: _iszero not defined?
- How to produce a true `Iterator[Long]` in Scala
- "im2col_out_cpu" not implemented for 'Byte'
- Is it possible to unfold a variadic (lambda) template and the pass those functions return value to another variadic function?
- Highcharts fold/unfold waterfall
- Where I can find an intuitive explanation of PyTorch's Tensor.unfold() being used to get image patches?
- Defining a generic unfoldr function
- How can I check/see the inside operations and calculations of any Keras (Dense, Conv1D, LSTM) layers?
- Unfold the loop three times
- Seq.cache with Seq.unfold in F#
- List coalgebra translating code from Haskell to SML
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The trick is to implement your own line number factory that adds a control to the line number label (e.g. the graphic of a Label) that indicates a spot where the lines can be folded, or that they are already folded.
When that graphic is clicked you would call:
codeArea.foldParagraphs(startLine, endLine);to fold the lines, orcodeArea.unfoldParagraphs(line);to unfold the lines.How you determine if a line is foldable and how many lines to fold is out of scope for a StackOverflow answer. It can be a simple as checking if the line ("paragraph") ends with a
'{'and then scan ahead to the first'}'. But that will fail in some cases, like a "}" that is part of a string or character literal or something like that.Here is a skeleton of what the code might look like:
How you fill in the rest depends on how you determine what is foldable, and what you want the folding control to look like.