2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.ws.jws2.dm;
20 import jalview.ws.jws2.ParameterUtils;
21 import jalview.ws.params.OptionI;
23 import java.net.MalformedURLException;
25 import java.util.List;
27 import compbio.metadata.Option;
29 public class JabaOption implements jalview.ws.params.OptionI
31 public JabaOption(Option rg)
39 public String getValue()
41 return opt.getDefaultValue();
45 public String getName()
51 public URL getFurtherDetails()
54 return new URL(opt.getBasicURL().toExternalForm()+"/"+opt.getFurtherDetails());
56 catch (NullPointerException q) {}
57 catch (MalformedURLException q)
65 public boolean isRequired()
67 return opt.isRequired();
71 public String getDescription()
73 return opt.getDescription();
77 public List<String> getPossibleValues()
79 // TODO: assert typesafety
80 return opt.getPossibleValues();
84 public void setValue(String selectedItem)
88 opt.setDefaultValue(selectedItem);
93 "Implementation error: cannot set Jaba Option to a value outside its allowed value range!");
100 return new JabaOption(ParameterUtils.copyOption(opt));
104 * get the underlying Jaba option or parameter object. Note - use copy first
105 * if you want to modify the value of the option.
109 public Option getOption()