Search in sources :

Example 31 with Command

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

the class InvocationGridTest method testOnItemSelected.

@Test
public void testOnItemSelected() {
    setupGrid(0);
    final Command command = mock(Command.class);
    final HasListSelectorControl.ListSelectorTextItem listSelectorItem = mock(HasListSelectorControl.ListSelectorTextItem.class);
    when(listSelectorItem.getCommand()).thenReturn(command);
    grid.onItemSelected(listSelectorItem);
    verify(command).execute();
}
Also used : HasListSelectorControl(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl) UpdateElementPropertyCommand(org.kie.workbench.common.stunner.core.client.canvas.command.UpdateElementPropertyCommand) SetHeaderValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetHeaderValueCommand) SetCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetCellValueCommand) DeleteHeaderValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteHeaderValueCommand) DeleteCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteCellValueCommand) AddParameterBindingCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.invocation.AddParameterBindingCommand) ClearExpressionTypeCommand(org.kie.workbench.common.dmn.client.commands.general.ClearExpressionTypeCommand) Command(org.uberfire.mvp.Command) DeleteParameterBindingCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.invocation.DeleteParameterBindingCommand) Test(org.junit.Test)

Example 32 with Command

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

the class TileWidgetTest method initTest.

@Test
public void initTest() {
    final Command selectCommand = mock(Command.class);
    presenter.init("label", "description", "circleLabel", "circleDescription", selectCommand);
    verify(view).setup("label", "description", "circleLabel", "circleDescription", selectCommand);
}
Also used : Command(org.uberfire.mvp.Command) Test(org.junit.Test)

Example 33 with Command

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

the class LinkTitlePresenterTest method testSetup.

@Test
public void testSetup() {
    final Command command = mock(Command.class);
    presenter.setup("title", command);
    verify(view).setText("title");
    presenter.onSelect();
    verify(command).execute();
}
Also used : Command(org.uberfire.mvp.Command) Test(org.junit.Test)

Example 34 with Command

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

the class DefaultAdminPageHelper method addDataSetPerspective.

private void addDataSetPerspective() {
    if (hasAccessToPerspective(PerspectiveIds.DATASET_AUTHORING)) {
        adminPage.addTool("root", constants.DataSets(), "fa-folder-open", "perspectives", () -> {
            final Command accessDataSets = () -> placeManager.goTo(PerspectiveIds.DATASET_AUTHORING);
            accessDataSets.execute();
            addAdminBreadcrumbs(PerspectiveIds.DATASET_AUTHORING, constants.DataSets(), accessDataSets);
        });
    }
}
Also used : Command(org.uberfire.mvp.Command)

Example 35 with Command

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

the class DefaultAdminPageHelper method addArtifactsPerspective.

private void addArtifactsPerspective() {
    if (hasAccessToPerspective(PerspectiveIds.GUVNOR_M2REPO)) {
        adminPage.addTool("root", constants.Artifacts(), "fa-download", "perspectives", () -> {
            final Command accessArtifacts = () -> placeManager.goTo(GUVNOR_M2REPO);
            accessArtifacts.execute();
            addAdminBreadcrumbs(GUVNOR_M2REPO, constants.Artifacts(), accessArtifacts);
        });
    }
}
Also used : Command(org.uberfire.mvp.Command)

Aggregations

Command (org.uberfire.mvp.Command)117 Test (org.junit.Test)66 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)15 ClientSessionCommand (org.kie.workbench.common.stunner.core.client.session.command.ClientSessionCommand)11 Group (com.ait.lienzo.client.core.shape.Group)9 YesNoCancelPopup (org.uberfire.ext.widgets.common.client.common.popups.YesNoCancelPopup)9 Before (org.junit.Before)8 HasListSelectorControl (org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl)7 Path (org.uberfire.backend.vfs.Path)7 ArrayList (java.util.ArrayList)6 Collection (java.util.Collection)6 PlaceRequest (org.uberfire.mvp.PlaceRequest)5 MenuItem (org.uberfire.workbench.model.menu.MenuItem)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)4 Inject (javax.inject.Inject)4 OrganizationalUnit (org.guvnor.structure.organizationalunit.OrganizationalUnit)4 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)4 DeleteHeaderValueCommand (org.kie.workbench.common.dmn.client.commands.general.DeleteHeaderValueCommand)4 SetCellValueCommand (org.kie.workbench.common.dmn.client.commands.general.SetCellValueCommand)4 SetHeaderValueCommand (org.kie.workbench.common.dmn.client.commands.general.SetHeaderValueCommand)4