JAL-1834 disabled action buttons (Back / Ok / Cancel) when in 'Configure Displayed...
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 21 Aug 2015 13:59:19 +0000 (14:59 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 21 Aug 2015 13:59:19 +0000 (14:59 +0100)
src/jalview/jbgui/GPDBSearchPanel.java
src/jalview/jbgui/GStructureChooser.java

index 08a620a..473f634 100644 (file)
@@ -283,14 +283,18 @@ tbl_summary);
         JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
                 .getSource();
         int index = sourceTabbedPane.getSelectedIndex();
-        btn_ok.setEnabled(false);
         if (sourceTabbedPane.getTitleAt(index).equals(configureCols))
         {
+          btn_back.setEnabled(false);
+          btn_cancel.setEnabled(false);
+          btn_ok.setEnabled(false);
           previousWantedFields = PDBDocFieldPreferences
                   .getSearchSummaryFields().toArray(new PDBDocField[0]);
         }
         if (sourceTabbedPane.getTitleAt(index).equals(searchTabTitle))
         {
+          btn_back.setEnabled(true);
+          btn_cancel.setEnabled(true);
           if (wantedFieldsUpdated())
           {
             txt_search_ActionPerformed();
index 9e4e6f3..caba85f 100644 (file)
@@ -324,11 +324,12 @@ public abstract class GStructureChooser extends JPanel implements
       {
         JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
                 .getSource();
-        btn_view.setEnabled(false);
         int index = sourceTabbedPane.getSelectedIndex();
         if (sourceTabbedPane.getTitleAt(index)
 .equals(configureCols))
         {
+          btn_view.setEnabled(false);
+          btn_cancel.setEnabled(false);
           previousWantedFields = PDBDocFieldPreferences
                   .getStructureSummaryFields().toArray(
                           new PDBRestClient.PDBDocField[0]);
@@ -336,6 +337,7 @@ public abstract class GStructureChooser extends JPanel implements
         if (sourceTabbedPane.getTitleAt(index)
                 .equals(foundStructureSummary))
         {
+          btn_cancel.setEnabled(true);
           if (wantedFieldsUpdated())
           {
             tabRefresh();