Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [atf-dev] Positioning javascript editor


> So I guess the idea is that if you can't find something you want in the API, start reading all of the getAdapter() implementations until you find something there.

For better or worse, yes.  getAdapter is a very powerful mechanism for "extending" the behavior of classes ... but ... some would argue it is one of the (funky) banes of Eclipse.








"John J. Barton" <johnjbarton@xxxxxxxxxxxxxxx>
Sent by: atf-dev-bounces@xxxxxxxxxxx

08/28/2006 12:08 AM

Please respond to
AJAX Toolkit Framework discussion <atf-dev@xxxxxxxxxxx>

To
AJAX Toolkit Framework discussion <atf-dev@xxxxxxxxxxx>
cc
Subject
Re: [atf-dev] Positioning _javascript_ editor





Nevermind...found the answer to #2:
ITextEditor funky = (ITextEditor) editorPart.getAdapter(ITextEditor.
class);
So I guess the idea is that if you can't find something you want in the API, start reading all of the getAdapter() implementations until you find something there.

At 06:24 PM 8/27/2006, you wrote:

I am writing a plugin that wants to position the cursor on a line in a file.  For HTML it works fine. For _javascript_ it fails.  The _javascript_ editor is a JSMultiPageEditorPart wrapping a JSEditor (I think).  I hope someone here understands enough to help me with two puzzles:
 1) Why MultiPageEditorPart?  Just when I thought eclipse could not get more complex....
 2) How can I get the JSEditor from the JSMultiPageEditorPart?   I think I can position the JSEditor to a line, but the accessors in JSMultiPageEditorPart are protected so they must not be the right way to go.
I'm sure ATF solves this somehow...
Thanks,
John.

______________________________________________________
John J. Barton  email:  johnjbarton<at>johnjbarton.com

http://www.johnjbarton.com

_______________________________________________
atf-dev mailing list
atf-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/atf-dev

______________________________________________________
John J. Barton  email:  johnjbarton<at>johnjbarton.com  

http://www.johnjbarton.com_______________________________________________
atf-dev mailing list
atf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/atf-dev


Back to the top