Package org.pentaho.gwt.widgets.client.controls

Examples of org.pentaho.gwt.widgets.client.controls.TimePicker


  protected ListBox timeZonePicker = null;

  public ScheduleEditor( ScheduleDialogType type ) {
    super();
    isBlockoutDialog = ( type == ScheduleDialogType.BLOCKOUT );
    startTimePicker = new TimePicker();
    startTimePicker.setTime( new Date() );
    //Increase the initial time to one minute ahead of now to avoid time in the past error popup
    int minutePlusOne = Integer.parseInt( startTimePicker.getMinute() ) + 1;
    startTimePicker.setMinute( Integer.toString( minutePlusOne ) );


    setStylePrimaryName( "scheduleEditor" ); //$NON-NLS-1$

    scheduleCombo = createScheduleCombo();
    Label l = new Label( Messages.getString( "schedule.recurrenceColon" ) );
    l.setStyleName( SCHEDULE_LABEL );
    add( l );
    add( scheduleCombo );

    SimplePanel hspacer = new SimplePanel();
    hspacer.setWidth( "100px" ); //$NON-NLS-1$

    if ( !isBlockoutDialog ) {
      startTimePanel = createStartTimePanel();
      add( startTimePanel );
    } else {

      // Blockout End TimePicker
      blockoutEndTimePicker = new TimePicker();
      blockoutEndTimePicker.setHour( "01" ); //$NON-NLS-1$
      blockoutEndTimePicker.setMinute( "00" ); //$NON-NLS-1$
      blockoutEndTimePicker.setTimeOfDay( TimeUtil.TimeOfDay.PM );

      // Blockout End Caption Panel
View Full Code Here


    if ( ENDS_TYPE.DURATION.equals( this.scheduleEditor.getBlockoutEndsType() ) ) {
      DurationValues durationValues = this.scheduleEditor.getDurationValues();
      isValid &= durationValues.days != 0 || durationValues.hours != 0 || durationValues.minutes != 0;

    } else {
      TimePicker startTimePicker = this.scheduleEditor.getStartTimePicker();
      int startTimeHour = Integer.parseInt( startTimePicker.getHour() );
      int startTimeMinute = Integer.parseInt( startTimePicker.getMinute() );

      int startTime =
          startTimeMinute + ( startTimeHour + ( PM.equals( startTimePicker.getTimeOfDay() ) ? 12 : 0 ) ) * 60;

      TimePicker endTimePicker = this.scheduleEditor.getBlockoutEndTimePicker();
      int endTimeHour = Integer.parseInt( endTimePicker.getHour() );
      int endTimeMinute = Integer.parseInt( endTimePicker.getMinute() );

      int endTime = endTimeMinute + ( endTimeHour + ( PM.equals( endTimePicker.getTimeOfDay() ) ? 12 : 0 ) ) * 60;

      isValid &= endTime > startTime;
    }
    return isValid;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.gwt.widgets.client.controls.TimePicker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.