use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class RegisteredDocumentsMenuBuilderTest method testOnOpenDocument_WithCommand.
@Test
public void testOnOpenDocument_WithCommand() {
final Command command = mock(Command.class);
builder.setOpenDocumentCommand(command);
builder.onOpenDocument();
verify(command, times(1)).execute();
verify(view, times(1)).enableOpenDocumentButton(eq(true));
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class RegisteredDocumentsMenuBuilderTest method testOnNewDocument_WithCommand.
@Test
public void testOnNewDocument_WithCommand() {
final Command command = mock(Command.class);
builder.setNewDocumentCommand(command);
builder.onNewDocument();
verify(command, times(1)).execute();
verify(view, times(1)).enableNewDocumentButton(eq(true));
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class AbstractToolbarCommand method executeWithConfirm.
protected void executeWithConfirm(final Command command) {
final Command yesCommand = () -> {
command.execute();
};
final Command noCommand = () -> {
};
// TODO: I18n.
final YesNoCancelPopup popup = YesNoCancelPopup.newYesNoCancelPopup("Are you sure?", null, yesCommand, noCommand, noCommand);
popup.show();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class AbstractToolbarCommand method executeWithConfirm.
private <V> void executeWithConfirm(final ClientSessionCommand.Callback<V> callback) {
final Command yesCommand = () -> {
this.executeWithNoConfirm(callback);
};
final Command noCommand = () -> {
};
final YesNoCancelPopup popup = YesNoCancelPopup.newYesNoCancelPopup(getConfirmMessage(), null, yesCommand, noCommand, noCommand);
popup.show();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class SessionPreviewCanvasHandlerProxyTest method checkDestroyGraphIndexExecutesCallback.
@Test
public void checkDestroyGraphIndexExecutesCallback() {
final Command loadCallback = mock(Command.class);
proxy.destroyGraphIndex(loadCallback);
verify(loadCallback).execute();
}
Aggregations