- if (isStructuresDiscovered())
- {
- cmb_filterOption.addItem(new FilterOption("Best Quality",
- PDBDocField.OVERALL_QUALITY.getCode(), VIEWS_FILTER));
- cmb_filterOption.addItem(new FilterOption("Best UniProt Coverage",
- PDBDocField.UNIPROT_COVERAGE.getCode(), VIEWS_FILTER));
- cmb_filterOption.addItem(new FilterOption("Highest Resolution",
- PDBDocField.RESOLUTION.getCode(), VIEWS_FILTER));
- cmb_filterOption.addItem(new FilterOption("Highest Protein Chain",
- PDBDocField.PROTEIN_CHAIN_COUNT.getCode(), VIEWS_FILTER));
- cmb_filterOption.addItem(new FilterOption("Highest Bound Molecules",
- PDBDocField.BOUND_MOLECULE_COUNT.getCode(), VIEWS_FILTER));
- cmb_filterOption.addItem(new FilterOption("Highest Polymer Residues",
- PDBDocField.POLYMER_RESIDUE_COUNT.getCode(), VIEWS_FILTER));
- }
- cmb_filterOption.addItem(new FilterOption("Enter PDB Id", "-",
- VIEWS_ENTER_ID));
- cmb_filterOption.addItem(new FilterOption("From File", "-",
- VIEWS_FROM_FILE));
- cmb_filterOption.addItem(new FilterOption("Cached PDB Entries", "-",
- VIEWS_LOCAL_PDB));
+ /*
+ * temporarily suspend the change listener behaviour
+ */
+ cmb_filterOption.removeItemListener(this);
+
+ cmb_filterOption.removeAllItems();
+ if (haveData)
+ {
+ cmb_filterOption.addItem(new FilterOption(
+ MessageManager.getString("label.best_quality"),
+ "overall_quality", VIEWS_FILTER, false));
+ cmb_filterOption.addItem(new FilterOption(
+ MessageManager.getString("label.best_resolution"),
+ "resolution", VIEWS_FILTER, false));
+ cmb_filterOption.addItem(new FilterOption(
+ MessageManager.getString("label.most_protein_chain"),
+ "number_of_protein_chains", VIEWS_FILTER, false));
+ cmb_filterOption.addItem(new FilterOption(
+ MessageManager.getString("label.most_bound_molecules"),
+ "number_of_bound_molecules", VIEWS_FILTER, false));
+ cmb_filterOption.addItem(new FilterOption(
+ MessageManager.getString("label.most_polymer_residues"),
+ "number_of_polymer_residues", VIEWS_FILTER, true));
+ }
+ cmb_filterOption.addItem(
+ new FilterOption(MessageManager.getString("label.enter_pdb_id"),
+ "-", VIEWS_ENTER_ID, false));
+ cmb_filterOption.addItem(
+ new FilterOption(MessageManager.getString("label.from_file"),
+ "-", VIEWS_FROM_FILE, false));
+
+ if (cachedPDBExist)
+ {
+ FilterOption cachedOption = new FilterOption(
+ MessageManager.getString("label.cached_structures"),
+ "-", VIEWS_LOCAL_PDB, false);
+ cmb_filterOption.addItem(cachedOption);
+ cmb_filterOption.setSelectedItem(cachedOption);
+ }
+
+ cmb_filterOption.addItemListener(this);