ConnectionFolderDialog dialog = new ConnectionFolderDialog( PlatformUI.getWorkbench().getDisplay()
.getActiveShell(), "New Connection Folder", "Please enter the name of the new connection folder:", "", null );
if ( dialog.open() == CredentialsDialog.OK )
{
String name = dialog.getValue();
ConnectionFolder folder = new ConnectionFolder( name );
ConnectionCorePlugin.getDefault().getConnectionFolderManager().addConnectionFolder( folder );
ConnectionFolder[] folders = getSelectedConnectionFolders();
if ( folders != null && folders.length > 0 )
{
folders[0].addSubFolderId( folder.getId() );
}
else
{
ConnectionCorePlugin.getDefault().getConnectionFolderManager().getRootConnectionFolder()
.addSubFolderId( folder.getId() );
}
}
}