2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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;
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()
53 return opt.getFurtherDetails();
57 public boolean isRequired()
59 return opt.isRequired();
63 public String getDescription()
65 return opt.getDescription();
69 public List<String> getPossibleValues()
71 // TODO: assert typesafety
72 return opt.getPossibleValues();
76 public void setValue(String selectedItem)
80 opt.setDefaultValue(selectedItem);
85 "Implementation error: cannot set Jaba Option to a value outside its allowed value range!");
92 return new JabaOption(ParameterUtils.copyOption(opt));
96 * get the underlying Jaba option or parameter object. Note - use copy first
97 * if you want to modify the value of the option.
101 public Option getOption()