Search in sources :

Example 1 with PartDefinitionImpl

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

the class AuthoringPerspective method buildPerspective.

@Perspective
public PerspectiveDefinition buildPerspective() {
    PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    perspective.setName("Authoring");
    perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DiagramsNavigatorScreen.SCREEN_ID)));
    treeExplorerPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    treeExplorerPanel.setWidth(EAST_PANEL_WIDTH);
    treeExplorerPanel.setHeight(EAST_PANEL_HEIGHT);
    treeExplorerPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionTreeExplorerScreen.SCREEN_ID)));
    previewPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    previewPanel.setWidth(EAST_PANEL_WIDTH);
    previewPanel.setHeight(EAST_PANEL_HEIGHT);
    previewPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionDiagramPreviewScreen.SCREEN_ID)));
    propertiesPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    propertiesPanel.setWidth(EAST_PANEL_WIDTH);
    propertiesPanel.setHeight(EAST_PANEL_HEIGHT);
    propertiesPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionPropertiesScreen.SCREEN_ID)));
    propertiesPanel.appendChild(CompassPosition.NORTH, previewPanel);
    propertiesPanel.appendChild(CompassPosition.SOUTH, treeExplorerPanel);
    notificationsPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    notificationsPanel.setWidth(400);
    notificationsPanel.setHeight(100);
    notificationsPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(NotificationsScreen.SCREEN_ID)));
    perspective.getRoot().insertChild(CompassPosition.EAST, propertiesPanel);
    perspective.getRoot().insertChild(CompassPosition.SOUTH, notificationsPanel);
    return perspective;
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) PerspectiveDefinitionImpl(org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl) PerspectiveDefinition(org.uberfire.workbench.model.PerspectiveDefinition) PanelDefinitionImpl(org.uberfire.workbench.model.impl.PanelDefinitionImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) MultiListWorkbenchPanelPresenter(org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter) Perspective(org.uberfire.client.annotations.Perspective) WorkbenchPerspective(org.uberfire.client.annotations.WorkbenchPerspective)

Example 2 with PartDefinitionImpl

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

the class AuthoringPerspective method buildPerspective.

@Perspective
public PerspectiveDefinition buildPerspective() {
    final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    perspective.setName("Authoring");
    perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DiagramsNavigatorScreen.SCREEN_ID)));
    final PanelDefinition treeExplorerPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    treeExplorerPanel.setWidth(EAST_PANEL_WIDTH);
    treeExplorerPanel.setHeight(EAST_PANEL_HEIGHT);
    treeExplorerPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionTreeExplorerScreen.SCREEN_ID)));
    final PanelDefinition previewPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    previewPanel.setWidth(EAST_PANEL_WIDTH);
    previewPanel.setHeight(EAST_PANEL_HEIGHT);
    previewPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionDiagramPreviewScreen.SCREEN_ID)));
    final PanelDefinition propertiesPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    propertiesPanel.setWidth(EAST_PANEL_WIDTH);
    propertiesPanel.setHeight(EAST_PANEL_HEIGHT);
    propertiesPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(SessionPropertiesScreen.SCREEN_ID)));
    propertiesPanel.appendChild(CompassPosition.NORTH, previewPanel);
    propertiesPanel.appendChild(CompassPosition.SOUTH, treeExplorerPanel);
    final PanelDefinition notificationsPanel = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    notificationsPanel.setWidth(400);
    notificationsPanel.setHeight(100);
    notificationsPanel.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(NotificationsScreen.SCREEN_ID)));
    perspective.getRoot().insertChild(CompassPosition.EAST, propertiesPanel);
    perspective.getRoot().insertChild(CompassPosition.SOUTH, notificationsPanel);
    return perspective;
}
Also used : PartDefinitionImpl(org.uberfire.workbench.model.impl.PartDefinitionImpl) PerspectiveDefinitionImpl(org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) PerspectiveDefinition(org.uberfire.workbench.model.PerspectiveDefinition) PanelDefinitionImpl(org.uberfire.workbench.model.impl.PanelDefinitionImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) MultiListWorkbenchPanelPresenter(org.uberfire.client.workbench.panels.impl.MultiListWorkbenchPanelPresenter) Perspective(org.uberfire.client.annotations.Perspective) WorkbenchPerspective(org.uberfire.client.annotations.WorkbenchPerspective)

Example 3 with PartDefinitionImpl

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

the class LibraryPlacesTest method goToLibraryFromOrganizationalUnitsScreenTest.

@Test
public void goToLibraryFromOrganizationalUnitsScreenTest() {
    doReturn(Optional.of(activeOrganizationalUnit)).when(projectContext).getActiveOrganizationalUnit();
    doReturn(Optional.empty()).when(projectContext).getActiveWorkspaceProject();
    doReturn(Optional.empty()).when(projectContext).getActiveModule();
    final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
    part.setSelectable(false);
    libraryPlaces.goToLibrary();
    verify(libraryPlaces).closeLibraryPlaces();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(libraryPlaces).setupLibraryBreadCrumbsWithoutProject();
    verify(projectContextChangeEvent, times(1)).fire(any(WorkspaceProjectContextChangeEvent.class));
}
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 4 with PartDefinitionImpl

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

the class LibraryPlacesTest method goToProjectMetricsTest.

@Test
public void goToProjectMetricsTest() {
    final PlaceRequest projectScreen = new DefaultPlaceRequest(LibraryPlaces.PROJECT_METRICS_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(projectScreen);
    part.setSelectable(false);
    libraryPlaces.goToProjectMetrics();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(projectMetricsEvent).fire(any(WorkbenchProjectMetricsEvent.class));
    verify(libraryPlaces).setupLibraryBreadCrumbsForProjectMetrics();
}
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) PanelDefinition(org.uberfire.workbench.model.PanelDefinition) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 5 with PartDefinitionImpl

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

the class LibraryPlacesTest method goToLibraryWithDefaultOrganizationalUnitTest.

@Test
public void goToLibraryWithDefaultOrganizationalUnitTest() {
    when(projectContext.getActiveOrganizationalUnit()).thenReturn(Optional.empty()).thenReturn(Optional.of(mock(OrganizationalUnit.class)));
    doReturn(Optional.empty()).when(projectContext).getActiveWorkspaceProject();
    doReturn(Optional.empty()).when(projectContext).getActiveModule();
    final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
    final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
    part.setSelectable(false);
    libraryPlaces.goToLibrary();
    verify(libraryPlaces).closeLibraryPlaces();
    verify(placeManager).goTo(eq(part), any(PanelDefinition.class));
    verify(libraryPlaces).setupLibraryBreadCrumbsWithoutProject();
    verify(projectContextChangeEvent, times(2)).fire(any(WorkspaceProjectContextChangeEvent.class));
}
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)

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