jade.util.leap.Iterator temp = serviceDesc.getAllProperties();
#DOTNET_INCLUDE_END*/
Properties props = new Properties();
while(temp.hasNext())
{
Property singleProp = (Property)temp.next();
props.setProperty(singleProp.getName(),singleProp.getValue().toString());
}
propertiesListPanel = new VisualPropertiesList(props,getOwner());
propertiesListPanel.setDimension(new Dimension(350,40));
propertiesListPanel.setEnabled(editable);
p.add(propertiesListPanel);
main.add(p);
//Button Panel
p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
JButton bOK = new JButton("OK");
bOK.addActionListener( new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String param = (String) e.getActionCommand();
if (param.equals("OK"))
{
if(editable)
{
if(checkSlots)
{
if(getSaveText(txtName) == null)
{
JOptionPane.showMessageDialog(null,"The name must not be empty !","Error Message", JOptionPane.ERROR_MESSAGE);
return;
}
if(getSaveText(txtType) == null)
{
JOptionPane.showMessageDialog(null,"The type must not be empty !","Error Message",JOptionPane.ERROR_MESSAGE);
return;
}
}
out = new ServiceDescription();
out.setName(getSaveText(txtName));
out.setType(getSaveText(txtType));
out.setOwnership(getSaveText(txtOwner));
Enumeration lang = languagesListPanel.getContent();
while(lang.hasMoreElements())
out.addLanguages((String)lang.nextElement());
Enumeration onto = ontologiesListPanel.getContent();
while(onto.hasMoreElements())
out.addOntologies((String)onto.nextElement());
//Protocols
Enumeration proto = protocolsListPanel.getContent();
while(proto.hasMoreElements())
out.addProtocols((String)proto.nextElement());
Properties ps = propertiesListPanel.getContentProperties();
Enumeration keys = ps.propertyNames();
while(keys.hasMoreElements())
{
Property tp = new Property();
String key = (String)keys.nextElement();
tp.setName(key);
Object val = ps.getProperty(key);
// try if the property is a long or a float or a datetime
try {
val = Long.valueOf(val.toString());
} catch (NumberFormatException e1) {
try {
val = Double.valueOf(val.toString());
} catch (NumberFormatException e2) {
try {
val = ISO8601.toDate(val.toString());
} catch (Exception e3) {
}
}
}
// set the value of this property
tp.setValue((Serializable)val);
out.addProperties(tp);
}
}
else