use of org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo in project kie-wb-common by kiegroup.
the class LibraryPlaces method goToPreferences.
public void goToPreferences() {
final PreferenceScopeResolutionStrategyInfo customScopeResolutionStrategy = projectScopedResolutionStrategySupplier.get();
final PreferencesCentralInitializationEvent initEvent = new PreferencesCentralInitializationEvent("ProjectPreferences", customScopeResolutionStrategy, null);
final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(PreferencesRootScreen.IDENTIFIER);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
placeManager.goTo(part, libraryPerspective.getRootPanel());
preferencesCentralInitializationEvent.fire(initEvent);
setupLibraryBreadCrumbsForPreferences();
}
use of org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo in project kie-wb-common by kiegroup.
the class LibraryPlacesTest method goToPreferencesTest.
@Test
public void goToPreferencesTest() {
final PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo = mock(PreferenceScopeResolutionStrategyInfo.class);
doReturn(scopeResolutionStrategyInfo).when(projectScopedResolutionStrategySupplier).get();
final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(PreferencesRootScreen.IDENTIFIER);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
libraryPlaces.goToPreferences();
verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
verify(preferencesCentralInitializationEvent).fire(new PreferencesCentralInitializationEvent("ProjectPreferences", scopeResolutionStrategyInfo, null));
verify(libraryPlaces).setupLibraryBreadCrumbsForPreferences();
}
use of org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo in project kie-wb-common by kiegroup.
the class WorkbenchPreferenceScopeResolutionStrategiesImplTest method getInfoTest.
@Test
public void getInfoTest() {
final PreferenceScopeResolutionStrategyInfo scopeInfo = scopeResolutionStrategies.getUserInfoFor(null, null);
final List<PreferenceScope> order = scopeInfo.order();
assertEquals(2, order.size());
final PreferenceScope firstScope = order.get(0);
assertEquals("user", firstScope.type());
assertEquals("admin", firstScope.key());
final PreferenceScope secondScope = order.get(1);
assertEquals("global", secondScope.type());
assertEquals("global", secondScope.key());
final PreferenceScope defaultScope = scopeInfo.defaultScope();
assertEquals("user", defaultScope.type());
assertEquals("admin", defaultScope.key());
}
use of org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo in project kie-wb-common by kiegroup.
the class WorkbenchPreferenceScopeResolutionStrategiesImplTest method getInfoWithScopeTest.
@Test
public void getInfoWithScopeTest() {
final PreferenceScopeResolutionStrategyInfo scopeInfo = scopeResolutionStrategies.getUserInfoFor(WorkbenchPreferenceScopes.PROJECT, "my-project");
final List<PreferenceScope> order = scopeInfo.order();
assertEquals(3, order.size());
final PreferenceScope firstScope = order.get(0);
assertEquals("user", firstScope.type());
assertEquals("admin", firstScope.key());
assertEquals("project", firstScope.childScope().type());
assertEquals("my-project", firstScope.childScope().key());
final PreferenceScope secondScope = order.get(1);
assertEquals("user", secondScope.type());
assertEquals("admin", secondScope.key());
final PreferenceScope threeScope = order.get(2);
assertEquals("global", threeScope.type());
assertEquals("global", threeScope.key());
final PreferenceScope defaultScope = scopeInfo.defaultScope();
assertEquals("user", defaultScope.type());
assertEquals("admin", defaultScope.key());
assertEquals("project", defaultScope.childScope().type());
assertEquals("my-project", defaultScope.childScope().key());
}
Aggregations