org.uberfire.mvp.Command类的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(126)

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

Command介绍

[英]A command representing a future activity. This was deliberately created in addition to the existing GWT Command to allow better re-use of menu structures when a WorkbenchPart is embedded within Eclipse.
[中]表示未来活动的命令。这是在现有GWT命令的基础上特意创建的,以便在Eclipse中嵌入WorkbenchPart时更好地重用菜单结构。

代码示例

代码示例来源:origin: stackoverflow.com

private Queue<Command> queue = initQueue();

public run() {
 while(!stop) {
  Command nextCommand = queue.pop();
  nextCommand.execute();
 }
}

代码示例来源:origin: stackoverflow.com

List<Command> commandArray = new <Command>ArrayList();
commandArray.add(new Foo());
commandArray.add(new Command(){
  public void execute() {
    // some more stuff;
  }
});

for (Command command : commandArray){
  command.execute();
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testCallbackOnResponseReceivedWhenKieServerIsNotAccessible() {
  doReturn(false).when(presenter).isKieServerAccessible(any());
  final RequestCallback callback = presenter.makeCallback(onSuccess, onError);
  callback.onResponseReceived(request, response);
  verify(onError).execute();
  verify(onSuccess, never()).execute();
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-widgets

@Test
public void checkDestroyGraphIndexExecutesCallback() {
  final Command loadCallback = mock(Command.class);
  proxy.destroyGraphIndex(loadCallback);
  verify(loadCallback).execute();
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-client

@Test
  public void testActions( ) {
    actionsPanel.onSave( );
    verify( saveCommand, times( 1 ) ).execute( );
    actionsPanel.onCancel( );
    verify( cancelCommand, times( 1 ) ).execute( );
    actionsPanel.onDelete();
    verify( deleteCommand, times( 1 ) ).execute( );
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-client

@Test
public void testTechViewRefresh() throws Exception {
  ArgumentCaptor<Command> argumentCaptor = ArgumentCaptor.forClass( Command.class );
  when( activeOptions.isTechnicalViewActive() ).thenReturn( true );
  verify( menu ).addRefreshCommand( argumentCaptor.capture() );
  argumentCaptor.getValue().execute();
  verify( technicalViewPresenter ).refresh();
  verify( businessViewPresenter, never() ).refresh();
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-client

@Test
public void testOnShowTagFilterSelectedOn() throws Exception {
  when(activeOptions.canShowTag()).thenReturn(false);
  menu.onShowTagFilterSelected();
  verify(activeOptions).activateTagFiltering();
  verify(updateCommand).execute();
}

代码示例来源:origin: org.uberfire/uberfire-security-api

@Test
public void testPermissionCheck() throws Exception {
  authorizationManager.check("perspective.read.p1",
                user)
      .granted(onGranted)
      .denied(onDenied);
  verify(onGranted).execute();
  verify(onDenied,
      never()).execute();
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client

@Before
public void setUp() {
  this.emptyAssetsScreen = spy(new EmptyAssetsScreen(this.view,
                            this.newFileUploader,
                            this.newResourcePresenter,
                            this.libraryPermissions,
                            this.libraryPlaces));
  Command command = mock(Command.class);
  doNothing().when(command).execute();
  when(this.newFileUploader.getCommand(any())).thenReturn(command);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-widgets

protected void verifyNameSaved() {
  verifyNameFlushed();
  verify(view).hide();
  verify(closeCallback).execute();
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testCallbackOnError() {
  final Throwable throwable = mock(Throwable.class);
  final RequestCallback callback = presenter.makeCallback(onSuccess, onError);
  callback.onError(request, throwable);
  verify(onError).execute();
  verify(onSuccess, never()).execute();
}

代码示例来源:origin: org.dashbuilder/dashbuilder-dataset-editor

@Test
public void testOnValidateSuccess() {
  when(editWorkflow.hasErrors()).thenReturn(false);
  presenter.getValidateCommand().execute();
  verify(editWorkflow, times(1)).flush();
  final ArgumentCaptor<NotificationEvent> dataCaptor = ArgumentCaptor.forClass(NotificationEvent.class);
  verify(notification, times(1)).fire(dataCaptor.capture());
  NotificationEvent ne = dataCaptor.getValue();
  assertNotNull(ne);
  assertEquals(NotificationEvent.NotificationType.SUCCESS, ne.getType());
}

代码示例来源:origin: org.uberfire/uberfire-security-api

@Test
public void testDenyCommandInvoked() throws Exception {
  authorizationManager.check(perspective2,
                user).denied(onDenied);
  verify(onDenied).execute();
  reset(onDenied);
  authorizationManager.check(perspective2,
                user).granted(onGranted).denied(onDenied);
  verify(onGranted,
      never()).execute();
  verify(onDenied).execute();
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client

@Before
public void setUp() {
  doAnswer(invocationOnMock -> {
    invocationOnMock.getArgumentAt(0, Command.class).execute();
    return null;
  }).when(libraryPlaces).closeAllPlacesOrNothing(any());
  when(project.getName()).thenReturn("kieProject");
  presenter = spy(new DeleteProjectPopUpScreen(view,
                         libraryPlaces));
}

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

@Test
public void testDeleteWithValidator() {
  builder.addDelete(mockPath,
           deleteCaller,
           validator);
  final Menus menus = builder.build();
  final MenuItem mi = menus.getItems().get(0);
  final MenuItemCommand mic = (MenuItemCommand) mi;
  mic.getCommand().execute();
  verify(deletePopUpPresenter).show(eq(validator),
                   any());
}

代码示例来源:origin: org.dashbuilder/dashbuilder-displayer-client

@Test
public void testOnChange() {
  presenter.onSourceCodeChanged("howdy?");
  assertEquals(presenter.getCode(), "howdy?");
  assertEquals(presenter.hasErrors(), false);
  verify(htmlValidator).validate("howdy?");
  verify(onChange).execute();
  verify(view, never()).error(anyString());
}

代码示例来源:origin: org.guvnor/guvnor-ala-ui-client

@Test
public void testDeleteRuntimeConfirmNo() {
  prepareRuntimeDelete();
  noCommandCaptor.getValue().execute();
  verify(runtimeService,
      never()).deleteRuntime(any(RuntimeKey.class),
                 anyBoolean());
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client

@Test
public void selectCommandTest() {
  libraryScreen.selectCommand(project1).execute();
  verify(libraryPlaces).goToProject(any(WorkspaceProject.class));
}

代码示例来源:origin: org.jbpm/jbpm-wb-common-client

@Test
public void testRemoveAllActiveFiltersCallback() {
  doAnswer(invocation -> {
    final Command callback = (Command) invocation.getArguments()[0];
    callback.execute();
    return null;
  }).when(view).setRemoveAllFilterCallback(any());
  activeFilters.init();
  verify(view).removeAllActiveFilters(true);
  verify(clearAllActiveFiltersEvent).fire(any());
}

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

@Test
public void testMenuItemCommand() {
  final Command command = downloadMenuItem.makeMenuItemCommand(pathSupplier);
  doNothing().when(downloadMenuItem).open(any());
  command.execute();
  verify(downloadMenuItem).download(pathSupplier);
}

相关文章

Command类方法