XBayaLabel hostIdLabel = new XBayaLabel("Host ID", this.hostIdTextField);
XBayaLabel hostAddressLabel = new XBayaLabel("Host Address", this.hostAddressTextField);
cmbResourceProtocol = new JComboBox(new String[]{REMOTE_PROTOCOL_STR_LOCAL,REMOTE_PROTOCOL_STR_SSH,REMOTE_PROTOCOL_STR_GLOBUS,REMOTE_PROTOCOL_STR_UNICORE,REMOTE_PROTOCOL_STR_AMAZON_EC2, REMOTE_PROTOCOL_STR_HADOOP});
JLabel lblResourceProtocol = new JLabel("Resource Protocol");
GridPanel pnlResourceProtocolSelection=new GridPanel();
pnlResourceProtocolSelection.add(lblResourceProtocol);
pnlResourceProtocolSelection.add(cmbResourceProtocol);
pnlResourceProtocolSelection.layout(1, 2, 0, 1);
cmbResourceProtocol.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
updateRemoteProtocolTypeAndControls();
}
});
hostIdTextField.getSwingComponent().addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
updateDialogStatus();
}
});
hostAddressTextField.getSwingComponent().addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
updateDialogStatus();
}
});
GridPanel infoPanel1 = new GridPanel();
infoPanel1.add(hostIdLabel);
infoPanel1.add(this.hostIdTextField);
infoPanel1.add(hostAddressLabel);
infoPanel1.add(this.hostAddressTextField);
// infoPanel1.add(chkGobusHost);
infoPanel2 = new GridPanel();
infoPanel2.add(createPanelWithMessage("Initializing..."));
SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE, 1);
GridPanel infoPanel = new GridPanel();
infoPanel.add(infoPanel1);
infoPanel.add(pnlResourceProtocolSelection);
infoPanel.add(infoPanel2);
infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 3, 1, SwingUtil.WEIGHT_NONE, 0);
GridPanel buttonPanel = new GridPanel();
lblError = new JLabel();
lblError.setForeground(Color.RED);
buttonPanel.add(lblError);
okButton = new JButton("Save");
if (!isNewHost()) {
okButton.setText("Update");
}
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ok();
}
});
buttonPanel.add(okButton);
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
close();
}
});
buttonPanel.add(cancelButton);
buttonPanel.layout(1,3,SwingUtil.WEIGHT_NONE,0);
buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
getContentPane().add(infoPanel.getSwingComponent());
getContentPane().add(buttonPanel.getSwingComponent());
SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
getRootPane().setDefaultButton(okButton);
cmbResourceProtocol.setSelectedIndex(0);