in taverna-external-tool-activity-ui/src/main/java/org/apache/taverna/activities/externaltool/views/StaticUrlPanel.java [54:109]
public StaticUrlPanel(final List<ExternalToolStaticUrlViewer> staticUrlViewList) {
super(new BorderLayout());
this.staticUrlViewList = staticUrlViewList;
final JPanel staticEditPanel = new JPanel(new GridBagLayout());
final GridBagConstraints staticConstraint = new GridBagConstraints();
staticConstraint.insets = new Insets(5, 5, 5, 5);
staticConstraint.anchor = GridBagConstraints.FIRST_LINE_START;
staticConstraint.gridx = 0;
staticConstraint.gridy = 0;
staticConstraint.weightx = 0.1;
staticConstraint.fill = GridBagConstraints.BOTH;
staticConstraint.gridx = 0;
synchronized (staticUrlViewList) {
for (ExternalToolStaticUrlViewer staticView : staticUrlViewList) {
addStaticUrlViewer(this, staticEditPanel,
staticView);
}
}
this.add(new JScrollPane(staticEditPanel),
BorderLayout.CENTER);
JTextArea descriptionText = new ReadOnlyTextArea(
STATIC_URL_DESCRIPTION);
descriptionText.setEditable(false);
descriptionText.setFocusable(false);
descriptionText.setBorder(new EmptyBorder(5, 5, 10, 5));
this.add(descriptionText, BorderLayout.NORTH);
JButton addstaticPortButton = new DeselectingButton("Add URL",
new AbstractAction() {
// FIXME refactor this into a method
public void actionPerformed(ActionEvent e) {
ExternalToolStaticUrlViewer newViewer = new ExternalToolStaticUrlViewer();
synchronized (staticUrlViewList) {
staticUrlViewList.add(newViewer);
addStaticUrlViewer(StaticUrlPanel.this, staticEditPanel,
newViewer);
staticEditPanel.revalidate();
staticEditPanel.repaint();
}
}
});
JPanel buttonPanel = new JPanel(new BorderLayout());
buttonPanel.add(addstaticPortButton, BorderLayout.EAST);
this.add(buttonPanel, BorderLayout.SOUTH);
}