Search in sources :

Example 16 with CheckBox

use of org.gwtbootstrap3.client.ui.CheckBox in project drools-wb by kiegroup.

the class ColumnsPagePresenterTest method testHideMetadataClickHandlerWhenVetoExceptionIsNotRaised.

@Test
public void testHideMetadataClickHandlerWhenVetoExceptionIsNotRaised() throws Exception {
    final MetadataCol52 clone = mock(MetadataCol52.class);
    final CheckBox checkBox = mock(CheckBox.class);
    final ClickEvent clickEvent = mock(ClickEvent.class);
    final GuidedDecisionTableView.Presenter activeDecisionTable = mock(GuidedDecisionTableView.Presenter.class);
    doReturn(Optional.of(activeDecisionTable)).when(modeller).getActiveDecisionTable();
    doReturn(clone).when(metadataColumn).cloneColumn();
    final ClickHandler clickHandler = presenter.hideMetadataClickHandler(modeller, checkBox, metadataColumn);
    clickHandler.onClick(clickEvent);
    verify(clone).setHideColumn(checkBox.getValue());
    verify(activeDecisionTable).updateColumn(metadataColumn, clone);
}
Also used : MetadataCol52(org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) CheckBox(org.gwtbootstrap3.client.ui.CheckBox) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) GuidedDecisionTableView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView) Test(org.junit.Test)

Aggregations

CheckBox (org.gwtbootstrap3.client.ui.CheckBox)15 Test (org.junit.Test)5 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)4 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)2 HTML (com.google.gwt.user.client.ui.HTML)2 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)2 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)2 ColumnLabelWidget (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.control.ColumnLabelWidget)2 DeleteColumnManagementAnchorWidget (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.control.DeleteColumnManagementAnchorWidget)2 InfoPopup (org.uberfire.ext.widgets.common.client.common.InfoPopup)2 GWT (com.google.gwt.core.client.GWT)1 Scheduler (com.google.gwt.core.client.Scheduler)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 DateTimeFormat (com.google.gwt.i18n.client.DateTimeFormat)1 CssResource (com.google.gwt.resources.client.CssResource)1 UiBinder (com.google.gwt.uibinder.client.UiBinder)1 UiField (com.google.gwt.uibinder.client.UiField)1 Composite (com.google.gwt.user.client.ui.Composite)1