blob: 4a49d4be4b91e339ffd3e7a4689f083728136d66 [file] [log] [blame]
{
"http://purl.org/dc/terms/rights": "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
"http://purl.org/dc/terms/license": {"@id": "http://www.apache.org/licenses/LICENSE-2.0"},
"classLoaderSharing" : "workflow",
"script" : "import javax.swing.BoxLayout;\nimport javax.swing.ButtonGroup;\nimport javax.swing.JLabel;\nimport javax.swing.JOptionPane;\nimport javax.swing.JPanel;\nimport javax.swing.JRadioButton;\n\nif ((selectionValues == void) || (selectionValues == null) || (selectionValues.isEmpty())) {\n throw new RuntimeException(\"selectionValues must be specified and non-empty\");\n}\n\nButtonGroup group = new ButtonGroup();\nJPanel messagePanel = new JPanel();\nmessagePanel.setLayout(new BoxLayout(messagePanel,BoxLayout.Y_AXIS));\n\nmessagePanel.add(new JLabel((message == void ? null : message)));\n\t\t\nJRadioButton[] buttonArray = new JRadioButton[selectionValues.size()];\nfor (int i = 0; i < buttonArray.length; i++) {\t\t\t\n\tbuttonArray[i] = new JRadioButton(selectionValues.get(i));\n\tif (i==0) buttonArray[i].setSelected(true);\n\tgroup.add(buttonArray[i]);\n\tmessagePanel.add(buttonArray[i]);\n}\t\t\t\t\n\nJOptionPane.showOptionDialog(null, messagePanel, (title == void ? null : title),\n\t\tJOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{\"OK\"}, null);\n\t\t\nString answer=\"\";\nfor (JRadioButton button : buttonArray) {\n\tif (button.isSelected()) {\n\t\tanswer=button.getText();\n\t}\n}\n",
"localworkerName" : "net.sourceforge.taverna.scuflworkers.ui.ChooseWorker",
"inputPorts" : [ {
"name" : "title",
"depth" : 0,
"type" : "String"
}, {
"name" : "message",
"depth" : 0,
"type" : "String"
}, {
"name" : "selectionValues",
"depth" : 1,
"type" : "String"
} ],
"outputPorts" : [ {
"name" : "answer",
"depth" : 0,
"granularDepth" : 0
} ],
"isAltered" : false
}