-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion for snippets #63
Comments
Hi Maher, how do you imagine such an API? How, for example, do you imagine to get/create an instance of a snippet and how would you use one? |
Hi Tomas, InlineCssTextArea richText = new InlineCssTextArea (); //a snippet would need a text and style. I guess it might be called a //I can insert a snippet into a rich text area //I would want to get all instances of a snippet and replace them mySnippet.getInstances(richText), or or maybe the other way around //find a certain snippet in this text //I can listen to the snippet properties... for example or mySnippet.styleProperty() //since a style is true for all instances,.. //I also would want to do something , higlight snippets, in all text //or see how many snippet instances are inserted mySnippet.getCount(richText);//get snippets in this text area //or things like richText.getSnippetInstances(mySnippet); //this would get me a list of all In this sense a snippet is a defined body of text, which can keep track of This would allow me to do cool things like: Find and replace all , or have snippets stored somewhere, and simply scroll With a proper snippet class, I can do text highlighting, and keep track of I could think of other cool interactions that can be facilitated by such richText.setSnippet(mySnippet); richText2.insertSnippet(0, mySnippet.getInstance(0)); where you say, place then I can probably add a hyper link.. so that for example double-clicking of course a richtext would be bale to removeAllSnippetClasses, I can keep going on with possible scenarios :) but I guess you get the idea! Ps. these are mostly my imaginations :D On Tue, Jun 17, 2014 at 7:19 PM, TomasMikula [email protected]
|
Oh , another place that would highly benefit from such an API is in code area.. if you have a way to define text-entities, then you can then do things like refactoring a variable name in code area. |
Hi Maher, I see the usefulness of some of the scenarios. I'm not sure about SnippetClass though. What should happen when one snippet instance is edited in the text area? Should all instances of the same class change accordingly? If so, how would you unlink one instance from the snippet class to allow it to be edited independently? |
hi Tomas, Maybe a factory? If the caret hits a snippet instance, it gets highlighted or italicized or if i just type inside a snippet, like insert a space inside, it gets what i did was store a snippet template to a side tree view and then assign to create a snippet template you select text from the text area and either my snippet implementation keeps breaking because of the way i am tracking my other issue is when i replace all snippets, if snippets length is i thought if this was implemented within richtextfx where positions are best,
|
It's tricky to get right, especially when one edit triggers another. But there is no magically easy way to implement this in RichTextFX internally. As I noted in #66, |
would a bounty be enough incentive? :) (there is one)! On Mon, Jul 7, 2014 at 1:11 PM, TomasMikula [email protected]
|
I noticed the bounty, thanks! But I cannot guarantee any timeline. |
whenever you get to it! |
I'd just like to mention here for reference, I don't know if it should be a separate ticket or not but, bookmarks. The snippets could also serve as bookmarks to jump to specific identfiers/etc. Though that may be beyond the scope of RTFX. |
This is another issue that I believe should now be possible to implement on top of RTFX due to the added custom object support. Thus, I'm closing this. |
Hi Tomas,
I would like to suggest adding API to create snippets. the idea is that those snippets would know if they are being selected, hovered over, etc. and a text area would know these snippets' locations, their style, etc. and probably have a property to report on which, if any, snippet is being clicked inside of or selected.
i implemented a very sketchy version, which half-works for the purpose of my project, but i thought such element type would be cool to have i richtextfx.
thanks !
Maher
The text was updated successfully, but these errors were encountered: