/*
- * Jalview - A Sequence Alignment Editor and Viewer (2.9.0b1)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
private boolean isValidPBDEntry;
+ private boolean cachedPDBExists;
+
public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq,
AlignmentPanel ap)
{
}
// ensure a filter option is in force for search
- populateFilterComboBox(true);
+ populateFilterComboBox(true, cachedPDBExists);
Thread discoverPDBStructuresThread = new Thread(new Runnable()
{
@Override
startTime);
fetchStructuresMetaData();
// revise filter options if no results were found
- populateFilterComboBox(isStructuresDiscovered());
+ populateFilterComboBox(isStructuresDiscovered(), cachedPDBExists);
updateProgressIndicator(null, startTime);
mainFrame.setVisible(true);
updateCurrentView();
}
}
}
-
+ cachedPDBExists = !entries.isEmpty();
PDBEntryTableModel tableModelx = new PDBEntryTableModel(entries);
tbl_local_pdb.setModel(tableModelx);
}
* Populates the filter combo-box options dynamically depending on discovered
* structures
*/
- protected void populateFilterComboBox(boolean haveData)
+ protected void populateFilterComboBox(boolean haveData,
+ boolean cachedPDBExists)
{
/*
* temporarily suspend the change listener behaviour
VIEWS_ENTER_ID));
cmb_filterOption.addItem(new FilterOption("From File", "-",
VIEWS_FROM_FILE));
- cmb_filterOption.addItem(new FilterOption("Cached PDB Entries", "-",
- VIEWS_LOCAL_PDB));
+ FilterOption cachedOption = new FilterOption("Cached PDB Entries", "-",
+ VIEWS_LOCAL_PDB);
+ cmb_filterOption.addItem(cachedOption);
+
+ if (/*!haveData &&*/cachedPDBExists)
+ {
+ cmb_filterOption.setSelectedItem(cachedOption);
+ }
cmb_filterOption.addItemListener(this);
}