Exemple #1
0
        public virtual void OpenFile(File file)
        {
            string encoding = (classifier == null) ? "utf-8" : classifier.flags.inputEncoding;
            string text     = IOUtils.SlurpFileNoExceptions(file.GetPath(), encoding);

            System.Console.Out.WriteLine(text);
            editorPane.SetContentType("text/plain");
            editorPane.SetText(text);
            System.Console.Out.WriteLine(editorPane.GetText());
            loadedFile = file;
            Redraw();
            saveUntagged.SetEnabled(true);
        }
Exemple #2
0
 private void RemoveTags()
 {
     if (editorPane.GetContentType().Equals("text/html"))
     {
         if (htmlContents != null)
         {
             editorPane.SetText(htmlContents);
         }
         editorPane.Revalidate();
         editorPane.Repaint();
     }
     else
     {
         DefaultStyledDocument doc  = (DefaultStyledDocument)editorPane.GetDocument();
         SimpleAttributeSet    attr = new SimpleAttributeSet();
         StyleConstants.SetForeground(attr, Color.Black);
         StyleConstants.SetBackground(attr, Color.White);
         doc.SetCharacterAttributes(0, doc.GetLength(), attr, false);
     }
     saveTaggedAs.SetEnabled(false);
 }