From 23278fe32b704fa2d246d34ac17699e9555d00ee Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Fri, 21 Aug 2015 14:59:19 +0100 Subject: [PATCH] JAL-1834 disabled action buttons (Back / Ok / Cancel) when in 'Configure Displayed Columns' tab --- src/jalview/jbgui/GPDBSearchPanel.java | 6 +++++- src/jalview/jbgui/GStructureChooser.java | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/jalview/jbgui/GPDBSearchPanel.java b/src/jalview/jbgui/GPDBSearchPanel.java index 08a620a..473f634 100644 --- a/src/jalview/jbgui/GPDBSearchPanel.java +++ b/src/jalview/jbgui/GPDBSearchPanel.java @@ -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(); diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index 9e4e6f3..caba85f 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -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(); -- 1.7.10.2