Hi, I m doing a eclipse plugin project to create an IDE. In my IDE,the currently opened editor is checked for a particular string and should be replaced by a string entered in the textbox which is in the side view. I m able to access the editor but if i search for the particular string and replace that string with the input entered by the user it is not working.
IDocumentProvider provider=((AbstractTextEditor) ieditorpart).getDocumentProvid();
IDocument doc = provider.getDocument(ieditorpart.getEditorInput());
String content = doc.get();
pos=content.compareTo("\\/\\*ProbeEnd\\*\\/");
doc.replace(pos,5, "hello");
But this is not working... here i have just given the replacement string as hello,but that value should be taken from the textbox..
Is there any mistake in accessing the editor? should i use this approach to do this or is there any approach to implement this? Can Anyone help me in doing this?