2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.ws.jws2.dm;
23 import jalview.util.MessageManager;
24 import jalview.ws.jws2.ParameterUtils;
25 import jalview.ws.params.OptionI;
27 import java.net.MalformedURLException;
29 import java.util.List;
31 import compbio.metadata.Option;
33 public class JabaOption implements jalview.ws.params.OptionI
35 public JabaOption(Option rg)
43 public String getValue()
45 return opt.getDefaultValue();
49 public String getName()
55 public URL getFurtherDetails()
59 return new URL(opt.getBasicURL().toExternalForm() + "/"
60 + opt.getFurtherDetails());
61 } catch (NullPointerException q)
63 } catch (MalformedURLException q)
71 public boolean isRequired()
73 return opt.isRequired();
77 public String getDescription()
79 return opt.getDescription();
83 public List<String> getPossibleValues()
85 // TODO: assert typesafety
86 return opt.getPossibleValues();
90 public void setValue(String selectedItem)
94 opt.setDefaultValue(selectedItem);
98 throw new Error(MessageManager.getString(
99 "error.implementation_error_cannot_set_jaba_option"));
104 public OptionI copy()
106 return new JabaOption(ParameterUtils.copyOption(opt));
110 * get the underlying Jaba option or parameter object. Note - use copy first
111 * if you want to modify the value of the option.
115 public Option getOption()