tida1 / gwt-selection

Automatically exported from code.google.com/p/gwt-selection
0 stars 0 forks source link

How to get the actual html nodes where the cursor is standing? #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Uh, sorry, can somebody delete issue 4, I submitted it with wrong email 
address...

What steps will reproduce the problem?
1) Selection sel = Selection.getSelection(...the iframe's win...);
2) Range rng = sel.getRange();
3) rng.collapse(true);
4) RangeEndPoint rep = rng.getCursor();
5) System.out.println(rep.getNode());

What is the expected output? What do you see instead?
expected : <br> //the cursor is between two <br> tags
seen : the next/prev TEXT node relative to the cursor

What version of the product are you using? On what operating system?
Rev. 14 / Win7

Please provide any additional information below.

Can I get the actual Nodes where the cursor is standing? Regardless of these 
are TEXT nodes or other html elements, e.g <br> tags?
Thank you!

Original issue reported on code.google.com by fenyvesi...@gmail.com on 19 Mar 2012 at 2:45

GoogleCodeExporter commented 8 years ago
#4 deleted.

I have a version I've been using that includes some non-text nodes, but haven't 
released because I haven't done any testing on the Windows emulation bit, nor 
corner case testing to ensure a consistent behavior.  The original design only 
ever returned text nodes, so there needs to be a mechanism of whether to keep 
this behavior (which has its own uses) or to also return elements when 
necessary.

Unfortunately I'm currently swamped on a project that isn't using this package, 
so haven't been looking at this lately.  I'll try to carve out some time in the 
next few weeks.

Original comment by koz...@gmail.com on 19 Mar 2012 at 6:52

GoogleCodeExporter commented 8 years ago
Ok, thank you, please let to know if there is any progressing in the future on 
this.

Original comment by fenyvesi...@gmail.com on 19 Mar 2012 at 9:38