use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class AddFieldClickHandler method onClick.
@Override
public void onClick(final ClickEvent event) {
final FormStylePopup pop = new FormStylePopup(TestScenarioConstants.INSTANCE.ChooseAFieldToAdd());
final FactFieldSelector selector = createAddNewField(pop);
pop.addAttribute(TestScenarioConstants.INSTANCE.ChooseAFieldToAdd(), selector);
pop.add(new ModalFooterOKCancelButtons(new Command() {
@Override
public void execute() {
SelectionEvent.fire(selector, selector.getSelectedText());
}
}, new Command() {
@Override
public void execute() {
pop.hide();
}
}));
pop.show();
}
use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerPresenter method removeDecisionTable.
@Override
public void removeDecisionTable(final GuidedDecisionTableView.Presenter dtPresenter) {
final Command afterRemovalCommand = () -> {
availableDecisionTables.remove(dtPresenter);
if (dtPresenter.equals(activeDecisionTable)) {
activeDecisionTable = null;
}
dtPresenter.onClose();
removeLinksForDecisionTable(dtPresenter);
};
view.removeDecisionTable(dtPresenter.getView(), afterRemovalCommand);
}
use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class ColumnsPagePresenterTest method testDeleteMetaDataColumnAnchor.
@Test
public void testDeleteMetaDataColumnAnchor() {
final DeleteColumnManagementAnchorWidget expectedWidget = mock(DeleteColumnManagementAnchorWidget.class);
final String columnHeader = "columnHeader";
final Command command = mock(Command.class);
doReturn(columnHeader).when(metadataColumn).getMetadata();
doReturn(expectedWidget).when(deleteColumnManagementAnchorWidgets).get();
doReturn(command).when(presenter).deleteMetadataCommand(modeller, metadataColumn);
final DeleteColumnManagementAnchorWidget actualWidget = presenter.deleteMetaDataColumnAnchor(modeller, metadataColumn);
verify(actualWidget).init(columnHeader, command);
assertEquals(expectedWidget, actualWidget);
}
use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerPresenterTest method exitPinnedMode.
@Test
public void exitPinnedMode() {
final Command command = mock(Command.class);
presenter.exitPinnedMode(command);
verify(gridLayer, times(1)).exitPinnedMode(eq(command));
verify(columnHeaderPopOver, times(1)).hide();
}
use of com.google.gwt.user.client.Command in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerPresenterTest method refreshingDecisionTableRetainsExistingLocation.
@Test
public void refreshingDecisionTableRetainsExistingLocation() {
final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable();
final GuidedDecisionTableEditorContent dtContent = makeDecisionTableContent();
final GuidedDecisionTableView dtView = dtPresenter.getView();
final ObservablePath path = mock(ObservablePath.class);
final PlaceRequest placeRequest = mock(PlaceRequest.class);
final Point2D dtLocation = new Point2D(100, 100);
when(dtView.getLocation()).thenReturn(dtLocation);
final ArgumentCaptor<Command> afterRemovalCommandCaptor = ArgumentCaptor.forClass(Command.class);
presenter.refreshDecisionTable(dtPresenter, path, placeRequest, dtContent, false);
verify(dtView, times(1)).getLocation();
verify(view, times(1)).removeDecisionTable(eq(dtView), afterRemovalCommandCaptor.capture());
final Command afterRemovalCommand = afterRemovalCommandCaptor.getValue();
assertNotNull(afterRemovalCommand);
afterRemovalCommand.execute();
verify(dtView, times(1)).setLocation(eq(dtLocation));
}
Aggregations