2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 The Jalview Authors
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/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.ws.jws2.dm;
21 import jalview.ws.jws2.ParameterUtils;
22 import jalview.ws.params.OptionI;
24 import java.net.MalformedURLException;
26 import java.util.List;
28 import compbio.metadata.Option;
30 public class JabaOption implements jalview.ws.params.OptionI
32 public JabaOption(Option rg)
40 public String getValue()
42 return opt.getDefaultValue();
46 public String getName()
52 public URL getFurtherDetails()
55 return new URL(opt.getBasicURL().toExternalForm()+"/"+opt.getFurtherDetails());
57 catch (NullPointerException q) {}
58 catch (MalformedURLException q)
66 public boolean isRequired()
68 return opt.isRequired();
72 public String getDescription()
74 return opt.getDescription();
78 public List<String> getPossibleValues()
80 // TODO: assert typesafety
81 return opt.getPossibleValues();
85 public void setValue(String selectedItem)
89 opt.setDefaultValue(selectedItem);
94 "Implementation error: cannot set Jaba Option to a value outside its allowed value range!");
101 return new JabaOption(ParameterUtils.copyOption(opt));
105 * get the underlying Jaba option or parameter object. Note - use copy first
106 * if you want to modify the value of the option.
110 public Option getOption()