| Code: |
|
public void createTreeView(InputStream myStream, String Path){ System.out.println("CreateTreeView"); treeView = new TreeViewer(window.getShell()); Document dom = new XMLStuff(myStream).getParser(Path); treeView.add(dom, window.getWorkbench().getActiveWorkbenchWindow().getWorkbench()); }//public void CreateTreeView |
| Code: |
|
public Document getParser (String myPath){ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); try{ DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); Document myDoc = docBuilder.parse(myPath); return myDoc; }catch(ParserConfigurationException PCE){ PCE.printStackTrace(); }catch(IOException IOE){ IOE.printStackTrace(); }catch(SAXException SAXE){ SAXE.printStackTrace(); }//catch SAXException System.out.println("getParser returned null. sorry."); return null; }//public Document getParser (String myPath) |
| Code: |
|
public Element loadXMLDom(){ if (myStream != null){ System.gc(); //Hi there: The thing is that the following line causes a crash! Element dom = XMLUtil.loadDom(myStream, "MWEB"); return dom; }//if (myStream != null) else System.err.println("Sorry, but the Stream is null - loadXMLDom()"); return null; }//public GetXMLDom |