Search in sources :

Example 11 with Option

use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.

the class DeploymentScreenPopupViewImpl method addServerTemplates.

public void addServerTemplates(final Set<String> serverTemplateIds) {
    for (final String id : serverTemplateIds) {
        final Option option = GWT.create(Option.class);
        option.setText(id);
        option.setValue(id);
        serverTemplateDropdown.add(option);
    }
    serverTemplateDropdown.refresh();
    serverTemplateGroup.setVisible(true);
}
Also used : Option(org.gwtbootstrap3.extras.select.client.ui.Option)

Example 12 with Option

use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.

the class HeaderView method setUpdatesMenuList.

@Override
public void setUpdatesMenuList(final List<String> items) {
    updatesList.clear();
    for (String item : items) {
        final Option option = new Option();
        option.setText(item);
        updatesList.add(option);
    }
    updatesList.refresh();
}
Also used : Option(org.gwtbootstrap3.extras.select.client.ui.Option)

Example 13 with Option

use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.

the class DataTypePickerWidget method makeTypeSelector.

Optional<Option> makeTypeSelector(final BuiltInType bit) {
    final Option o = GWT.create(Option.class);
    o.setText(bit.getName());
    o.setValue(qNameConverter.toWidgetValue(normaliseBuiltInTypeTypeRef(bit.asQName())));
    return Optional.of(o);
}
Also used : Option(org.gwtbootstrap3.extras.select.client.ui.Option)

Example 14 with Option

use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.

the class DataTypePickerWidgetTest method testMakeTypeSelectorForItemDefinition.

@Test
public void testMakeTypeSelectorForItemDefinition() {
    final String itemDefinitionNameValue = "person";
    final ItemDefinition itemDefinition = definitions.getItemDefinition().get(0);
    itemDefinition.setName(new Name(itemDefinitionNameValue));
    final ArgumentCaptor<String> optionTextCaptor = ArgumentCaptor.forClass(String.class);
    final ArgumentCaptor<String> optionValueCaptor = ArgumentCaptor.forClass(String.class);
    final ArgumentCaptor<QName> qNameCaptor = ArgumentCaptor.forClass(QName.class);
    doReturn(itemDefinition.getName().getValue()).when(qNameConverter).toWidgetValue(any(QName.class));
    final Optional<Option> oo = picker.makeTypeSelector(itemDefinition);
    verify(option).setText(optionTextCaptor.capture());
    verify(option).setValue(optionValueCaptor.capture());
    verify(qNameConverter).toWidgetValue(qNameCaptor.capture());
    assertTrue(oo.isPresent());
    assertEquals(itemDefinitionNameValue, optionTextCaptor.getValue());
    assertEquals(itemDefinitionNameValue, optionValueCaptor.getValue());
    assertEquals(itemDefinitionNameValue, qNameCaptor.getValue().getLocalPart());
}
Also used : QName(org.kie.workbench.common.dmn.api.property.dmn.QName) ItemDefinition(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition) Option(org.gwtbootstrap3.extras.select.client.ui.Option) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) Test(org.junit.Test)

Example 15 with Option

use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.

the class NotificationEditorWidgetTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    GwtMockito.initMocks(this);
    BaseModal modal = mock(BaseModal.class);
    taskExpiration = mock(Select.class);
    setFieldValue(view, "taskExpiration", taskExpiration);
    Option notStarted = mock(Option.class);
    notCompleted = mock(Option.class);
    customerBinder = mock(DataBinder.class);
    searchSelectionReplyToHandler = mock(SingleLiveSearchSelectionHandler.class);
    searchSelectionFromHandler = mock(SingleLiveSearchSelectionHandler.class);
    multipleLiveSearchSelectionHandlerUsers = mock(MultipleLiveSearchSelectionHandler.class);
    multipleLiveSearchSelectionHandlerGroups = mock(MultipleLiveSearchSelectionHandler.class);
    notCompletedInput = mock(HTMLInputElement.class);
    notStartedInput = mock(HTMLInputElement.class);
    incorrectEmail = mock(ParagraphElement.class);
    doNothing().when(view).markEmailsAsCorrect();
    doNothing().when(modal).hide();
    doNothing().when(modal).show();
    doNothing().when(notificationEvent).fire(any(NotificationEvent.class));
    presenter = new NotificationEditorWidget(view, translationService);
    doCallRealMethod().when(typeSelect).setValue(any(String.class));
    doCallRealMethod().when(typeSelect).getValue();
    doCallRealMethod().when(view).setReadOnly(any(boolean.class));
    doNothing().when(view).createOrEdit(any(NotificationWidgetView.class), any(NotificationRow.class));
    doNothing().when(view).ok();
    setFieldValue(view, "modal", modal);
    setFieldValue(view, "body", body);
    setFieldValue(view, "customerBinder", customerBinder);
    setFieldValue(view, "notCompletedInput", notCompletedInput);
    setFieldValue(view, "notStartedInput", notStartedInput);
    setFieldValue(view, "subject", subject);
    setFieldValue(view, "emails", subject);
    setFieldValue(view, "searchSelectionFromHandler", searchSelectionFromHandler);
    setFieldValue(view, "searchSelectionReplyToHandler", searchSelectionReplyToHandler);
    setFieldValue(view, "multipleLiveSearchSelectionHandlerUsers", multipleLiveSearchSelectionHandlerUsers);
    setFieldValue(view, "multipleLiveSearchSelectionHandlerGroups", multipleLiveSearchSelectionHandlerGroups);
    setFieldValue(view, "notificationEvent", notificationEvent);
    setFieldValue(view, "validator", validator);
    setFieldValue(view, "closeButton", new HTMLButtonElement());
    setFieldValue(view, "okButton", new HTMLButtonElement());
    setFieldValue(view, "customerBinder", customerBinder);
    setFieldValue(view, "typeSelect", typeSelect);
    setFieldValue(view, "notStarted", notStarted);
    setFieldValue(view, "notCompleted", notCompleted);
    setFieldValue(view, "incorrectEmail", incorrectEmail);
    doCallRealMethod().when(body).setValue(any(String.class));
    doCallRealMethod().when(body).getValue();
    doCallRealMethod().when(subject).setValue(any(String.class));
    doCallRealMethod().when(subject).getValue();
    doCallRealMethod().when(typeSelect).setValue(any(String.class));
    doCallRealMethod().when(typeSelect).getValue();
    setFieldValue(liveSearchReplyToDropDown, "view", liveSearchDropDownView);
    when(validator.validate(any(NotificationRow.class))).thenReturn(Collections.EMPTY_SET);
    doNothing().when(liveSearchReplyToDropDown).setSelectedItem(any(String.class));
    doCallRealMethod().when(view).init(any(NotificationEditorWidgetView.Presenter.class));
    when(translationService.getValue(any(String.class))).thenReturn("Notification");
}
Also used : MultipleLiveSearchSelectionHandler(org.uberfire.ext.widgets.common.client.dropdown.MultipleLiveSearchSelectionHandler) ParagraphElement(com.google.gwt.dom.client.ParagraphElement) HTMLInputElement(elemental2.dom.HTMLInputElement) SingleLiveSearchSelectionHandler(org.uberfire.ext.widgets.common.client.dropdown.SingleLiveSearchSelectionHandler) NotificationEvent(org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.event.NotificationEvent) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) BaseModal(org.uberfire.ext.widgets.common.client.common.popups.BaseModal) Select(org.gwtbootstrap3.extras.select.client.ui.Select) NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow) Option(org.gwtbootstrap3.extras.select.client.ui.Option) DataBinder(org.jboss.errai.databinding.client.api.DataBinder) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Before(org.junit.Before)

Aggregations

Option (org.gwtbootstrap3.extras.select.client.ui.Option)17 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)3 GWT (com.google.gwt.core.client.GWT)1 ParagraphElement (com.google.gwt.dom.client.ParagraphElement)1 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 EventBus (com.google.gwt.event.shared.EventBus)1 DOM (com.google.gwt.user.client.DOM)1 Window (com.google.gwt.user.client.Window)1 FlexTable (com.google.gwt.user.client.ui.FlexTable)1 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)1 HTML (com.google.gwt.user.client.ui.HTML)1 HasHorizontalAlignment (com.google.gwt.user.client.ui.HasHorizontalAlignment)1 HasVerticalAlignment (com.google.gwt.user.client.ui.HasVerticalAlignment)1 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)1 Image (com.google.gwt.user.client.ui.Image)1 Label (com.google.gwt.user.client.ui.Label)1 Widget (com.google.gwt.user.client.ui.Widget)1 HTMLButtonElement (elemental2.dom.HTMLButtonElement)1