Search in sources :

Example 21 with DefaultPlaceRequest

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

the class LibraryPlaces method goToProjectMetrics.

public void goToProjectMetrics() {
    final PlaceRequest metricsScreen = new DefaultPlaceRequest(LibraryPlaces.PROJECT_METRICS_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(metricsScreen);
    part.setSelectable(false);
    placeManager.goTo(part, libraryPerspective.getRootPanel());
    setupLibraryBreadCrumbsForProjectMetrics();
    projectMetricsEvent.fire(new WorkbenchProjectMetricsEvent(projectContext.getActiveWorkspaceProject().orElseThrow(() -> new IllegalStateException("Cannot fire event for project metrics without an active project."))));
}
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) WorkbenchProjectMetricsEvent(org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 22 with DefaultPlaceRequest

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

the class LibraryPlaces method goToOrganizationalUnits.

public void goToOrganizationalUnits() {
    if (closeAllPlacesOrNothing()) {
        PortablePreconditions.checkNotNull("libraryPerspective.closeAllPlacesOrNothing", libraryPerspective);
        projectContextChangeEvent.fire(new WorkspaceProjectContextChangeEvent());
        final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.ORGANIZATIONAL_UNITS_SCREEN);
        final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
        part.setSelectable(false);
        placeManager.goTo(part, libraryPerspective.getRootPanel());
        setupLibraryBreadCrumbs();
    }
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) WorkspaceProjectContextChangeEvent(org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent)

Example 23 with DefaultPlaceRequest

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

the class LibraryPlaces method showDocks.

public void showDocks() {
    if (docksHidden) {
        if (!docksReady) {
            docks.setup(LibraryPlaces.LIBRARY_PERSPECTIVE, new DefaultPlaceRequest(PROJECT_EXPLORER));
            docksReady = true;
        }
        docks.show();
        docksHidden = false;
    }
}
Also used : DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 24 with DefaultPlaceRequest

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

the class LibraryPlaces method setupLibraryPerspective.

private void setupLibraryPerspective() {
    OrganizationalUnit activeOu = projectContext.getActiveOrganizationalUnit().orElseThrow(() -> new IllegalStateException("Cannot setup library perspective without active space."));
    PortablePreconditions.checkNotNull("libraryPerspective", libraryPerspective);
    final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
    part.setSelectable(false);
    if (!projectContext.getActiveWorkspaceProject().isPresent()) {
        projectContextChangeEvent.fire(new WorkspaceProjectContextChangeEvent(activeOu));
    }
    closeLibraryPlaces();
    placeManager.goTo(part, libraryPerspective.getRootPanel());
    setupLibraryBreadCrumbsWithoutProject();
    hideDocks();
}
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) OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) WorkspaceProjectContextChangeEvent(org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent)

Example 25 with DefaultPlaceRequest

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

the class LibraryPlaces method goToSettings.

public void goToSettings() {
    final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(PROJECT_SETTINGS);
    final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
    part.setSelectable(false);
    closeLibraryPlaces();
    placeManager.goTo(part, libraryPerspective.getRootPanel());
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

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