class PluginsInfo {

    public Map<ClientResourceType, Set<Activity>> getClassifiedPlugins(final Collection<Plugin> plugins) {

        final Map<ClientResourceType, Set<Activity>> classified = new LinkedHashMap<ClientResourceType, Set<Activity>>();

        classified.put(perspectiveLayoutPluginResourceType,
                       new HashSet<Activity>());
        classified.put(screenPluginResourceType,
                       new HashSet<Activity>());
        classified.put(editorPluginResourceType,
                       new HashSet<Activity>());
        classified.put(splashPluginResourceType,
                       new HashSet<Activity>());
        classified.put(dynamicMenuResourceType,
                       new HashSet<Activity>());

        for (final String screenId : activityBeansInfo.getAvailableWorkbenchScreensIds()) {
            classified.get(screenPluginResourceType).add(new Activity(screenId,
                                                                      PluginType.SCREEN));
        }

        for (final String perspectiveId : activityBeansInfo.getAvailablePerspectivesIds()) {
            classified.get(perspectiveLayoutPluginResourceType).add(new Activity(perspectiveId,
                                                                                 PluginType.PERSPECTIVE));
        }

        for (final String editorId : activityBeansInfo.getAvailableWorkbenchEditorsIds()) {
            classified.get(editorPluginResourceType).add(new Activity(editorId,
                                                                      PluginType.EDITOR));
        }

        for (final String splashId : activityBeansInfo.getAvailableSplashScreensIds()) {
            classified.get(splashPluginResourceType).add(new Activity(splashId,
                                                                      PluginType.SPLASH));
        }

        for (final Plugin plugin : plugins) {
            final ClientResourceType type = clientTypeRegistry.resolve(plugin.getPath());
            if (type != null) {
                classified.get(type).add(plugin);
            }
        }

        final Collection<SyncBeanDef<JSWorkbenchScreenActivity>> jsscreens = lookupBeans(JSWorkbenchScreenActivity.class);
        for (final SyncBeanDef<JSWorkbenchScreenActivity> beanDef : jsscreens) {
            classified.get(screenPluginResourceType).add(new Activity(beanDef.getName(),
                                                                      PluginType.SCREEN));
        }

        final Collection<SyncBeanDef<JSWorkbenchPerspectiveActivity>> jsperspectives = lookupBeans(JSWorkbenchPerspectiveActivity.class);
        for (final SyncBeanDef<JSWorkbenchPerspectiveActivity> beanDef : jsperspectives) {
            classified.get(perspectiveLayoutPluginResourceType).add(new Activity(beanDef.getName(),
                                                                                 PluginType.PERSPECTIVE));
        }

        final Collection<SyncBeanDef<JSEditorActivity>> jseditors = lookupBeans(JSEditorActivity.class);
        for (final SyncBeanDef<JSEditorActivity> beanDef : jseditors) {
            classified.get(editorPluginResourceType).add(new Activity(beanDef.getName(),
                                                                      PluginType.EDITOR));
        }

        final Collection<SyncBeanDef<JSSplashScreenActivity>> jssplashes = lookupBeans(JSSplashScreenActivity.class);
        for (final SyncBeanDef<JSSplashScreenActivity> beanDef : jssplashes) {
            classified.get(splashPluginResourceType).add(new Activity(beanDef.getName(),
                                                                      PluginType.SPLASH));
        }

        return classified;
    }

    public  PluginsInfo();
    @Inject public  PluginsInfo(EditorPluginResourceType editorPluginResourceType,
                       PerspectiveLayoutPluginResourceType perspectiveLayoutPluginResourceType,
                       ScreenPluginResourceType screenPluginResourceType,
                       SplashPluginResourceType splashPluginResourceType,
                       DynamicMenuResourceType dynamicMenuResourceType,
                       ActivityBeansInfo activityBeansInfo,
                       ClientTypeRegistry clientTypeRegistry);

}