private final JSONObject toJSON( Resource resource, Bundle[] bundles, boolean details ) throws JSONException
{
final String symbolicName = resource.getSymbolicName();
final Version version = resource.getVersion();
String installed = "";
for ( int i = 0; symbolicName != null && installed.length() == 0 && bundles != null && i < bundles.length; i++ )
{
final Version ver = bundles[i].getVersion();
if ( symbolicName.equals(bundles[i].getSymbolicName()))
{
installed = ver.toString();
}
}
JSONObject json = new JSONObject()
.put( "id", resource.getId() ) // //$NON-NLS-1$
.put( "presentationname", resource.getPresentationName() ) // //$NON-NLS-1$