Search in sources :

Example 41 with Widget

use of com.google.gwt.user.client.ui.Widget in project drools-wb by kiegroup.

the class GuidedDecisionTableAccordionItemTest method testInit.

@Test
public void testInit() throws Exception {
    final GuidedDecisionTableAccordionItem.Type type = GuidedDecisionTableAccordionItem.Type.CONDITION;
    final Widget widget = mock(Widget.class);
    item.init("uuid", type, widget);
    verify(item).refreshView();
    assertEquals(type, item.getType());
    assertEquals(widget, item.getContent());
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) Test(org.junit.Test)

Example 42 with Widget

use of com.google.gwt.user.client.ui.Widget in project drools-wb by kiegroup.

the class DTCellValueWidgetFactoryTest method testGetWidgetEnums.

@Test
public void testGetWidgetEnums() throws Exception {
    insertFactCol52.setFactType("Person");
    insertFactCol52.setFactField("name");
    when(oracle.hasEnums("Person", "name")).thenReturn(true);
    Widget widget = factory.getWidget(insertFactCol52, cellValue);
    assertTrue(widget instanceof ListBox);
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) ListBox(org.gwtbootstrap3.client.ui.ListBox) Test(org.junit.Test)

Example 43 with Widget

use of com.google.gwt.user.client.ui.Widget in project drools-wb by kiegroup.

the class EditConstraintPopup method initialiseValue.

private void initialiseValue() {
    // Don't show a ValueEditor if no operator has been selected
    if (operatorListBox.getSelectedIndex() == 0) {
        clone.setValue(null);
        valueGroup.setVisible(false);
        valueHolder.clear();
        return;
    }
    // Don't show a ValueEditor if the operator does not require a Value
    final String operator = operatorListBox.getValue(operatorListBox.getSelectedIndex());
    if (!OperatorsOracle.isValueRequired(operator)) {
        clone.setValue(null);
        valueGroup.setVisible(false);
        valueHolder.clear();
        return;
    }
    // Get an editor for the class, field and operator
    final Widget editor = valueEditorFactory.getValueEditor(clone.getClassName(), clone.getFieldName(), clone, oracle, OperatorsOracle.operatorRequiresList(operator));
    valueHolder.clear();
    if (editor != null) {
        valueGroup.setVisible(true);
        valueHolder.setWidget(editor);
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget)

Example 44 with Widget

use of com.google.gwt.user.client.ui.Widget in project drools-wb by kiegroup.

the class ListBoxSingletonDOMElementFactoryTest method setup.

@Before
public void setup() {
    when(listBox.getElement()).thenReturn(listBoxElement);
    when(listBoxElement.getStyle()).thenReturn(mock(Style.class));
    when(domElementContainer.iterator()).thenReturn(Collections.<Widget>emptyList().iterator());
    when(gridLayer.getDomElementContainer()).thenReturn(domElementContainer);
    when(gridWidget.getModel()).thenReturn(new BaseGridData());
    doAnswer((i) -> {
        final PrioritizedCommand command = (PrioritizedCommand) i.getArguments()[0];
        command.execute();
        return null;
    }).when(gridLayer).batch(any(PrioritizedCommand.class));
    factory = spy(new ListBoxSingletonDOMElementFactoryMock(gridLienzoPanel, gridLayer, gridWidget));
}
Also used : PrioritizedCommand(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager.PrioritizedCommand) Widget(com.google.gwt.user.client.ui.Widget) Style(com.google.gwt.dom.client.Style) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Before(org.junit.Before)

Example 45 with Widget

use of com.google.gwt.user.client.ui.Widget in project drools-wb by kiegroup.

the class AdditionalInfoPageTest method testAsWidget.

@Test
public void testAsWidget() {
    final Widget contentWidget = page.asWidget();
    assertEquals(contentWidget, content);
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) Test(org.junit.Test)

Aggregations

Widget (com.google.gwt.user.client.ui.Widget)110 Test (org.junit.Test)22 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)12 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)12 ListBox (org.gwtbootstrap3.client.ui.ListBox)8 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)7 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)7 Command (com.google.gwt.user.client.Command)7 HTML (com.google.gwt.user.client.ui.HTML)7 IsWidget (com.google.gwt.user.client.ui.IsWidget)7 Image (com.google.gwt.user.client.ui.Image)6 TextBox (org.gwtbootstrap3.client.ui.TextBox)5 FixedRatioWidget (org.rstudio.core.client.widget.FixedRatioWidget)5 PreWidget (org.rstudio.core.client.widget.PreWidget)5 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)4 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)4 Label (com.google.gwt.user.client.ui.Label)4 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)4 FromAccumulateCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern)4 FromCollectCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern)4