From c38b3d2b60015821c92575f18c9cf9f989da6197 Mon Sep 17 00:00:00 2001
From: tcarver <tjc>
Date: Thu, 7 Mar 2013 15:46:01 +0000
Subject: [PATCH] provide auto fix for GFF

---
 .../artemis/components/ValidateViewer.java    | 33 ++++++++++---------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/uk/ac/sanger/artemis/components/ValidateViewer.java b/uk/ac/sanger/artemis/components/ValidateViewer.java
index f29c89a07..6039c93ba 100644
--- a/uk/ac/sanger/artemis/components/ValidateViewer.java
+++ b/uk/ac/sanger/artemis/components/ValidateViewer.java
@@ -63,25 +63,28 @@ class ValidateViewer extends FileViewer implements EntryGroupChangeListener
     update(features);
     setVisible(true);
 
-    final JButton fixButton = new JButton("Auto-Fix");
-    fixButton.addActionListener(new ActionListener() 
+    if( entryGrp == null || GeneUtils.isGFFEntry( entryGrp ) )
     {
-      public void actionPerformed(ActionEvent e) 
+      final JButton fixButton = new JButton("Auto-Fix Boundaries");
+      fixButton.addActionListener(new ActionListener() 
       {
-        try
+        public void actionPerformed(ActionEvent e) 
         {
-          entryGrp.getActionController().startAction();
-          for(int i=0; i<features.size(); i++)
-            fixBoundary(features.elementAt(i));
+          try
+          {
+           entryGrp.getActionController().startAction();
+            for(int i=0; i<features.size(); i++)
+              fixBoundary(features.elementAt(i));
+          }
+          finally
+          {
+            entryGrp.getActionController().endAction();
+            update(features);
+          }
         }
-        finally
-        {
-          entryGrp.getActionController().endAction();
-          update(features);
-        }
-      }
-    });
-    button_panel.add(fixButton);
+      });
+      button_panel.add(fixButton);
+    }
     
     button_panel.add(showFailedFeatures);
     showFailedFeatures.addItemListener(new ItemListener(){
-- 
GitLab