• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DefaultPlaceRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.uberfire.mvp.impl.DefaultPlaceRequest的典型用法代码示例。如果您正苦于以下问题:Java DefaultPlaceRequest类的具体用法?Java DefaultPlaceRequest怎么用?Java DefaultPlaceRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultPlaceRequest类属于org.uberfire.mvp.impl包,在下文中一共展示了DefaultPlaceRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testCloseAllPlacesOrNothingSucceeds

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testCloseAllPlacesOrNothingSucceeds() throws Exception {
    PlaceRequest emeraldCityPlace = new DefaultPlaceRequest("emerald_city");
    WorkbenchScreenActivity emeraldCityActivity = createWorkbenchScreenActivity(emeraldCityPlace);
    placeManager.goTo(emeraldCityPlace);

    when(kansasActivity.onMayClose()).thenReturn(true);
    when(kansasActivity.isType(ActivityResourceType.SCREEN.name())).thenReturn(true);

    placeManager.closeAllPlacesOrNothing();

    verifyPlaceClosed(kansas,
                      kansasActivity);
    verifyPlaceClosed(emeraldCityPlace,
                      emeraldCityActivity);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:PlaceManagerTest.java


示例2: testGoToNewPlaceById

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testGoToNewPlaceById() throws Exception {
    PlaceRequest oz = new DefaultPlaceRequest("oz");
    WorkbenchScreenActivity ozActivity = mock(WorkbenchScreenActivity.class);
    when(ozActivity.isType(ActivityResourceType.SCREEN.name())).thenReturn(true);
    when(ozActivity.isDynamic()).thenReturn(false);
    when(ozActivity.preferredWidth()).thenReturn(-1);
    when(ozActivity.preferredHeight()).thenReturn(-1);
    when(activityManager.getActivities(oz)).thenReturn(singleton((Activity) ozActivity));

    placeManager.goTo(oz,
                      (PanelDefinition) null);

    verifyActivityLaunchSideEffects(oz,
                                    ozActivity,
                                    null);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:PlaceManagerTest.java


示例3: testLaunchingPopupThatIsAlreadyOpen

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testLaunchingPopupThatIsAlreadyOpen() throws Exception {

    final PlaceRequest popupPlace = new DefaultPlaceRequest("Somewhere");
    final AbstractPopupActivity popupActivity = mock(AbstractPopupActivity.class);

    when(activityManager.getActivities(popupPlace)).thenReturn(singleton((Activity) popupActivity));
    when(popupActivity.isType(ActivityResourceType.POPUP.name())).thenReturn(true);

    placeManager.goTo(popupPlace);
    placeManager.goTo(popupPlace);

    verify(popupActivity,
           never()).onStartup(any(PlaceRequest.class));
    verify(popupActivity,
           times(1)).onOpen();
    assertEquals(PlaceStatus.OPEN,
                 placeManager.getStatus(popupPlace));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:PlaceManagerTest.java


示例4: buildPerspective

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Perspective
public PerspectiveDefinition buildPerspective() {
    final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
    perspective.setName(translationService.getTranslation(AppConstants.AdministrationPerspective_AdministrationPerspective));

    perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest("RepositoriesEditor")));

    final PanelDefinition west = new PanelDefinitionImpl(SimpleWorkbenchPanelPresenter.class.getName());
    west.setWidth(300);
    west.setMinWidth(200);
    west.addPart(new PartDefinitionImpl(new DefaultPlaceRequest("FileExplorer")));

    perspective.getRoot().insertChild(CompassPosition.WEST,
                                      west);

    return perspective;
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:18,代码来源:AdministrationPerspective.java


示例5: onStartup

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Override
public void onStartup(PlaceRequest place) {
    super.onStartup(place);

    final String id = place.getParameter("debugId",
                                         "");
    panel.ensureDebugId("CustomPanelContentScreen-" + id);

    Label label = new Label("I'm in the custom widget! debugId=" + id);

    Button closeButton = new Button("Close with PlaceManager");
    closeButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            placeManager.closePlace(new DefaultPlaceRequest(CustomPanelContentScreen.class.getName(),
                                                            ImmutableMap.<String, String>of("debugId",
                                                                                            id)));
        }
    });

    panel.add(label);
    panel.add(closeButton);
    instanceCounter.instanceCreated();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:CustomPanelContentScreen.java


示例6: addBreadcrumbs

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void addBreadcrumbs() {
    assertTrue(uberfireBreadcrumbs.breadcrumbsPerPerspective.isEmpty());

    uberfireBreadcrumbs.currentPerspective = "myperspective";
    uberfireBreadcrumbs.addBreadCrumb("myperspective",
                                      "label",
                                      new DefaultPlaceRequest("screen"));
    uberfireBreadcrumbs.addBreadCrumb("myperspective",
                                      "label2",
                                      new DefaultPlaceRequest("screen2"));
    uberfireBreadcrumbs.addBreadCrumb("myperspective2",
                                      "label4",
                                      new DefaultPlaceRequest("screen4"));

    assertFalse(uberfireBreadcrumbs.breadcrumbsPerPerspective.isEmpty());
    assertEquals(2,
                 uberfireBreadcrumbs.breadcrumbsPerPerspective.size());
    assertEquals(2,
                 uberfireBreadcrumbs.breadcrumbsPerPerspective.get("myperspective").size());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:UberfireBreadcrumbsTest.java


示例7: testRegisterBuild

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testRegisterBuild() {
    final String SCREEN1_ID = "screen1";
    final String SCREEN2_ID = "screen2";
    final String PERSPECTIVE_ID = "perspective";
    final PlaceRequest screen1 = new DefaultPlaceRequest(SCREEN1_ID);
    final PlaceRequest screen2 = new DefaultPlaceRequest(SCREEN2_ID);
    final PlaceRequest perspective = new DefaultPlaceRequest(PERSPECTIVE_ID);

    placeHistoryHandler.registerOpen(screenActivity,
                                     screen1);
    assertEquals(SCREEN1_ID,
                 placeHistoryHandler.getCurrentBookmarkableURLStatus());

    final String SCREENS_OPEN_LIST = SCREEN1_ID.concat(",").concat(SCREEN2_ID);
    placeHistoryHandler.registerOpen(screenActivity,
                                     screen2);
    assertEquals(SCREENS_OPEN_LIST,
                 placeHistoryHandler.getCurrentBookmarkableURLStatus());

    final String PERSPECTIVE_STRING = PERSPECTIVE_ID.concat("|").concat(SCREENS_OPEN_LIST);
    placeHistoryHandler.registerOpen(perspectiveActivity,
                                     perspective);
    assertEquals(PERSPECTIVE_STRING,
                 placeHistoryHandler.getCurrentBookmarkableURLStatus());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:PlaceHistoryHandlerTest.java


示例8: testGetClosedScreenFromPlace

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testGetClosedScreenFromPlace() {
    final String url = "perspective|~screen1,screen2$~screen3,screen4";
    final String url2 = "UFWidgets|PagedTableScreen[ESimpleDockScreen,!WSimpleDockScreen,ESimpleDockScreen,]";
    final PlaceRequest place = new DefaultPlaceRequest(url);
    final PlaceRequest place2 = new DefaultPlaceRequest(url2);

    Set<String> set = BookmarkableUrlHelper.getClosedScreenFromPlace(place);
    assertNotNull(set);
    assertFalse(set.isEmpty());
    assertEquals(2,
                 set.size());
    assertTrue(set.contains("~screen1"));
    assertTrue(set.contains("~screen3"));

    set = BookmarkableUrlHelper.getClosedScreenFromPlace(place2);
    assertNotNull(set);
    assertTrue(set.isEmpty());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:BookmarkableUrlHelperTest.java


示例9: testGoToConditionalPlaceByIdOrElse

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testGoToConditionalPlaceByIdOrElse() throws Exception {

    DefaultPlaceRequest other = new DefaultPlaceRequest("other");
    PlaceRequest dora = new ConditionalPlaceRequest("dora").when(p -> false)
            .orElse(other);

    WorkbenchScreenActivity doraActivity = mock(WorkbenchScreenActivity.class);
    WorkbenchScreenActivity otherActivity = mock(WorkbenchScreenActivity.class);
    when(doraActivity.isType(ActivityResourceType.SCREEN.name())).thenReturn(true);
    when(otherActivity.isType(ActivityResourceType.SCREEN.name())).thenReturn(true);
    when(activityManager.getActivities(dora)).thenReturn(singleton((Activity) doraActivity));
    when(activityManager.getActivities(other)).thenReturn(singleton((Activity) otherActivity));

    placeManager.goTo(dora);

    verify(doraActivity,
           never()).onOpen();
    verify(otherActivity).onOpen();

    verifyActivityLaunchSideEffects(other,
                                    otherActivity,
                                    null);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:PlaceManagerTest.java


示例10: testGetPerspectiveFromPlace

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testGetPerspectiveFromPlace() {
    final String perspectiveName = "eccePerspective";
    final String bookmarkableUrl = perspectiveName
            .concat("|~screen1,~screen2");
    final PlaceRequest req = new DefaultPlaceRequest(bookmarkableUrl);

    PlaceRequest place = BookmarkableUrlHelper.getPerspectiveFromPlace(req);

    assertNotNull(place);
    assertNotSame(req,
                  place);
    assertEquals(perspectiveName,
                 place.getFullIdentifier());

    // return the same object if no perspective in URL
    final PlaceRequest empty = new DefaultPlaceRequest("screenOpened,~screenClosed");
    empty.addParameter("param",
                       "value");
    place = BookmarkableUrlHelper.getPerspectiveFromPlace(empty);
    assertNotNull(place);
    assertEquals(empty.getFullIdentifier(),
                 place.getFullIdentifier());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:BookmarkableUrlHelperTest.java


示例11: testOnUserRead

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testOnUserRead() {
    final ReadUserEvent event = mock(ReadUserEvent.class);
    when(event.getIdentifier()).thenReturn("someUserId");
    final ArgumentCaptor<DefaultPlaceRequest> placeRequestArgumentCaptor =
            ArgumentCaptor.forClass(DefaultPlaceRequest.class);
    tested.onUserRead(event);
    verify(placeManager,
           times(1)).goTo(placeRequestArgumentCaptor.capture());
    final DefaultPlaceRequest placeRequest = placeRequestArgumentCaptor.getValue();
    assertEquals(UserEditorScreen.SCREEN_ID,
                 placeRequest.getIdentifier());
    assertEquals("someUserId",
                 placeRequest.getParameters().get(UserEditorScreen.USER_ID));
    assertFalse(placeRequest.getParameters().containsKey(UserEditorScreen.ADD_USER));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:SecurityExplorerScreenTest.java


示例12: testUrlLimit

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testUrlLimit() {
    int cnt = 0;
    int length = 0;

    do {
        final PlaceRequest screen = new DefaultPlaceRequest("screen".concat(String.valueOf(cnt++)));

        placeHistoryHandler.registerOpen(screenActivity,
                                         screen);

        if (length == placeHistoryHandler.getCurrentBookmarkableURLStatus().length()) {
            break;
        }
        length = placeHistoryHandler.getCurrentBookmarkableURLStatus().length();
    } while ((placeHistoryHandler.getCurrentBookmarkableURLStatus().length()
            < BookmarkableUrlHelper.MAX_NAV_URL_SIZE + 100));
    assertNotNull(placeHistoryHandler.getCurrentBookmarkableURLStatus());
    assertFalse(placeHistoryHandler.getCurrentBookmarkableURLStatus().length()
                        > BookmarkableUrlHelper.MAX_NAV_URL_SIZE);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:PlaceHistoryHandlerTest.java


示例13: testClosingActivityInCustomPanel

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testClosingActivityInCustomPanel() throws Exception {
    HasWidgets any = any(HasWidgets.class);
    CustomPanelDefinitionImpl customPanelDef = new CustomPanelDefinitionImpl(
            UnanchoredStaticWorkbenchPanelPresenter.class.getName(),
            any);
    when(panelManager.addCustomPanel(any,
                                     eq(UnanchoredStaticWorkbenchPanelPresenter.class.getName())))
            .thenReturn(customPanelDef);

    PlaceRequest emeraldCityPlace = new DefaultPlaceRequest("emerald_city");
    createWorkbenchScreenActivity(emeraldCityPlace);

    HasWidgets customContainer = mock(HasWidgets.class);

    placeManager.goTo(emeraldCityPlace,
                      customContainer);
    placeManager.closePlace(emeraldCityPlace);

    assertTrue(customPanelDef.getParts().isEmpty());
    verify(panelManager).removeWorkbenchPanel(customPanelDef);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:PlaceManagerTest.java


示例14: testGoToConditionalPlaceById

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testGoToConditionalPlaceById() throws Exception {

    PlaceRequest dora = new ConditionalPlaceRequest("dora").when(p -> true)
            .orElse(new DefaultPlaceRequest("other"));

    WorkbenchScreenActivity doraActivity = mock(WorkbenchScreenActivity.class);
    when(doraActivity.isType(ActivityResourceType.SCREEN.name())).thenReturn(true);
    when(activityManager.getActivities(dora)).thenReturn(singleton((Activity) doraActivity));

    placeManager.goTo(dora);

    verifyActivityLaunchSideEffects(dora,
                                    doraActivity,
                                    null);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:PlaceManagerTest.java


示例15: testRegisterCloseEditor

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testRegisterCloseEditor() {
    final Path path = PathFactory.newPath("file",
                                          "default://[email protected]/path/to/file");
    final PlaceRequest ppr = new PathPlaceRequest(path);

    ppr.setIdentifier("Perspective Editor");
    final String perspectiveClosedUrl = "PlugInAuthoringPerspective|[WPlugins Explorer,]$";
    final String perspectiveOpenUrl = perspectiveClosedUrl.concat(ppr.getFullIdentifier());

    String url = BookmarkableUrlHelper
            .registerCloseEditor(perspectiveOpenUrl,
                                 ppr);

    assertEquals(perspectiveClosedUrl,
                 url);

    // invoke with invalid field type
    final PlaceRequest dpr = new DefaultPlaceRequest("default://[email protected]/path/to/file");

    url = BookmarkableUrlHelper
            .registerCloseEditor(perspectiveOpenUrl,
                                 dpr);
    assertEquals(perspectiveOpenUrl,
                 url);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:BookmarkableUrlHelperTest.java


示例16: createPartDefinitions

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
private void createPartDefinitions() {
    partDefinitionsRoot = Arrays.asList(new PartDefinitionImpl(new DefaultPlaceRequest("part1")),
                                        new PartDefinitionImpl(new DefaultPlaceRequest("part2")));

    partDefinitionRootChild1 = Arrays.asList(new PartDefinitionImpl(new DefaultPlaceRequest("part1-rootChild1")),
                                             new PartDefinitionImpl(new DefaultPlaceRequest("part2-rootChild1")),
                                             new PartDefinitionImpl(new DefaultPlaceRequest("part3-rootChild1")));

    partDefinitionRootChild2 = Arrays.asList(new PartDefinitionImpl(new DefaultPlaceRequest("part1-rootChild2")),
                                             new PartDefinitionImpl(new DefaultPlaceRequest("part2-rootChild2")),
                                             new PartDefinitionImpl(new DefaultPlaceRequest("part3-rootChild2")));

    partDefinitionRootChild2Child = Arrays.asList(new PartDefinitionImpl(new DefaultPlaceRequest("part1-rootChild2Child")),
                                                  new PartDefinitionImpl(new DefaultPlaceRequest("part2-rootChild2Child")),
                                                  new PartDefinitionImpl(new DefaultPlaceRequest("part3-rootChild2Child")),
                                                  new PartDefinitionImpl(new DefaultPlaceRequest("part4-rootChild2Child")));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:PerspectiveManagerTest.java


示例17: setup

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@PostConstruct
private void setup() {

    // makes this screen detectable to automated tests
    panel.getElement().setId(shortName(getClass()));

    Map<String, String> params = new HashMap<String, String>();
    for (Class<?> activityClass : asList(BreakableScreen.class,
                                         BreakablePerspective.class)) {
        for (LifecyclePhase phase : LifecyclePhase.values()) {
            params.put("broken",
                       phase.toString());
            panel.add(new PlaceButton(placeManager,
                                      new DefaultPlaceRequest(activityClass.getName(),
                                                              params)));
        }
    }

    panel.add(new PlaceButton(placeManager,
                              new DefaultPlaceRequest(DefaultPerspectiveActivity.class.getName())));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:BreakableMenuScreen.java


示例18: testOpenDockParametersArePreserved

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testOpenDockParametersArePreserved() throws Exception {

    final DefaultPlaceRequest myPlace = new DefaultPlaceRequest("myPlace");

    myPlace.addParameter("my_parameter_key",
                         "my_parameter_value");

    docksBars.openDock(getTargetDock(myPlace),
                       getDocksBar());

    verify(placeManager).goTo(placeRequestArgumentCaptor.capture(),
                              any(FlowPanel.class));

    final PlaceRequest placeRequest = placeRequestArgumentCaptor.getValue();
    assertEquals("myPlace",
                 placeRequest.getIdentifier());
    assertEquals("my_parameter_value",
                 placeRequest.getParameter("my_parameter_key",
                                           ""));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:DocksBars_OpenDockTest.java


示例19: getResourceType

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
public ResourceType getResourceType(String activityId) {

        Activity activity = activityManager.getActivity(new DefaultPlaceRequest(activityId),
                                                        false);
        if (activity != null) {
            if (activity instanceof PerspectiveActivity) {
                return PERSPECTIVE;
            }
            if (activity instanceof WorkbenchScreenActivity) {
                return SCREEN;
            }
            if (activity instanceof WorkbenchEditorActivity) {
                return EDITOR;
            }
            if (activity instanceof SplashScreenActivity) {
                return EDITOR;
            }
            if (activity instanceof PopupActivity) {
                return POPUP;
            }
        }
        return ResourceType.UNKNOWN;
    }
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:RuntimePluginsEntryPoint.java


示例20: testAddPerspective

import org.uberfire.mvp.impl.DefaultPlaceRequest; //导入依赖的package包/类
@Test
public void testAddPerspective() {
    final String perspectiveId = "perspectiveId";
    final Menus menus = MenuFactory.newSimpleItem("test").perspective(perspectiveId).endMenu().build();
    final PlaceRequest placeRequest = new DefaultPlaceRequest("anyId");
    final PerspectiveActivity perspectiveActivity = mock(PerspectiveActivity.class);

    when(perspectiveActivity.getPlace()).thenReturn(placeRequest);
    when(perspectiveManager.getCurrentPerspective()).thenReturn(perspectiveActivity);
    when(authzManager.authorize(any(Resource.class),
                                eq(identity))).thenReturn(true);

    presenter.addMenus(menus);

    verify(view,
           never()).selectMenuItem(perspectiveId);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:WorkbenchMenuBarPresenterTest.java



注:本文中的org.uberfire.mvp.impl.DefaultPlaceRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FieldConversion类代码示例发布时间:2022-05-23
下一篇:
Java ObjectMap类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap