Search in sources :

Example 16 with DefaultPlaceRequest

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

the class UserHomePagePerspective method buildPerspective.

@Perspective
public PerspectiveDefinition buildPerspective() {
    final PerspectiveDefinition p = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    p.setName(Constants.INSTANCE.PeoplePerspective());
    final PanelDefinition west = new PanelDefinitionImpl(SimpleWorkbenchPanelPresenter.class.getName());
    west.setWidth(350);
    west.setMinWidth(350);
    west.addPart(new PartDefinitionImpl(new DefaultPlaceRequest("UserHomePageSidePresenter")));
    p.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest("UserHomePageMainPresenter")));
    p.getRoot().insertChild(CompassPosition.WEST, west);
    return p;
}
Also used : SimpleWorkbenchPanelPresenter(org.uberfire.client.workbench.panels.impl.SimpleWorkbenchPanelPresenter) 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 17 with DefaultPlaceRequest

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

the class DefaultAdminPageHelper method addSecurityPerspective.

private void addSecurityPerspective() {
    if (hasAccessToPerspective(PerspectiveIds.SECURITY_MANAGEMENT)) {
        adminPage.addTool("root", constants.Roles(), "fa-unlock-alt", "security", () -> {
            final Command accessRoles = () -> {
                Map<String, String> params = new HashMap<>();
                params.put("activeTab", "RolesTab");
                placeManager.goTo(new DefaultPlaceRequest(SECURITY_MANAGEMENT, params));
            };
            accessRoles.execute();
            addAdminBreadcrumbs(SECURITY_MANAGEMENT, constants.SecurityManagement(), accessRoles);
        }, command -> userSystemManager.roles((AbstractEntityManager.SearchResponse<Role> response) -> {
            if (response != null) {
                command.execute(response.getTotal());
            }
        }, (o, throwable) -> false).search(new SearchRequestImpl("", 1, 1, null)));
        adminPage.addTool("root", constants.Groups(), "fa-users", "security", () -> {
            final Command accessGroups = () -> {
                Map<String, String> params = new HashMap<>();
                params.put("activeTab", "GroupsTab");
                placeManager.goTo(new DefaultPlaceRequest(SECURITY_MANAGEMENT, params));
            };
            accessGroups.execute();
            addAdminBreadcrumbs(SECURITY_MANAGEMENT, constants.SecurityManagement(), accessGroups);
        }, command -> userSystemManager.groups((AbstractEntityManager.SearchResponse<Group> response) -> {
            if (response != null) {
                command.execute(response.getTotal());
            }
        }, (o, throwable) -> false).search(new SearchRequestImpl("", 1, 1, null)));
        adminPage.addTool("root", constants.Users(), "fa-user", "security", () -> {
            final Command accessUsers = () -> {
                Map<String, String> params = new HashMap<>();
                params.put("activeTab", "UsersTab");
                placeManager.goTo(new DefaultPlaceRequest(SECURITY_MANAGEMENT, params));
            };
            accessUsers.execute();
            addAdminBreadcrumbs(SECURITY_MANAGEMENT, constants.SecurityManagement(), accessUsers);
        }, command -> userSystemManager.users((AbstractEntityManager.SearchResponse<User> response) -> {
            if (response != null) {
                command.execute(response.getTotal());
            }
        }, (o, throwable) -> false).search(new SearchRequestImpl("", 1, 1, null)));
    }
}
Also used : Command(org.uberfire.mvp.Command) SearchRequestImpl(org.uberfire.ext.security.management.impl.SearchRequestImpl) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) HashMap(java.util.HashMap) Map(java.util.Map)

Example 18 with DefaultPlaceRequest

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

the class AuthoringWorkbenchDocks method setup.

public void setup(String authoringPerspectiveIdentifier, PlaceRequest projectExplorerPlaceRequest) {
    this.authoringPerspectiveIdentifier = authoringPerspectiveIdentifier;
    projectExplorerDock = new UberfireDock(UberfireDockPosition.WEST, IconType.ADJUST.toString(), projectExplorerPlaceRequest, authoringPerspectiveIdentifier).withSize(400).withLabel(constants.DocksProjectExplorerTitle());
    componentPaletteDock = new UberfireDock(UberfireDockPosition.WEST, IconType.CUBES.toString(), new DefaultPlaceRequest(LayoutComponentPaletteScreen.SCREEN_ID), authoringPerspectiveIdentifier).withSize(400).withLabel(constants.LayoutEditorComponentPalette());
    uberfireDocks.add(projectExplorerDock);
    uberfireDocks.hide(UberfireDockPosition.EAST, authoringPerspectiveIdentifier);
}
Also used : UberfireDock(org.uberfire.client.workbench.docks.UberfireDock) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest)

Example 19 with DefaultPlaceRequest

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

the class AuthoringWorkbenchDocksTest method testCloseComponentPalette.

@Test
public void testCloseComponentPalette() {
    authoringWorkbenchDocks.onLayoutEditorFocus(new LayoutEditorFocusEvent());
    reset(uberfireDocks);
    authoringWorkbenchDocks.onLayoutEditorClose(new PlaceHiddenEvent(new DefaultPlaceRequest("FormEditor")));
    verify(uberfireDocks).remove(authoringWorkbenchDocks.componentPaletteDock);
    assertFalse(authoringWorkbenchDocks.componentPaletteEnabled);
    verify(uberfireDocks, never()).open(any());
}
Also used : PlaceHiddenEvent(org.uberfire.client.workbench.events.PlaceHiddenEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) LayoutEditorFocusEvent(org.kie.workbench.common.workbench.client.events.LayoutEditorFocusEvent) Test(org.junit.Test)

Example 20 with DefaultPlaceRequest

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

the class DataSourceManagementPerspective method buildPerspective.

@Perspective
public PerspectiveDefinition buildPerspective() {
    PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    perspective.setName("Data Source Authoring");
    final PanelDefinition west = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    west.setWidth(400);
    west.setMinWidth(300);
    west.addPart(new PartDefinitionImpl(new DefaultPlaceRequest(DataSourceDefExplorerScreen.SCREEN_ID)));
    perspective.getRoot().insertChild(CompassPosition.WEST, west);
    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)

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