org.uberfire.client.workbench.Workbench.getHomePerspectiveActivity()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.uberfire.client.workbench.Workbench.getHomePerspectiveActivity()方法的一些代码示例,展示了Workbench.getHomePerspectiveActivity()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Workbench.getHomePerspectiveActivity()方法的具体详情如下:
包路径:org.uberfire.client.workbench.Workbench
类名称:Workbench
方法名:getHomePerspectiveActivity

Workbench.getHomePerspectiveActivity介绍

[英]Get the home perspective defined at the workbench authorization policy.

If no home is defined then the perspective marked as " isDefault=true" is taken.

Notice that access permission over the selected perspective is always required.
[中]获取workbench授权策略中定义的home透视图。
如果没有定义home,则采用标记为“isDefault=true”的透视图。
请注意,始终需要对所选透视图的访问权限。

代码示例

代码示例来源:origin: kiegroup/appformer

private void goToHomePerspective() {
  final PerspectiveActivity homePerspectiveActivity = workbench.getHomePerspectiveActivity();
  if (homePerspectiveActivity != null) {
    final String homePerspectiveIdentifier = homePerspectiveActivity.getIdentifier();
    if (hasAccessToPerspective(homePerspectiveIdentifier)) {
      placeManager.goTo(homePerspectiveIdentifier);
    }
  }
}

代码示例来源:origin: kiegroup/appformer

@Test
public void setupHomeLinkWithNoDefaultPerspective() {
  doReturn(null).when(workbench).getHomePerspectiveActivity();
  doReturn(true).when(presenter).hasAccessToPerspective(any());
  presenter.setupHomeLink();
  ArgumentCaptor<Command> commandCaptor = ArgumentCaptor.forClass(Command.class);
  verify(view).setHomeLinkAction(commandCaptor.capture());
  verify(view).setBrandImageAction(commandCaptor.capture());
  commandCaptor.getValue().execute();
  verify(placeManager,
      never()).goTo(anyString());
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client

@Test
public void setupHomeLinkWithNoDefaultPerspective() {
  doReturn(null).when(workbench).getHomePerspectiveActivity();
  doReturn(true).when(presenter).hasAccessToPerspective(any());
  presenter.setupHomeLink();
  ArgumentCaptor<Command> commandCaptor = ArgumentCaptor.forClass(Command.class);
  verify(view).setHomeLinkAction(commandCaptor.capture());
  verify(view).setBrandImageAction(commandCaptor.capture());
  commandCaptor.getValue().execute();
  verify(placeManager,
      never()).goTo(anyString());
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client

@Test
public void setupHomeLinkWithNoPermissionToAccessDefaultPerspective() {
  final PerspectiveActivity homePerspective = mock(PerspectiveActivity.class);
  doReturn("identifier").when(homePerspective).getIdentifier();
  doReturn(homePerspective).when(workbench).getHomePerspectiveActivity();
  doReturn(false).when(presenter).hasAccessToPerspective(any());
  presenter.setupHomeLink();
  ArgumentCaptor<Command> commandCaptor = ArgumentCaptor.forClass(Command.class);
  verify(view).setHomeLinkAction(commandCaptor.capture());
  verify(view).setBrandImageAction(commandCaptor.capture());
  commandCaptor.getValue().execute();
  verify(placeManager,
      never()).goTo(anyString());
}

代码示例来源:origin: kiegroup/appformer

@Test
public void setupHomeLinkWithNoPermissionToAccessDefaultPerspective() {
  final PerspectiveActivity homePerspective = mock(PerspectiveActivity.class);
  doReturn("identifier").when(homePerspective).getIdentifier();
  doReturn(homePerspective).when(workbench).getHomePerspectiveActivity();
  doReturn(false).when(presenter).hasAccessToPerspective(any());
  presenter.setupHomeLink();
  ArgumentCaptor<Command> commandCaptor = ArgumentCaptor.forClass(Command.class);
  verify(view).setHomeLinkAction(commandCaptor.capture());
  verify(view).setBrandImageAction(commandCaptor.capture());
  commandCaptor.getValue().execute();
  verify(placeManager,
      never()).goTo(anyString());
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client

@Test
public void setupHomeLinkWithPermissionToAccessDefaultPerspective() {
  final PerspectiveActivity homePerspective = mock(PerspectiveActivity.class);
  doReturn("identifier").when(homePerspective).getIdentifier();
  doReturn(homePerspective).when(workbench).getHomePerspectiveActivity();
  doReturn(true).when(presenter).hasAccessToPerspective(any());
  presenter.setupHomeLink();
  ArgumentCaptor<Command> commandCaptor = ArgumentCaptor.forClass(Command.class);
  verify(view).setHomeLinkAction(commandCaptor.capture());
  verify(view).setBrandImageAction(commandCaptor.capture());
  commandCaptor.getValue().execute();
  verify(placeManager).goTo("identifier");
}

代码示例来源:origin: kiegroup/appformer

@Test
public void setupHomeLinkWithPermissionToAccessDefaultPerspective() {
  final PerspectiveActivity homePerspective = mock(PerspectiveActivity.class);
  doReturn("identifier").when(homePerspective).getIdentifier();
  doReturn(homePerspective).when(workbench).getHomePerspectiveActivity();
  doReturn(true).when(presenter).hasAccessToPerspective(any());
  presenter.setupHomeLink();
  ArgumentCaptor<Command> commandCaptor = ArgumentCaptor.forClass(Command.class);
  verify(view).setHomeLinkAction(commandCaptor.capture());
  verify(view).setBrandImageAction(commandCaptor.capture());
  commandCaptor.getValue().execute();
  verify(placeManager).goTo("identifier");
}

代码示例来源:origin: kiegroup/appformer

final PerspectiveActivity homePerspective = getHomePerspectiveActivity();
if (homePerspective != null) {
  appReady.fire(new ApplicationReadyEvent());

相关文章