{
if (validateViewerPath())
{
- Cache.setProperty(
- structViewer.getSelectedItem().equals(
- ViewerType.CHIMERAX.name()) ? CHIMERAX_PATH
- : CHIMERA_PATH,
- structureViewerPath.getText());
+ String path = structureViewerPath.getText();
+ try {
+ ViewerType type = ViewerType.valueOf(viewerType);
+ switch (type)
+ {
+ case JMOL:
+ break;
+ case CHIMERA:
+ Cache.setProperty(CHIMERA_PATH, path);
+ break;
+ case CHIMERAX:
+ Cache.setProperty(CHIMERAX_PATH, path);
+ break;
+ case PYMOL:
+ Cache.setProperty(PYMOL_PATH, path);
+ break;
+ }
+ } catch (IllegalArgumentException x)
+ {
+ Cache.log.error("Failed to set path - unknown viewer type",x);
+ }
}
}
});