public boolean canShowTag() { return options.contains( Option.SHOW_TAG_FILTER ); }
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; }
protected List<FolderItem> getFolderItems(Option... options) { final ActiveOptions activeOptions = new ActiveOptions(options); return helper.getItems(pkg, activeOptions); }
@Override public boolean error( Object o, Throwable throwable ) { if ( options.isEmpty() ) { addDefaultOptions(); } configCommand.execute(); return false; } };
public void init( final PlaceRequest placeRequest, final Command completeCommand ) { this.placeRequest = placeRequest; Set<Option> optionsFromModeParameter = getOptionsFromModeParameter( placeRequest.getParameter( "mode", "" ) ); if ( optionsFromModeParameter.isEmpty() ) { options.addAll( getOptionsFromModeParameter( getWindowParameter( "explorer_mode" ) ) ); } else { options.addAll( optionsFromModeParameter ); } if ( options.isEmpty() ) { load( completeCommand ); } else { completeCommand.execute(); } }
public void activateTagFiltering() { options.add( Option.SHOW_TAG_FILTER ); activeContextOptionsChangedEvent.fire( new ActiveOptionsChangedEvent() ); }
private void addDefaultOptions() { options.addAll( Option.BUSINESS_CONTENT, Option.BREADCRUMB_NAVIGATOR, Option.EXCLUDE_HIDDEN_ITEMS ); }
public void setOptions(final ActiveOptions options) { this.options.clear(); this.options.addAll(options.getValues()); }
public void disableTagFiltering() { options.remove( Option.SHOW_TAG_FILTER ); activeContextOptionsChangedEvent.fire( new ActiveOptionsChangedEvent() ); }
@Test public void testResolveWithOUWithRepositoryNullQueryTechnicalView() throws Exception { final ProjectExplorerContentQuery query = new ProjectExplorerContentQuery(repository, masterBranch); 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); }
@Before public void setup() { when(view.getExplorer()).thenReturn(mock(Explorer.class)); when(explorerServiceActual.getContent(any(ProjectExplorerContentQuery.class))).thenReturn(content); when(activeOptions.getOptions()).thenReturn(new ActiveOptions()); }
@Test public void testParametersInPlaceRequest_business_tree() throws Exception { Command completeCommand = mock( Command.class ); PlaceRequest placeRequest = mock( PlaceRequest.class ); when( placeRequest.getParameter( "mode", "" ) ).thenReturn( "business_tree" ); options.init( placeRequest, completeCommand ); assertFalse( options.getOptions().isEmpty() ); assertTrue( options.isBusinessViewActive() ); assertTrue( options.isTreeNavigatorVisible() ); assertFalse( options.areHiddenFilesVisible() ); verify( completeCommand ).execute(); } }
@Test public void testResolveWithOUWithRepositoryNullQueryBusinessView() throws Exception { final ProjectExplorerContentQuery query = new ProjectExplorerContentQuery(repository, masterBranch); 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); }
public boolean isBusinessViewActive() { return options.contains( Option.BUSINESS_CONTENT ); }
@Before public void setup() { when(view.getExplorer()).thenReturn(mock(Explorer.class)); when(explorerServiceActual.getContent(any(ProjectExplorerContentQuery.class))).thenReturn(content); when(activeContextOptions.getOptions()).thenReturn(new ActiveOptions()); }
@Test public void testNoParameters() throws Exception { Command completeCommand = mock( Command.class ); options.init( mock( PlaceRequest.class ), completeCommand ); assertFalse( options.getOptions().isEmpty() ); assertTrue( options.isBusinessViewActive() ); assertTrue( options.isBreadCrumbNavigationVisible() ); assertFalse( options.areHiddenFilesVisible() ); verify( completeCommand ).execute(); }
private ProjectExplorerContentQuery getContentQuery(final Repository repository, final String branchName, final Module module) { final Branch branch = new Branch(branchName, mock(Path.class)); final ProjectExplorerContentQuery moduleExplorerContentQuery = new ProjectExplorerContentQuery(repository, branch, module); doReturn(new WorkspaceProject(mock(OrganizationalUnit.class), repository, branch, module)).when(projectService).resolveProject(repository.getSpace(), branch); final ActiveOptions options = new ActiveOptions(); options.add(Option.TREE_NAVIGATOR); options.add(Option.EXCLUDE_HIDDEN_ITEMS); options.add(Option.BUSINESS_CONTENT); moduleExplorerContentQuery.setOptions(options); return moduleExplorerContentQuery; }