Search in sources :

Example 31 with NotificationRow

use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.

the class NotificationWidgetViewImpl method initBody.

private void initBody() {
    PopoverTextCell typeCell = new PopoverTextCell();
    Column<NotificationRow, String> bodyColumn = new Column<NotificationRow, String>(typeCell) {

        @Override
        public String getValue(NotificationRow object) {
            if (object.getBody() != null) {
                return object.getBody();
            }
            return "";
        }
    };
    bodyColumn.setSortable(false);
    table.addColumn(bodyColumn, presenter.getBodyLabel());
    table.setColumnWidth(bodyColumn, 160, Style.Unit.PX);
}
Also used : Column(com.google.gwt.user.cellview.client.Column) PopoverTextCell(org.uberfire.ext.widgets.common.client.tables.PopoverTextCell) NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow)

Example 32 with NotificationRow

use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.

the class NotificationWidgetViewImpl method initExpiresAt.

private void initExpiresAt() {
    PopoverTextCell expiresAt = new PopoverTextCell();
    Column<NotificationRow, String> expiresAtColumn = new Column<NotificationRow, String>(expiresAt) {

        @Override
        public String getValue(NotificationRow object) {
            if (object.getExpiresAt() != null) {
                return object.getExpiresAt();
            }
            return "";
        }
    };
    expiresAtColumn.setSortable(false);
    table.addColumn(expiresAtColumn, presenter.getExpiresAtLabel());
    table.setColumnWidth(expiresAtColumn, 80, Style.Unit.PX);
}
Also used : Column(com.google.gwt.user.cellview.client.Column) PopoverTextCell(org.uberfire.ext.widgets.common.client.tables.PopoverTextCell) NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow)

Example 33 with NotificationRow

use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.

the class NotificationWidgetViewImpl method initFrom.

private void initFrom() {
    TextCell typeCell = new TextCell();
    Column<NotificationRow, String> fromColumn = new Column<NotificationRow, String>(typeCell) {

        @Override
        public String getValue(NotificationRow object) {
            if (object.getFrom() != null) {
                return object.getFrom();
            }
            return "";
        }
    };
    fromColumn.setSortable(false);
    table.addColumn(fromColumn, presenter.getFromLabel());
    table.setColumnWidth(fromColumn, 70, Style.Unit.PX);
}
Also used : Column(com.google.gwt.user.cellview.client.Column) NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow) TextCell(com.google.gwt.cell.client.TextCell) PopoverTextCell(org.uberfire.ext.widgets.common.client.tables.PopoverTextCell)

Example 34 with NotificationRow

use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.

the class NotificationWidgetViewImpl method initEmails.

private void initEmails() {
    PopoverTextCell toEmails = new PopoverTextCell();
    Column<NotificationRow, String> toEmailsColumn = new Column<NotificationRow, String>(toEmails) {

        @Override
        public String getValue(NotificationRow object) {
            if (object.getEmails() != null) {
                return join(",", object.getEmails());
            }
            return "";
        }
    };
    toEmailsColumn.setSortable(false);
    table.addColumn(toEmailsColumn, presenter.getToEmailsLabel());
    table.setColumnWidth(toEmailsColumn, 160, Style.Unit.PX);
}
Also used : Column(com.google.gwt.user.cellview.client.Column) PopoverTextCell(org.uberfire.ext.widgets.common.client.tables.PopoverTextCell) NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow)

Example 35 with NotificationRow

use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.

the class NotificationValueValidatorTest method testR0PT1H.

@Test
public void testR0PT1H() {
    NotificationRow notification = new NotificationRow();
    notification.setExpiresAt("R0/PT1H");
    boolean result = validator.isValid(notification, context);
    assertFalse(result);
    assertEquals(NotificationValueValidator.WRONG_EXPIRES_AT_EXPRESSION, errorMessages.get(0));
}
Also used : NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow) Test(org.junit.Test)

Aggregations

NotificationRow (org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow)140 Test (org.junit.Test)127 Column (com.google.gwt.user.cellview.client.Column)11 ReflectionUtilsTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)9 PopoverTextCell (org.uberfire.ext.widgets.common.client.tables.PopoverTextCell)9 ArrayList (java.util.ArrayList)5 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)4 LienzoMockitoTestRunner (com.ait.lienzo.test.LienzoMockitoTestRunner)3 TextCell (com.google.gwt.cell.client.TextCell)3 HasData (com.google.gwt.view.client.HasData)3 ListDataProvider (com.google.gwt.view.client.ListDataProvider)3 GwtMock (com.google.gwtmockito.GwtMock)3 GwtMockito (com.google.gwtmockito.GwtMockito)3 Collections (java.util.Collections)3 List (java.util.List)3 Assert (org.junit.Assert)3 Before (org.junit.Before)3 RunWith (org.junit.runner.RunWith)3 NotificationsEditorWidget (org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.NotificationsEditorWidget)3 NotificationEvent (org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.event.NotificationEvent)3