"Selection error",JOptionPane.ERROR_MESSAGE);
return;
}
DefaultMutableTreeNode node = (DefaultMutableTreeNode) getModel().getRoot();
NamingContextExt context = rootContext;
if (length>1)
{
for (int i = 1;i<length;i++)
{
node = (DefaultMutableTreeNode) path.getPathComponent(i);
ContextNode bind = (ContextNode) node.getUserObject();
context = NamingContextExtHelper.narrow( context.resolve( bind.getName()));
if( context == null )
{
System.err.println("Naming context narrow failed!");
System.exit(1);
}
}
}
if (node.getAllowsChildren())
{
Name bindname = new Name(name);
if( context == null )
System.err.println("context null ");
if( bindname.components() == null )
System.err.println("name is null ");
try
{
context.bind( bindname.components(), orb.string_to_object( ior ));
}
catch( AlreadyBound ab )
{
if (isRebind)
context.rebind( bindname.components(), orb.string_to_object( ior ));
else
throw ab;
}
update();
}