Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] struggling to get solution to modify the IEditorInput file

 Hi All,

First of all I am very sorry to put this query in this newsgroup, But I am
struggling to get solution.
Please help me.


I am struggling to get a solution to modify the Editor's IFile.

My editor file is an XML file which I am reading in Init using IFile's
input stream


I want to modify or add new XML elements/nodes based on user inputs to the
Editor , How do I proceed?


public void init(IEditorSite site, IEditorInput editorInput)
{
 super.init(site, editorInput);

 try
 {
 inputFile = (IFileEditorInput) editorInput;
        DocumentBuilderFactory docBuilderFactory =
                                     DocumentBuilderFactory.newInstance();

 DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
IPathEditorInput inputFilePath1 = (IPathEditorInput) editorInput;
 Document doc = docBuilder.parse (inputFile.getFile().getContents());
 doc.getDocumentElement ().normalize ();
 NodeList deviceTag = doc.getElementsByTagName("Device");
}
 catch (SAXParseException err) {

 }
         catch (SAXException e) {

  }
         catch (Throwable t) {
 }

Thanks in Advance

Abhijeet



Back to the top