Search in sources :

Example 1 with ProjectExplorerContentQuery

use of org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery in project kie-wb-common by kiegroup.

the class ProjectExplorerContentResolverTest method getContentQuery.

private ProjectExplorerContentQuery getContentQuery(final Branch branch, final Module module, final Option content, final Package pkg, final FolderItem item) {
    final ProjectExplorerContentQuery projectExplorerContentQuery = new ProjectExplorerContentQuery(repository, branch, module, pkg, item);
    final ActiveOptions options = new ActiveOptions();
    options.add(Option.TREE_NAVIGATOR);
    options.add(Option.EXCLUDE_HIDDEN_ITEMS);
    options.add(content);
    projectExplorerContentQuery.setOptions(options);
    return projectExplorerContentQuery;
}
Also used : ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery)

Example 2 with ProjectExplorerContentQuery

use of org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery in project kie-wb-common by kiegroup.

the class ProjectExplorerContentResolverTest method testChangeModuleOnTechnicalViewWhenThereIsAFolderItemButNoActiveModuleOrganizationalUnitOrRepository.

@Test
public void testChangeModuleOnTechnicalViewWhenThereIsAFolderItemButNoActiveModuleOrganizationalUnitOrRepository() {
    resolver.resolve(getContentQuery(mainBranch, createModule("main", mainBranch, "module 1"), Option.TECHNICAL_CONTENT));
    helperWrapper.reset();
    ProjectExplorerContentQuery projectExplorerContentQuery = new ProjectExplorerContentQuery(null, null, null, null, getFileItem());
    ActiveOptions options = new ActiveOptions();
    options.add(Option.TECHNICAL_CONTENT);
    projectExplorerContentQuery.setOptions(options);
    helperWrapper.excludePackage();
    Content content = resolver.setupSelectedItems(projectExplorerContentQuery);
    helperWrapper.reset();
    assertEquals("main", content.getSelectedProject().getBranch().getName());
    assertEquals("main@module 1", content.getSelectedModule().getRootPath().toURI());
    assertNotNull(content.getSelectedItem());
    assertNull(content.getSelectedPackage());
}
Also used : ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) ProjectExplorerContent(org.kie.workbench.common.screens.explorer.model.ProjectExplorerContent) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery) Test(org.junit.Test)

Example 3 with ProjectExplorerContentQuery

use of org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery in project kie-wb-common by kiegroup.

the class ActiveContextManager method initActiveContext.

public void initActiveContext(final Repository repository, final Branch branch) {
    view.showBusyIndicator(CommonConstants.INSTANCE.Loading());
    refresh(new ProjectExplorerContentQuery(repository, branch));
}
Also used : ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery)

Example 4 with ProjectExplorerContentQuery

use of org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery in project kie-wb-common by kiegroup.

the class ProjectExplorerContentResolverTest method testResolveWithOUWithRepositoryNullQueryBusinessView.

@Test
public void testResolveWithOUWithRepositoryNullQueryBusinessView() throws Exception {
    final ProjectExplorerContentQuery query = new ProjectExplorerContentQuery(repository, mainBranch);
    final ActiveOptions options = new ActiveOptions();
    options.add(Option.TREE_NAVIGATOR);
    options.add(Option.EXCLUDE_HIDDEN_ITEMS);
    options.add(Option.BUSINESS_CONTENT);
    query.setOptions(options);
    resolver.resolve(query);
}
Also used : ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery) Test(org.junit.Test)

Example 5 with ProjectExplorerContentQuery

use of org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery in project kie-wb-common by kiegroup.

the class ProjectExplorerContentResolverTest method testResolveWithOUWithRepositoryNullQueryTechnicalView.

@Test
public void testResolveWithOUWithRepositoryNullQueryTechnicalView() throws Exception {
    final ProjectExplorerContentQuery query = new ProjectExplorerContentQuery(repository, mainBranch);
    final ActiveOptions options = new ActiveOptions();
    options.add(Option.TREE_NAVIGATOR);
    options.add(Option.EXCLUDE_HIDDEN_ITEMS);
    options.add(Option.TECHNICAL_CONTENT);
    query.setOptions(options);
    resolver.resolve(query);
}
Also used : ActiveOptions(org.kie.workbench.common.screens.explorer.service.ActiveOptions) ProjectExplorerContentQuery(org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery) Test(org.junit.Test)

Aggregations

ProjectExplorerContentQuery (org.kie.workbench.common.screens.explorer.service.ProjectExplorerContentQuery)9 ActiveOptions (org.kie.workbench.common.screens.explorer.service.ActiveOptions)5 Test (org.junit.Test)3 Branch (org.guvnor.structure.repositories.Branch)2 Path (org.uberfire.backend.vfs.Path)2 Module (org.guvnor.common.services.project.model.Module)1 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)1 Repository (org.guvnor.structure.repositories.Repository)1 ProjectExplorerContent (org.kie.workbench.common.screens.explorer.model.ProjectExplorerContent)1