Search in sources :

Example 41 with DefaultPlaceRequest

use of org.uberfire.mvp.impl.DefaultPlaceRequest 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 42 with DefaultPlaceRequest

use of org.uberfire.mvp.impl.DefaultPlaceRequest 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 43 with DefaultPlaceRequest

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

the class ScreenEventPublisherTest method setUp.

@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
    screenEventPublisher = new ScreenEventPublisher(diagramEditorMaximizedEventEvent, diagramEditorMinimizedEventEvent, activityBeansCache);
    String screenId = "editor";
    PlaceRequest placeRequest = new DefaultPlaceRequest(screenId);
    when(placeMaximizedEvent.getPlace()).thenReturn(placeRequest);
    when(placeMinimizedEvent.getPlace()).thenReturn(placeRequest);
    when(activityBeansCache.getActivity(screenId)).thenReturn(syncBeanDef);
    when(syncBeanDef.getQualifiers()).thenReturn(Stream.of(annotationForMap(DiagramEditor.class, new HashMap<>())).collect(toSet()));
}
Also used : PlaceRequest(org.uberfire.mvp.PlaceRequest) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) DiagramEditor(org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor) HashMap(java.util.HashMap) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Before(org.junit.Before)

Example 44 with DefaultPlaceRequest

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

the class DefaultAdminPageHelper method addAdminBreadcrumbs.

private void addAdminBreadcrumbs(final String perspective, final String label, final Command accessCommand) {
    breadcrumbs.clearBreadcrumbs(perspective);
    breadcrumbs.addBreadCrumb(perspective, constants.Admin(), new DefaultPlaceRequest(ADMIN));
    breadcrumbs.addBreadCrumb(perspective, label, accessCommand);
}
Also used : DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 45 with DefaultPlaceRequest

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

the class DataModellerDocksHandler method provideDocks.

@Override
public Collection<UberfireDock> provideDocks(String perspectiveIdentifier) {
    List<UberfireDock> result = new ArrayList<>();
    if (lastActiveContext == null) {
        lastActiveContext = dataModelerWBContext.getActiveContext();
    }
    if (isGraphicMode(lastActiveContext)) {
        result.add(new UberfireDock(UberfireDockPosition.EAST, "RANDOM", new DefaultPlaceRequest("DroolsDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksDroolsJBPMTitle()));
        result.add(new UberfireDock(UberfireDockPosition.EAST, "BRIEFCASE", new DefaultPlaceRequest("JPADomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksPersistenceTitle()));
        result.add(new UberfireDock(UberfireDockPosition.EAST, "COG", new DefaultPlaceRequest("AdvancedDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksAdvancedTitle()));
        if (authorizationManager.authorize(WorkbenchFeatures.PLANNER_AVAILABLE, sessionInfo.getIdentity())) {
            result.add(new UberfireDock(UberfireDockPosition.EAST, WorkbenchImageResources.INSTANCE.optaPlannerDisabledIcon(), WorkbenchImageResources.INSTANCE.optaPlannerEnabledIcon(), new DefaultPlaceRequest("PlannerDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksOptaPlannerTitle()));
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) UberfireDock(org.uberfire.client.workbench.docks.UberfireDock) 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