class ProjectExplorerContentResolver {

    public ProjectExplorerContent resolve(final ProjectExplorerContentQuery query) {

        final Content content = setupSelectedItems(query);

        //Content may contain invalid state, e.g. Repository deleted, Module deleted etc so validate and reset as appropriate
        setSelectedModule(content);
        setSelectedPackage(content);
        setSelectedItem(content);

        if (content.getSelectedProject() == null || content.getSelectedModule() == null) {
            return emptyModuleExplorerContent(content);
        } else {
            return moduleExplorerContentWithSelections(content,
                                                       query.getOptions());
        }
    }

    @Inject public  ProjectExplorerContentResolver(final KieModuleService moduleService,
                                          final ExplorerServiceHelper helper,
                                          final ExplorerServiceHelper explorerServiceHelper,
                                          final WorkspaceProjectService projectService);

}