Revision: 14920
          http://gate.svn.sourceforge.net/gate/?rev=14920&view=rev
Author:   markagreenwood
Date:     2012-01-06 19:02:49 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
removed some old code that code never be accessed

Modified Paths:
--------------
    gate/trunk/src/gate/gui/NameBearerHandle.java

Modified: gate/trunk/src/gate/gui/NameBearerHandle.java
===================================================================
--- gate/trunk/src/gate/gui/NameBearerHandle.java       2012-01-06 18:25:17 UTC 
(rev 14919)
+++ gate/trunk/src/gate/gui/NameBearerHandle.java       2012-01-06 19:02:49 UTC 
(rev 14920)
@@ -73,9 +73,7 @@
 import java.awt.Window;
 import java.awt.event.ActionEvent;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.OutputStreamWriter;
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -388,7 +386,7 @@
                 new PopulateCorpusFromSingleConcatenatedFileAction(),
                 sListenerProxy));
         staticPopupItems.add(null);
-        staticPopupItems.add(new XJMenuItem(new SaveCorpusAsXmlAction(false),
+        staticPopupItems.add(new XJMenuItem(new SaveCorpusAsXmlAction(),
                 sListenerProxy));
         // staticPopupItems.add(new XJMenuItem(new
         // SaveCorpusAsXmlAction(true), sListenerProxy));
@@ -779,23 +777,14 @@
   class SaveCorpusAsXmlAction extends AbstractAction {
     private static final long serialVersionUID = 1L;
 
-    private boolean preserveFormat;
-
-    public SaveCorpusAsXmlAction(boolean preserveFormat) {
+    public SaveCorpusAsXmlAction() {
       super("Save as XML...");
       putValue(SHORT_DESCRIPTION, "Saves each document in GATE XML format");
-      this.preserveFormat = preserveFormat;
-
-      if(preserveFormat) {
-        putValue(NAME, "Save Preserving Format...");
-        putValue(SHORT_DESCRIPTION, "Saves each document preserving its 
format");
-      } // if
     }// SaveAsXmlAction()
 
     public void actionPerformed(ActionEvent e) {
       Runnable runnable = new Runnable() {
         public void run() {
-          if(preserveFormat) System.out.println("Preserve option set!");
           try {
             // we need a directory
             XJFileChooser fileChooser = MainFrame.getFileChooser();
@@ -914,53 +903,8 @@
                 } while(!nameOK);
                 // save the file
                 try {
-                  String content = "";
-                  // check for preserve format flag
-                  if(preserveFormat) {
-                    Set annotationsToDump = null;
-                    // Find the shown document editor.
-                    // If none, just dump the original markup
-                    // annotations,
-                    // i.e., leave the annotationsToDump null
-                    if(largeView instanceof JTabbedPane) {
-                      Component shownComponent = ((JTabbedPane)largeView)
-                              .getSelectedComponent();
-                      if(shownComponent instanceof DocumentEditor) {
-                        // so we only get annotations for dumping
-                        // if they are shown in the table of the
-                        // document editor,
-                        // which is currently in front of the user
-                        annotationsToDump = ((DocumentEditor)shownComponent)
-                                .getDisplayedAnnotations();
-                      }// if we have a document editor
-                    }// if tabbed pane
-
-                    // determine if the features need to be saved first
-                    Boolean featuresSaved = Gate.getUserConfig().getBoolean(
-                            
GateConstants.SAVE_FEATURES_WHEN_PRESERVING_FORMAT);
-                    boolean saveFeatures = true;
-                    if(featuresSaved != null)
-                      saveFeatures = featuresSaved.booleanValue();
-
-                    // Write with the toXml() method
-                    content = currentDoc.toXml(annotationsToDump, 
saveFeatures);
-
-                    // Prepare to write into the xmlFile using the
-                    // original encoding
-                    String encoding = ((gate.TextualDocument)currentDoc)
-                            .getEncoding();
-
-                    OutputStreamWriter writer = new OutputStreamWriter(
-                            new FileOutputStream(docFile), encoding);
-
-                    writer.write(content);
-                    writer.flush();
-                    writer.close();
-                  }
-                  else {
-                    // for GATE XML format, use the direct StAX writer
-                    DocumentStaxUtils.writeDocument(currentDoc, docFile);
-                  } // if
+                  // for GATE XML format, use the direct StAX writer
+                  DocumentStaxUtils.writeDocument(currentDoc, docFile);  
                 }
                 catch(Exception ioe) {
                   MainFrame.unlockGUI();
@@ -1648,7 +1592,7 @@
             URL url;
             try {
               url = new URL(corpusFiller.getUrlString());
-              java.util.List extensions = corpusFiller.getExtensions();
+              List extensions = corpusFiller.getExtensions();
               ExtensionFileFilter filter;
               if(extensions == null || extensions.isEmpty()) {
                 filter = null;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to