/** * Constructs a new VALARM instance that will trigger at the specified time. * @param trigger the time the alarm will trigger */ public VAlarm(final DateTime trigger) { this(); getProperties().add(new Trigger(trigger)); }
/** * Constructs a new VALARM instance that will trigger at the specified time relative to the event/todo component. * @param trigger a duration of time relative to the parent component that the alarm will trigger at */ public VAlarm(final TemporalAmount trigger) { this(); getProperties().add(new Trigger(trigger)); }
@Override public void execute(String input) { PropertyValidator.getInstance().assertOne(input, target.getProperties()); } });
/** * Constructs a new VALARM instance that will trigger at the specified time relative to the event/todo component. * @param trigger a duration of time relative to the parent component that the alarm will trigger at */ public VAlarm(final Dur trigger) { this(); getProperties().add(new Trigger(trigger)); }
/** * Constructs a new VALARM instance that will trigger at the specified time relative to the event/todo component. * @param trigger a duration of time relative to the parent component that the alarm will trigger at */ public VAlarm(final Dur trigger) { this(); getProperties().add(new Trigger(trigger)); }
public Trigger getDisplayAlarmTrigger() { VAlarm alarm = getDisplayAlarm(); if(alarm==null) { return null; } return (Trigger) alarm.getProperties().getProperty(Property.TRIGGER); }
/** * Constructs a new VALARM instance that will trigger at the specified time. * @param trigger the time the alarm will trigger */ public VAlarm(final DateTime trigger) { this(); getProperties().add(new Trigger(trigger)); }
/** * {@inheritDoc} */ public void validate(VAlarm target) throws ValidationException { /* * ; the following are all REQUIRED, ; but MUST NOT occur more than once action / description / trigger / */ PropertyValidator.getInstance().assertOne(Property.DESCRIPTION, target.getProperties()); } }
/** * {@inheritDoc} */ public void validate(VAlarm target) throws ValidationException { /* * ; the following are all REQUIRED, ; but MUST NOT occur more than once action / description / trigger / */ PropertyValidator.getInstance().assertOne(DESCRIPTION, target.getProperties()); } }
/** * {@inheritDoc} */ public void validate(VAlarm target) throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once attach / */ PropertyValidator.getInstance().assertOneOrLess(Property.ATTACH, target.getProperties()); } }
/** * Constructs a new VALARM instance that will trigger at the specified time. * @param trigger the time the alarm will trigger */ public VAlarm(final DateTime trigger) { this(); getProperties().add(new Trigger(trigger)); }
/** * {@inheritDoc} */ public void validate(VAlarm target) throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once attach / */ PropertyValidator.getInstance().assertOneOrLess(Property.ATTACH, target.getProperties()); } }
@Override public void execute(String input) { PropertyValidator.getInstance().assertOne(input, target.getProperties()); } });
/** * {@inheritDoc} */ public void validate(VAlarm target) throws ValidationException { /* * ; the following are all REQUIRED, ; but MUST NOT occur more than once action / description / trigger / */ PropertyValidator.getInstance().assertOne(DESCRIPTION, target.getProperties()); } }
/** * Constructs a new VALARM instance that will trigger at the specified time relative to the event/todo component. * @param trigger a duration of time relative to the parent component that the alarm will trigger at */ public VAlarm(final TemporalAmount trigger) { this(); getProperties().add(new Trigger(trigger)); }
public String getDisplayAlarmDescription() { VAlarm alarm = getDisplayAlarm(); if(alarm==null) { return null; } Description description = (Description) alarm.getProperties() .getProperty(Property.DESCRIPTION); if(description==null) { return null; } return description.getValue(); }
public Integer getDisplayAlarmRepeat() { VAlarm alarm = getDisplayAlarm(); if(alarm==null) { return null; } Repeat repeat = (Repeat) alarm.getProperties().getProperty(Property.REPEAT); if(repeat==null) { return null; } return repeat.getCount(); }
protected VAlarm getDisplayAlarm(VEvent event) { ComponentList<VAlarm> alarmsList = event.getAlarms(); for(VAlarm alarm: alarmsList) { if (alarm.getProperties().getProperty(Property.ACTION).equals( Action.DISPLAY)) { return alarm; } } return null; }
@Override public void applyTo(VAlarm element) { Action action = element.getAction(); if (action == null || !"DISPLAY".equals(action.getValue()) || element.getDescription() != null && element.getDescription().getValue() != null) { return; } Description description = new Description("display"); element.getProperties().add(description); }
public void creatDisplayAlarm() { VAlarm alarm = new VAlarm(); alarm.getProperties().add(Action.DISPLAY); getEvent().getAlarms().add(alarm); setDisplayAlarmDescription("Event Reminder"); } }