public void setPattern ( String patternType ) { final PatternType type = PatternType . valueOf ( patternType ) ; if ( type != m_model . getPatternType ( ) ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { EndType oldEndType = m_model . getEndType ( ) ; m_model . setPatternType ( type ) ; m_model . setIndividualDates ( null ) ; m_model . setInterval ( getPatternDefaultValues ( ) . getInterval ( ) ) ; m_model . setEveryWorkingDay ( Boolean . FALSE ) ; m_model . clearWeekDays ( ) ; m_model . clearIndividualDates ( ) ; m_model . clearWeeksOfMonth ( ) ; m_model . clearExceptions ( ) ; if ( type . equals ( PatternType . NONE ) || type . equals ( PatternType . INDIVIDUAL ) ) { m_model . setEndType ( EndType . SINGLE ) ; } else if ( oldEndType . equals ( EndType . SINGLE ) ) { m_model . setEndType ( EndType . TIMES ) ; m_model . setOccurrences ( 10 ) ; m_model . setSeriesEndDate ( null ) ; } m_model . setDayOfMonth ( getPatternDefaultValues ( ) . getDayOfMonth ( ) ) ; m_model . setMonth ( getPatternDefaultValues ( ) . getMonth ( ) ) ; if ( type . equals ( PatternType . WEEKLY ) ) { m_model . setWeekDay ( getPatternDefaultValues ( ) . getWeekDay ( ) ) ; } valueChanged ( ) ; } } ) ; } }
Set the serial pattern type .