in taverna-rest-activity-ui/src/main/java/org/apache/taverna/activities/rest/ui/config/RESTActivityConfigurationPanel.java [532:677]
private JPanel createAdvancedTab() {
JPanel jpAdvanced = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(8, 10, 2, 4);
JLabel jlExpectHeaderInfoIcon = new JLabel(infoIcon);
jlExpectHeaderInfoIcon
.setToolTipText("<html>Ticking this checkbox may significantly improve performance when<br>"
+ "large volumes of data are sent to the remote server and a redirect<br>"
+ "from the original URL to the one specified by the server is likely.<br>"
+ "<br>"
+ "However, this checkbox <b>must not</b> be ticked to allow this activity<br>"
+ "to post updates to Twitter.</html>");
jpAdvanced.add(jlExpectHeaderInfoIcon, c);
c.gridx++;
c.weightx = 1.0;
c.insets = new Insets(8, 0, 2, 8);
cbSendHTTPExpectHeader = new JCheckBox(
"Send HTTP Expect request-header field");
jpAdvanced.add(cbSendHTTPExpectHeader, c);
c.gridx = 0;
c.gridy++;
c.weightx = 0;
c.insets = new Insets(2, 10, 5, 4);
JLabel jlShowRedirectionOutputPortInfoIcon = new JLabel(infoIcon);
jlShowRedirectionOutputPortInfoIcon
.setToolTipText("<html>\"Redirection\" output port displays the URL of the final redirect<br>"
+ "that has yielded the output data on the \"Response Body\" port.</html>");
jpAdvanced.add(jlShowRedirectionOutputPortInfoIcon, c);
c.gridx++;
c.weightx = 1.0;
c.insets = new Insets(2, 0, 5, 8);
cbShowRedirectionOutputPort = new JCheckBox(
"Show \"Redirection\" output port");
jpAdvanced.add(cbShowRedirectionOutputPort, c);
c.gridx = 0;
c.gridy++;
c.weightx = 0;
c.insets = new Insets(2, 10, 5, 4);
JLabel jlShowActualUrlPortInfoIcon = new JLabel(infoIcon);
jlShowActualUrlPortInfoIcon
.setToolTipText("<html>\"Actual URL\" output port displays the URL used by the REST service<br>"
+ "with the actual parameter values.</html>");
jpAdvanced.add(jlShowActualUrlPortInfoIcon, c);
c.gridx++;
c.weightx = 1.0;
c.insets = new Insets(2, 0, 5, 8);
cbShowActualUrlPort = new JCheckBox(
"Show \"Actual URL\" output port");
jpAdvanced.add(cbShowActualUrlPort, c);
c.gridx = 0;
c.gridy++;
c.weightx = 0;
c.insets = new Insets(2, 10, 5, 4);
JLabel jlShowResponseHeadersPortInfoIcon = new JLabel(infoIcon);
jlShowResponseHeadersPortInfoIcon
.setToolTipText("<html>\"Response headers\" output port displays the HTTP headers<br>"
+ "received from the final (after redirection) HTTP call.</html>");
jpAdvanced.add(jlShowResponseHeadersPortInfoIcon, c);
c.gridx++;
c.weightx = 1.0;
c.insets = new Insets(2, 0, 5, 8);
cbShowResponseHeadersPort = new JCheckBox(
"Show \"Response headers\" output port");
jpAdvanced.add(cbShowResponseHeadersPort, c);
c.gridx = 0;
c.gridy++;
c.weightx = 0;
c.insets = new Insets(2, 10, 5, 4);
JLabel jlEscapeParametersInfoIcon = new JLabel(infoIcon);
jlEscapeParametersInfoIcon
.setToolTipText("<html>Determines if parameters you pass to form the full URL<br>" +
" of the REST service will be URL-escaped.</html>");
jpAdvanced.add(jlEscapeParametersInfoIcon, c);
c.gridx++;
c.weightx = 1.0;
c.insets = new Insets(2, 0, 5, 8);
cbEscapeParameters = new JCheckBox("Escape URL parameter values");
jpAdvanced.add(cbEscapeParameters, c);
c.gridx = 0;
c.gridy++;
c.weightx = 0;
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.NONE;
c.insets = new Insets(2, 10, 5, 4);
JLabel jlHTTPHeadersInfoIcon = new JLabel(infoIcon);
jlHTTPHeadersInfoIcon
.setToolTipText("<html>Set additional HTTP headers</html>");
jpAdvanced.add(jlHTTPHeadersInfoIcon, c);
c.gridx = 1;
c.weightx = 0;
c.weighty = 0;
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.NONE;
c.insets = new Insets(2, 10, 5, 4);
addHeaderButton = new JButton("Add HTTP header");
addHeaderButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
httpHeadersTableModel.addEmptyRow();
httpHeadersTable.getSelectionModel().setSelectionInterval(httpHeadersTableModel.getRowCount() - 1, httpHeadersTableModel.getRowCount() - 1); }
});
removeHeaderButton = new JButton("Remove HTTP header");
removeHeaderButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int row = httpHeadersTable.getSelectedRow();
httpHeadersTableModel.removeRow(row);
}
});
JPanel buttonPanel = new JPanel();
buttonPanel.add(addHeaderButton, FlowLayout.LEFT);
buttonPanel.add(removeHeaderButton);
jpAdvanced.add(buttonPanel, c);
c.gridx = 1;
c.gridy++;
c.weightx = 0;
c.weighty = 1.0;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(2, 10, 5, 4);
httpHeadersTableModel = new HTTPHeadersTableModel();
httpHeadersTable = new JTable(httpHeadersTableModel);
httpHeadersTable.setGridColor(Color.GRAY);
httpHeadersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
setVisibleRowCount(httpHeadersTable, 3);
JScrollPane headersTableScrollPane = new JScrollPane(httpHeadersTable);
jpAdvanced.add(headersTableScrollPane, c);
return (jpAdvanced);
}