Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Please Help !!! Regarding inserting text in an editor through a view.
Please Help !!! Regarding inserting text in an editor through a view. [message #329672] Tue, 01 July 2008 04:46 Go to next message
Eclipse UserFriend
Originally posted by: parulseth.gmail.com

Hi All

I have an xml editor of my own, in which I want to insert xml tags through
a view i.e on click of a button in a view.

Also I want to add three functionalities, firstly, to add the tag on the
current cursor position. Secondly, to add tags irrespective of the cursor
position, and thirdly to customize coloring of the inserted text.

I have seen the article- "FAQ How do I insert text in the active text
editor?" at
http://wiki.eclipse.org/FAQ_How_do_I_insert_text_in_the_acti ve_text_editor%3F.

But I am not able to get this working.

Please help me regarding this!

Regards
Parul Seth
Impetus Infotech India Pvt. Ltd.

"Do your duty at your best, leave unto thy God the rest"
Re: Please Help !!! Regarding inserting text in an editor through a view. [message #329674 is a reply to message #329672] Tue, 01 July 2008 04:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: parulseth.gmail.com

Parul Seth wrote:

> Hi All

> I have an xml editor of my own, in which I want to insert xml tags through
> a view i.e on click of a button in a view.

> Also I want to add three functionalities, firstly, to add the tag on the
> current cursor position. Secondly, to add tags irrespective of the cursor
> position, and thirdly to customize coloring of the inserted text.

> I have seen the article- "FAQ How do I insert text in the active text
> editor?" at
>
http://wiki.eclipse.org/FAQ_How_do_I_insert_text_in_the_acti ve_text_editor%3F.

> But I am not able to get this working.

> Please help me regarding this!



I am now able insert text in the editor but I want this to happen through
a view's button along with all the other three functionalities i have
mentioned above.
Re: Please Help !!! Regarding inserting text in an editor through a view. [message #329676 is a reply to message #329674] Tue, 01 July 2008 05:40 Go to previous message
Eclipse UserFriend
Originally posted by: parulseth.gmail.com

I am now able to insert text through my view, I added the following code
to the run() method of my ViewActiondelgate class:


ITextEditor editor = null;
if (part instanceof ITextEditor)
editor = (ITextEditor) part;

IDocumentProvider provider = editor.getDocumentProvider();
IDocument document = provider.getDocument(editor.getEditorInput());
document.set("Hello...........");

Now I want to add three functionalities I have mentioned.



Parul Seth wrote:

> Parul Seth wrote:

>> Hi All

>> I have an xml editor of my own, in which I want to insert xml tags through
>> a view i.e on click of a button in a view.

>> Also I want to add three functionalities, firstly, to add the tag on the
>> current cursor position. Secondly, to add tags irrespective of the cursor
>> position, and thirdly to customize coloring of the inserted text.

>> I have seen the article- "FAQ How do I insert text in the active text
>> editor?" at
>>
>
http://wiki.eclipse.org/FAQ_How_do_I_insert_text_in_the_acti ve_text_editor%3F.

>> But I am not able to get this working.

>> Please help me regarding this!



> I am now able insert text in the editor but I want this to happen through
> a view's button along with all the other three functionalities i have
> mentioned above.
Previous Topic:[Eclipse 3.4] Using multiple configurations with a shared installation
Next Topic:Mouse controls not working with Ganymede
Goto Forum:
  


Current Time: Fri May 02 07:58:06 EDT 2025

Powered by FUDForum. Page generated in 0.03314 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top