Search in sources :

Example 1 with PreferencesCentralInitializationEvent

use of org.uberfire.ext.preferences.client.event.PreferencesCentralInitializationEvent 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();
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) PreferenceScopeResolutionStrategyInfo(org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo) PreferencesCentralInitializationEvent(org.uberfire.ext.preferences.client.event.PreferencesCentralInitializationEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 2 with PreferencesCentralInitializationEvent

use of org.uberfire.ext.preferences.client.event.PreferencesCentralInitializationEvent 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();
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) PreferenceScopeResolutionStrategyInfo(org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo) PreferencesCentralInitializationEvent(org.uberfire.ext.preferences.client.event.PreferencesCentralInitializationEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Aggregations

PreferencesCentralInitializationEvent (org.uberfire.ext.preferences.client.event.PreferencesCentralInitializationEvent)2 DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)2 PreferenceScopeResolutionStrategyInfo (org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo)2 PartDefinitionImpl (org.uberfire.workbench.model.impl.PartDefinitionImpl)2 Test (org.junit.Test)1 PanelDefinition (org.uberfire.workbench.model.PanelDefinition)1