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());
}
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);
}
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);
}
}
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));
}
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);
}
Aggregations