Search in sources :

Example 31 with DefaultPlaceRequest

use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.

the class LibraryPlaces method goToAddAsset.

public void goToAddAsset() {
    final PlaceRequest addAssetScreen = new DefaultPlaceRequest(LibraryPlaces.ADD_ASSET_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(addAssetScreen);
    part.setSelectable(false);
    placeManager.goTo(part, libraryPerspective.getRootPanel());
}
Also used : PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 32 with DefaultPlaceRequest

use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.

the class LibraryPlaces method goToProject.

private void goToProject(final Command callback) {
    setupLibraryBreadCrumbs(projectContext.getActiveWorkspaceProject().orElseThrow(() -> new IllegalStateException("Cannot go to project when no project is active.")));
    final PartDefinitionImpl part = new PartDefinitionImpl(new DefaultPlaceRequest(LibraryPlaces.PROJECT_SCREEN));
    part.setSelectable(false);
    placeManager.goTo(part, libraryPerspective.getRootPanel());
    if (callback != null) {
        callback.execute();
    }
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 33 with DefaultPlaceRequest

use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.

the class LibraryPlaces method goToTrySamples.

public void goToTrySamples() {
    if (closeAllPlacesOrNothing()) {
        final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.IMPORT_SAMPLE_PROJECTS_SCREEN);
        final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
        part.setSelectable(false);
        placeManager.goTo(part, libraryPerspective.getRootPanel());
        setupLibraryBreadCrumbsForTrySamples();
    }
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 34 with DefaultPlaceRequest

use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.

the class LibraryPlaces method goToOrgUnitsMetrics.

public void goToOrgUnitsMetrics() {
    final PlaceRequest metricsScreen = new DefaultPlaceRequest(LibraryPlaces.ORG_UNITS_METRICS_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(metricsScreen);
    part.setSelectable(false);
    placeManager.goTo(part, libraryPerspective.getRootPanel());
    setupLibraryBreadCrumbsForOrgUnitsMetrics();
}
Also used : PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 35 with DefaultPlaceRequest

use of org.uberfire.mvp.impl.DefaultPlaceRequest in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method onSelectProjectSettingsTest.

@Test
public void onSelectProjectSettingsTest() {
    doReturn(PlaceStatus.OPEN).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
    final DefaultPlaceRequest projectSettingsPlaceRequest = new DefaultPlaceRequest(LibraryPlaces.PROJECT_SETTINGS);
    final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
    doReturn(projectSettingsPlaceRequest).when(placeGainFocusEvent).getPlace();
    libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
    verify(libraryPlaces).hideDocks();
    verify(libraryPlaces).setupLibraryBreadCrumbsForAsset(null);
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Aggregations

DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)46 PartDefinitionImpl (org.uberfire.workbench.model.impl.PartDefinitionImpl)29 Test (org.junit.Test)17 PlaceRequest (org.uberfire.mvp.PlaceRequest)15 PanelDefinition (org.uberfire.workbench.model.PanelDefinition)14 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)12 Perspective (org.uberfire.client.annotations.Perspective)11 WorkbenchPerspective (org.uberfire.client.annotations.WorkbenchPerspective)11 PerspectiveDefinition (org.uberfire.workbench.model.PerspectiveDefinition)11 PerspectiveDefinitionImpl (org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl)11 MultiListWorkbenchPanelPresenter (org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter)8 WorkspaceProjectContextChangeEvent (org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent)7 PanelDefinitionImpl (org.uberfire.workbench.model.impl.PanelDefinitionImpl)7 HashMap (java.util.HashMap)4 UberfireDock (org.uberfire.client.workbench.docks.UberfireDock)3 PlaceGainFocusEvent (org.uberfire.client.workbench.events.PlaceGainFocusEvent)3 SimpleWorkbenchPanelPresenter (org.uberfire.client.workbench.panels.impl.SimpleWorkbenchPanelPresenter)3 StaticWorkbenchPanelPresenter (org.uberfire.client.workbench.panels.impl.StaticWorkbenchPanelPresenter)3 ArrayList (java.util.ArrayList)2 WorkbenchProjectMetricsEvent (org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent)2