public void newJavaSource()
 {
     JavaSource java = new JavaSource("Untitled.java", this);
     java.GetVM().OnLoaded();
     var firstDocumentPane = View.dockingManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
     if (firstDocumentPane != null)
     {
         firstDocumentPane.Children.Add(java);
         java.IsSelected = true;
     }
 }
 public void DisplayFile(string p)
 {
     string fileName = p.Substring(p.LastIndexOf("\\")).Remove(0, 1);
     string fileExt = fileName.Substring(fileName.LastIndexOf("."));
     switch (fileExt)
     {
         case ".java":
             {
                 JavaSource java = new JavaSource(p, fileName, this);
                 java.GetVM().OnLoaded();
                 var firstDocumentPane = View.dockingManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
                 if (firstDocumentPane != null)
                 {
                     firstDocumentPane.Children.Add(java);
                     java.IsSelected = true;
                 }
                 break;
             }
     }
 }