Package com.google.gwt.core.client

Examples of com.google.gwt.core.client.JsArrayInteger


        // Window.alert("Got message as string: " + event.getBody());
        assertFalse("!isMessageNumber()", event.isMessageNumber());
        assertFalse("!isMessageString()", event.isMessageString());
        assertTrue("isMessageObject()", event.isMessageObject());
        assertFalse("!isMessageBoolean()", event.isMessageBoolean());
        JsArrayInteger result = event.getBodyArrayInteger();
        assertEquals("length of array", 3, result.length());
        assertEquals("array[0]", 1, result.get(0));
        assertEquals("array[1]", 2, result.get(1));
        assertEquals("array[2]", 3, result.get(2));
        finishTest();
      }
    });
    wp.sendMessage("arrayInteger", workerID);
  }
View Full Code Here


    }
    return result;
  }

  public static JsArrayInteger wrapArray(int[] srcArray) {
    JsArrayInteger result = JavaScriptObject.createArray().cast();
    for (int i = 0; i < srcArray.length; i++) {
      result.set(i, srcArray[i]);
    }
    return result;
  }
View Full Code Here

    }
    return result;
  }

  public static JsArrayInteger wrapArray(byte[] srcArray) {
    JsArrayInteger result = JavaScriptObject.createArray().cast();
    for (int i = 0; i < srcArray.length; i++) {
      result.set(i, srcArray[i]);
    }
    return result;
  }
View Full Code Here

   
    for (int i = 0; i < jsTimezoneNames.length(); i++) {
      tz.tzNames[i] = jsTimezoneNames.get(i);
    }

    JsArrayInteger transitions = timezoneData.getTransitions();   

    if (transitions == null || transitions.length() == 0) {
      tz.transitionPoints = null;
      tz.adjustments = null;
    } else {
      int transitionNum = transitions.length() / 2;
      tz.transitionPoints = new int[transitionNum];
      tz.adjustments = new int[transitionNum];

      for (int i = 0; i < transitionNum; ++i) {
        tz.transitionPoints[i] = transitions.get(i * 2);
        tz.adjustments[i] = transitions.get(i * 2 + 1);
      }
    }
    return tz;
  }
View Full Code Here

     * Sets the value of value.
     *
     * @param value
     */
    public void setSliderValues(int[] value) {
        JsArrayInteger values = JavaScriptObject.createArray().cast();
        for (int i = 0; i < value.length; i++) {
            values.set(i, value[i]);
        }
        setSliderValues(values);
    }
View Full Code Here

      this.location.replace(helpURL) ;
   }-*/;

   public final Point getScrollPosition()
   {
      JsArrayInteger pos = getScrollPositionInternal();
      return new Point(pos.get(0), pos.get(1));
   }
View Full Code Here

      return !("None".equals(getSelectionType())) && !isSelectionCollapsed();
   }

   public Rectangle getCursorBounds(Document doc)
   {
      JsArrayInteger result = getSelectionBoundsInternal(doc);
      return new Rectangle(
            result.get(0),
            result.get(1),
            result.get(2),
            result.get(3)
      );
   }
View Full Code Here

   public int[] getSelectionOffsets(Element container)
   {
      if (!isSelectionInElement(container))
         return null;

      JsArrayInteger results = getSelectionOffsetsJs(container);
      if (results == null)
         return null;
      else
         return new int[] {results.get(0), results.get(1)};
   }
View Full Code Here

      return result;
   }
  
   public static JsArrayInteger toJsArrayInteger(Iterable<Integer> integers)
   {
      JsArrayInteger result = JsArrayInteger.createArray().cast();
      for (Integer i : integers)
         result.push(i);
      return result;
   }
View Full Code Here

        jsJobTrigger.setNativeStartTime( DateTimeFormat.getFormat( PredefinedFormat.ISO_8601 ).format( startDateTime ) );
        if ( endDate != null ) {
          jsJobTrigger.setNativeEndTime( DateTimeFormat.getFormat( PredefinedFormat.ISO_8601 ).format( endDate ) );
        }
      } else {
        JsArrayInteger jsDaysOfWeek = (JsArrayInteger) JavaScriptObject.createArray();
        int i = 0;
        for ( DayOfWeek dayOfWeek : daysOfWeek ) {
          jsDaysOfWeek.set( i++, dayOfWeek.ordinal() + 1 );
        }
        JsArrayInteger hours = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, startHour );
        JsArrayInteger minutes = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, startMin );
        JsArrayInteger seconds = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, 0 );

        jsJobTrigger.setType( "complexJobTrigger" ); //$NON-NLS-1$
        jsJobTrigger.setDayOfWeekRecurrences( jsDaysOfWeek );
        jsJobTrigger.setHourRecurrences( hours );
        jsJobTrigger.setMinuteRecurrences( minutes );
        jsJobTrigger.setSecondRecurrences( seconds );
        jsJobTrigger.setNativeStartTime( DateTimeFormat.getFormat( PredefinedFormat.ISO_8601 ).format( startDateTime ) );
        if ( endDate != null ) {
          jsJobTrigger.setNativeEndTime( DateTimeFormat.getFormat( PredefinedFormat.ISO_8601 ).format( endDate ) );
        }
      }
    } else if ( scheduleType == ScheduleType.CRON ) { // Cron jobs
      jsJobTrigger.setType( "cronJobTrigger" ); //$NON-NLS-1$
    } else if ( ( scheduleType == ScheduleType.WEEKLY ) && ( daysOfWeek.size() > 0 ) ) {
      JsArrayInteger jsDaysOfWeek = (JsArrayInteger) JavaScriptObject.createArray();
      int i = 0;
      for ( DayOfWeek dayOfWeek : daysOfWeek ) {
        jsDaysOfWeek.set( i++, dayOfWeek.ordinal() + 1 );
      }
      JsArrayInteger hours = (JsArrayInteger) JavaScriptObject.createArray();
      hours.set( 0, startHour );
      JsArrayInteger minutes = (JsArrayInteger) JavaScriptObject.createArray();
      hours.set( 0, startMin );
      JsArrayInteger seconds = (JsArrayInteger) JavaScriptObject.createArray();
      hours.set( 0, 0 );

      jsJobTrigger.setType( "complexJobTrigger" ); //$NON-NLS-1$
      jsJobTrigger.setDayOfWeekRecurrences( jsDaysOfWeek );
      jsJobTrigger.setHourRecurrences( hours );
      jsJobTrigger.setMinuteRecurrences( minutes );
      jsJobTrigger.setSecondRecurrences( seconds );
      jsJobTrigger.setNativeStartTime( DateTimeFormat.getFormat( PredefinedFormat.ISO_8601 ).format( startDateTime ) );
      if ( endDate != null ) {
        jsJobTrigger.setNativeEndTime( DateTimeFormat.getFormat( PredefinedFormat.ISO_8601 ).format( endDate ) );
      }
    } else if ( ( scheduleType == ScheduleType.MONTHLY )
        || ( ( scheduleType == ScheduleType.YEARLY ) && ( monthOfYear != null ) ) ) {
      jsJobTrigger.setType( "complexJobTrigger" ); //$NON-NLS-1$

      if ( dayOfMonth != null ) {
        JsArrayInteger jsDaysOfMonth = (JsArrayInteger) JavaScriptObject.createArray();
        jsDaysOfMonth.set( 0, dayOfMonth );

        JsArrayInteger hours = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, startHour );
        JsArrayInteger minutes = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, startMin );
        JsArrayInteger seconds = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, 0 );

        jsJobTrigger.setType( "complexJobTrigger" ); //$NON-NLS-1$
        if ( monthOfYear != null ) {
          JsArrayInteger jsMonthsOfYear = (JsArrayInteger) JavaScriptObject.createArray();
          jsMonthsOfYear.set( 0, monthOfYear.ordinal() + 1 );
          jsJobTrigger.setMonthlyRecurrences( jsMonthsOfYear );
        }
        jsJobTrigger.setDayOfMonthRecurrences( jsDaysOfMonth );
        jsJobTrigger.setHourRecurrences( hours );
        jsJobTrigger.setMinuteRecurrences( minutes );
        jsJobTrigger.setSecondRecurrences( seconds );
        jsJobTrigger.setNativeStartTime( DateTimeFormat.getFormat( PredefinedFormat.ISO_8601 ).format( startDateTime ) );
        if ( endDate != null ) {
          jsJobTrigger.setNativeEndTime( DateTimeFormat.getFormat( PredefinedFormat.ISO_8601 ).format( endDate ) );
        }
      } else if ( ( daysOfWeek.size() > 0 ) && ( weekOfMonth != null ) ) {
        JsArrayInteger jsDaysOfWeek = (JsArrayInteger) JavaScriptObject.createArray();
        int i = 0;
        for ( DayOfWeek dayOfWeek : daysOfWeek ) {
          jsDaysOfWeek.set( i++, dayOfWeek.ordinal() + 1 );
        }

        JsArrayInteger hours = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, startHour );
        JsArrayInteger minutes = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, startMin );
        JsArrayInteger seconds = (JsArrayInteger) JavaScriptObject.createArray();
        hours.set( 0, 0 );

        jsJobTrigger.setType( "complexJobTrigger" ); //$NON-NLS-1$
        if ( monthOfYear != null ) {
          JsArrayInteger jsMonthsOfYear = (JsArrayInteger) JavaScriptObject.createArray();
          jsMonthsOfYear.set( 0, monthOfYear.ordinal() + 1 );
          jsJobTrigger.setMonthlyRecurrences( jsMonthsOfYear );
        }
        jsJobTrigger.setHourRecurrences( hours );
        jsJobTrigger.setMinuteRecurrences( minutes );
        jsJobTrigger.setSecondRecurrences( seconds );
View Full Code Here

TOP

Related Classes of com.google.gwt.core.client.JsArrayInteger

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.