use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method testISO8601WithWrongTZRepeatableValue.
@Test
public void testISO8601WithWrongTZRepeatableValue() {
NotificationRow notification = new NotificationRow();
notification.setExpiresAt("2019-07-14T13:34-022");
boolean result = validator.isValid(notification, context);
assertFalse(result);
assertEquals(NotificationValueValidator.WRONG_EXPIRES_AT_EXPRESSION, errorMessages.get(0));
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method testDurationsD.
@Test
public void testDurationsD() {
NotificationRow value = new NotificationRow();
value.setExpiresAt("P1DT20H13M7MS");
boolean result = validator.isValid(value, context);
assertTrue(result);
assertTrue(errorMessages.isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method testWrongTimesZeroRepeatableUntilNotification.
@Test
public void testWrongTimesZeroRepeatableUntilNotification() {
NotificationRow notification = new NotificationRow();
notification.setExpiresAt("R/PT0H");
boolean result = validator.isValid(notification, context);
assertFalse(result);
assertEquals(NotificationValueValidator.WRONG_EXPIRES_AT_EXPRESSION, errorMessages.get(0));
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method test9m.
@Test
public void test9m() {
NotificationRow value = new NotificationRow();
value.setExpiresAt("9m");
boolean result = validator.isValid(value, context);
assertTrue(result);
assertTrue(errorMessages.isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationWidgetViewImpl method initDelete.
private void initDelete() {
AbstractCell<NotificationRow> buttonCell = new AbstractCell<NotificationRow>(ClickEvent.getType().getName()) {
@Override
public void render(Context context, NotificationRow value, SafeHtmlBuilder sb) {
Button button = new Button();
button.setSize(ButtonSize.SMALL);
button.add(new Icon(IconType.TRASH));
sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
}
@Override
public void onBrowserEvent(Context context, Element parent, NotificationRow value, NativeEvent event, ValueUpdater<NotificationRow> valueUpdater) {
if (!readOnly) {
delete(value);
}
}
};
Column<NotificationRow, NotificationRow> deleteColumn = new Column<NotificationRow, NotificationRow>(buttonCell) {
@Override
public NotificationRow getValue(NotificationRow object) {
return object;
}
};
deleteColumn.setSortable(false);
table.addColumn(deleteColumn, presenter.getDeleteLabel());
table.setColumnWidth(deleteColumn, 60, Style.Unit.PX);
}
Aggregations