// Creating an object associated with each member
for ( IConfigurationElement member : members )
{
// Creating the LdapServerAdapterExtension object container
LdapServerAdapterExtension ldapServerAdapterExtension = new LdapServerAdapterExtension();
// Getting the ID of the extending plugin
String extendingPluginId = member.getDeclaringExtension().getNamespaceIdentifier();
// Setting each parameter to the LDAP Server Adapter Extension
ldapServerAdapterExtension.setExtensionPointConfiguration( member );
ldapServerAdapterExtension.setId( member.getAttribute( ID_ATTR ) );
ldapServerAdapterExtension.setName( member.getAttribute( NAME_ATTR ) );
ldapServerAdapterExtension.setVersion( member.getAttribute( VERSION_ATTR ) );
ldapServerAdapterExtension.setVendor( member.getAttribute( VENDOR_ATTR ) );
ldapServerAdapterExtension.setClassName( member.getAttribute( CLASS_ATTR ) );
try
{
ldapServerAdapterExtension.setInstance( ( LdapServerAdapter ) member
.createExecutableExtension( CLASS_ATTR ) );
}
catch ( CoreException e )
{
// Will never happen
}
ldapServerAdapterExtension.setDescription( member.getAttribute( DESCRIPTION_ATTR ) );
String iconPath = member.getAttribute( ICON_ATTR );
if ( iconPath != null )
{
ImageDescriptor icon = AbstractUIPlugin.imageDescriptorFromPlugin( extendingPluginId, iconPath );
if ( icon == null )
{
icon = ImageDescriptor.getMissingImageDescriptor();
}
ldapServerAdapterExtension.setIcon( icon );
}
ldapServerAdapterExtension.setConfigurationPageClassName( member.getAttribute( CONFIGURATION_PAGE_ATTR ) );
String openConfigurationActionEnabled = member.getAttribute( OPEN_CONFIGURATION_ACTION_ENABLED_ATTR );
if ( openConfigurationActionEnabled != null )
{
ldapServerAdapterExtension.setOpenConfigurationActionEnabled( Boolean
.parseBoolean( openConfigurationActionEnabled ) );
}
else
{
// Enabled by default
ldapServerAdapterExtension.setOpenConfigurationActionEnabled( true );
}
ldapServerAdapterExtensionsList.add( ldapServerAdapterExtension );
ldapServerAdapterExtensionsByIdMap.put( ldapServerAdapterExtension.getId(), ldapServerAdapterExtension );
}
}