Search in sources :

Example 26 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method goToOrganizationalUnitsTest.

@Test
public void goToOrganizationalUnitsTest() {
    final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.ORGANIZATIONAL_UNITS_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
    part.setSelectable(false);
    libraryPlaces.goToOrganizationalUnits();
    verify(projectContextChangeEvent).fire(projectContextChangeEventArgumentCaptor.capture());
    assertNull(projectContextChangeEventArgumentCaptor.getValue().getOrganizationalUnit());
    final ArgumentCaptor<WorkspaceProjectContextChangeEvent> eventArgumentCaptor = ArgumentCaptor.forClass(WorkspaceProjectContextChangeEvent.class);
    verify(projectContextChangeEvent).fire(eventArgumentCaptor.capture());
    final WorkspaceProjectContextChangeEvent event = eventArgumentCaptor.getValue();
    assertNull(event.getOrganizationalUnit());
    assertNull(event.getWorkspaceProject());
    verify(placeManager).closeAllPlacesOrNothing();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(libraryPlaces).setupLibraryBreadCrumbs();
}
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) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) WorkspaceProjectContextChangeEvent(org.guvnor.common.services.project.context.WorkspaceProjectContextChangeEvent) Test(org.junit.Test)

Example 27 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method goToOrgUnitsMetricsTest.

@Test
public void goToOrgUnitsMetricsTest() {
    final PlaceRequest metricsScreen = new DefaultPlaceRequest(LibraryPlaces.ORG_UNITS_METRICS_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(metricsScreen);
    part.setSelectable(false);
    libraryPlaces.goToOrgUnitsMetrics();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(libraryPlaces).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) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 28 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class ServerManagementPerspective method buildPerspective.

@Perspective
public PerspectiveDefinition buildPerspective() {
    final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(StaticWorkbenchPanelPresenter.class.getName());
    perspective.setName("ServerManagementPerspective");
    perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest("ServerManagementBrowser")));
    return perspective;
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) PerspectiveDefinitionImpl(org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl) PerspectiveDefinition(org.uberfire.workbench.model.PerspectiveDefinition) StaticWorkbenchPanelPresenter(org.uberfire.client.workbench.panels.impl.StaticWorkbenchPanelPresenter) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Perspective(org.uberfire.client.annotations.Perspective) WorkbenchPerspective(org.uberfire.client.annotations.WorkbenchPerspective)

Example 29 with PartDefinitionImpl

use of org.uberfire.workbench.model.impl.PartDefinitionImpl in project kie-wb-common by kiegroup.

the class ProvisioningManagementPerspective method buildPerspective.

@Perspective
public PerspectiveDefinition buildPerspective() {
    final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(StaticWorkbenchPanelPresenter.class.getName());
    perspective.setName(IDENTIFIER);
    perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(ProvisioningManagementBrowserPresenter.IDENTIFIER)));
    return perspective;
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) PerspectiveDefinitionImpl(org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl) PerspectiveDefinition(org.uberfire.workbench.model.PerspectiveDefinition) StaticWorkbenchPanelPresenter(org.uberfire.client.workbench.panels.impl.StaticWorkbenchPanelPresenter) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Perspective(org.uberfire.client.annotations.Perspective) WorkbenchPerspective(org.uberfire.client.annotations.WorkbenchPerspective)

Aggregations

DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)29 PartDefinitionImpl (org.uberfire.workbench.model.impl.PartDefinitionImpl)29 PanelDefinition (org.uberfire.workbench.model.PanelDefinition)14 PlaceRequest (org.uberfire.mvp.PlaceRequest)12 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 Test (org.junit.Test)9 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 SimpleWorkbenchPanelPresenter (org.uberfire.client.workbench.panels.impl.SimpleWorkbenchPanelPresenter)3 StaticWorkbenchPanelPresenter (org.uberfire.client.workbench.panels.impl.StaticWorkbenchPanelPresenter)3 WorkbenchProjectMetricsEvent (org.kie.workbench.common.screens.library.client.events.WorkbenchProjectMetricsEvent)2 PreferencesCentralInitializationEvent (org.uberfire.ext.preferences.client.event.PreferencesCentralInitializationEvent)2 PreferenceScopeResolutionStrategyInfo (org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo)2 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)1 OrganizationalUnit (org.guvnor.structure.organizationalunit.OrganizationalUnit)1