class EditorTreeProvider implements PermissionTreeProvider {

    public void registerEditor(final String editorId,
                               final String editorName) {
        final SyncBeanDef<Activity> editorBeanDef = activityBeansCache.getActivity(editorId);
        WorkbenchEditorActivity editor = null;
        if (editorBeanDef != null) {
            try {
                editor = (WorkbenchEditorActivity) editorBeanDef.getInstance();

                // We only need the Editor's Resource definition and not an Editor instance itself as
                // this can interfere with Event handling across multiple instances at runtime. Therefore
                // extract the required information before disposing of the Editor instance.
                final String identifier = editor.getIdentifier();
                final ResourceType resourceType = editor.getResourceType();
                final Resource resource = new Resource() {
                    @Override
                    public String getIdentifier() {
                        return identifier;
                    }

                    @Override
                    public ResourceType getResourceType() {
                        return resourceType;
                    }
                };
                registeredEditors.add(new RegisteredEditor(editorId,
                                                           editorName,
                                                           resource));
            } finally {
                if (editor != null) {
                    iocManager.destroyBean(editor);
                }
            }
        }
    }

    public  EditorTreeProvider();
    @Inject public  EditorTreeProvider(final ActivityBeansCache activityBeansCache,
                              final SyncBeanManager iocManager,
                              final PermissionManager permissionManager,
                              final PermissionTreeI18n i18n);

}