public void keyReleased(KeyEvent arg0) {
setApplicationName(txtAppName.getText());
}
});
txtAppName.setColumns(10);
XBayaLabel lblApplicationName = new XBayaLabel("Application name",txtAppName);
XBayaLabel lblExecutablePath = new XBayaLabel("Executable path",txtExecPath);
GridPanel tmpDirPath=new GridPanel();
txtTempDir = new XBayaTextField();
txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
setTempDir(txtTempDir.getText());
}
});
txtTempDir.setColumns(10);
JButton tmpDirBrowse=new JButton("Browse...");
tmpDirBrowse.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
JFileChooser c = new JFileChooser();
c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int rVal = c.showOpenDialog(null);
if (rVal == JFileChooser.APPROVE_OPTION) {
txtTempDir.setText(c.getSelectedFile().toString());
setTempDir(txtTempDir.getText());
}
}
});
tmpDirPath.add(txtTempDir);
tmpDirPath.add(tmpDirBrowse);
tmpDirPath.layout(1, 2, 0, 0);
XBayaLabel lblTemporaryDirectory = new XBayaLabel("Temporary directory",txtTempDir);
JButton btnAdvance = new JButton("Advanced options...");
btnAdvance.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
ApplicationDescriptionAdvancedOptionDialog serviceDescriptionDialog = new ApplicationDescriptionAdvancedOptionDialog(
getRegistry(), getShellApplicationDescription());
serviceDescriptionDialog.open();
} catch (Exception e1) {
e1.printStackTrace();
JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
}
}
});
XBayaLinkButton lnkNewService = new XBayaLinkButton("New button");
lnkNewService.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try {
ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry());
serviceDescriptionDialog.open();
if (serviceDescriptionDialog.isServiceCreated()) {
loadServiceDescriptions();
cmbServiceName.setSelectedItem(serviceDescriptionDialog.getServiceName());
}
} catch (Exception e1) {
e1.printStackTrace();
JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
}
}
});
lnkNewService.setText("Create new service...");
lnkNewService.setHorizontalAlignment(SwingConstants.TRAILING);
cmbServiceName = new JComboBox();
cmbServiceName.addActionListener(this);
// cmbServiceName.setRenderer(new DefaultListCellRenderer());
cmbHostName = new JComboBox();
cmbHostName.addActionListener(this);
XBayaLabel lblHostName = new XBayaLabel("Host",cmbHostName);
XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
lnkNewHost.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine);
hostDescriptionDialog.open();
if (hostDescriptionDialog.isHostCreated()) {
loadHostDescriptions();
cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
}
} catch (Exception e1) {
e1.printStackTrace();
JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
}
}
});
lnkNewHost.setText("Create new host...");
lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);
XBayaLabel lblService = new XBayaLabel("Service",cmbServiceName);
JLabel lblBindThisDeployment = new JLabel("Bind this deployment description to:");
lblBindThisDeployment.setFont(new Font("Tahoma", Font.BOLD, 11));
btnHostAdvanceOptions=new JButton("Gram Configuration...");