Examples of GeolocationListener


Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

    assertPositionData( captor.getValue() );
  }

  @Test
  public void testDelegatesPositionWhenWatchToAllListeners() throws ParseException {
    GeolocationListener listener1 = mock( GeolocationListener.class );
    GeolocationListener listener2 = mock( GeolocationListener.class );
    GeolocationImpl geolocation = new GeolocationImpl();
    geolocation.addGeolocationListener( listener1 );
    geolocation.addGeolocationListener( listener2 );
    geolocation.watchPosition( new GeolocationOptions() );
    JsonObject properties = createPositionData();
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

    return new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" ).parse( "2012-03-12T10:40:13+0100" );
  }

  @Test
  public void testDelegatesPositionErrorWhenGetPosition() {
    GeolocationListener listener = mock( GeolocationListener.class );
    GeolocationImpl geolocation = new GeolocationImpl();
    geolocation.addGeolocationListener( listener );
    geolocation.determineCurrentPosition( new GeolocationOptions() );
    JsonObject properties = new JsonObject();
    properties.add( "errorCode", "UNKNOWN" );
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

    assertEquals( "A Message", captor.getValue().getMessage() );
  }

  @Test
  public void testDelegatesPositionErrorWhenWatch() {
    GeolocationListener listener = mock( GeolocationListener.class );
    GeolocationImpl geolocation = new GeolocationImpl();
    geolocation.addGeolocationListener( listener );
    geolocation.watchPosition( new GeolocationOptions() );
    JsonObject properties = new JsonObject();
    properties.add( "errorCode", "UNKNOWN" );
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

  @Test
  public void testSetsOptionsWhenGetLocation() {
    RemoteObject remoteObject = environment.getServiceObject();
    GeolocationImpl geolocation = new GeolocationImpl();
    GeolocationOptions options = new GeolocationOptions();
    GeolocationListener listener = mock( GeolocationListener.class );
    geolocation.addGeolocationListener( listener );

    geolocation.determineCurrentPosition( options );

    verify( remoteObject ).set( "needsPosition", "ONCE" );
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

  }

  @Test( expected = IllegalArgumentException.class )
  public void testGetLocationFailsWithNullOptions() {
    GeolocationImpl geolocation = new GeolocationImpl();
    GeolocationListener listener = mock( GeolocationListener.class );
    geolocation.addGeolocationListener( listener );

    geolocation.determineCurrentPosition( null );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

  @Test
  public void testSetsOptionsWhenWatch() {
    RemoteObject remoteObject = environment.getServiceObject();
    GeolocationImpl geolocation = new GeolocationImpl();
    GeolocationOptions options = new GeolocationOptions();
    GeolocationListener listener = mock( GeolocationListener.class );
    geolocation.addGeolocationListener( listener );

    geolocation.watchPosition( options );

    verify( remoteObject ).set( "needsPosition", "CONTINUOUS" );
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

    verify( remoteObject, times( 2 ) ).set( "needsPosition", "NEVER" );
  }

  @Test
  public void testDelegatesPositionWhenGetPosition() throws ParseException {
    GeolocationListener listener = mock( GeolocationListener.class );
    GeolocationImpl geolocation = new GeolocationImpl();
    geolocation.addGeolocationListener( listener );
    geolocation.determineCurrentPosition( new GeolocationOptions() );
    JsonObject properties = createPositionData();
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

    assertPositionData( captor.getValue() );
  }

  @Test
  public void testDelegatesPositionWhenGetPositionToAllListeners() throws ParseException {
    GeolocationListener listener1 = mock( GeolocationListener.class );
    GeolocationListener listener2 = mock( GeolocationListener.class );
    GeolocationImpl geolocation = new GeolocationImpl();
    geolocation.addGeolocationListener( listener1 );
    geolocation.addGeolocationListener( listener2 );
    geolocation.determineCurrentPosition( new GeolocationOptions() );
    JsonObject properties = createPositionData();
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

    assertPositionData( captor.getAllValues().get( 1 ) );
  }

  @Test
  public void testDelegatesPositionWhenWatch() throws ParseException {
    GeolocationListener listener = mock( GeolocationListener.class );
    GeolocationImpl geolocation = new GeolocationImpl();
    geolocation.addGeolocationListener( listener );
    geolocation.watchPosition( new GeolocationOptions() );
    JsonObject properties = createPositionData();
View Full Code Here

Examples of com.eclipsesource.tabris.geolocation.GeolocationListener

    Button getLocationButton = new Button( container, SWT.PUSH );
    getLocationButton.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
    getLocationButton.setText( "Open my position in maps" );
    getLocationButton.setBackground( new Color( getLocationButton.getDisplay(), 60, 60, 60 ) );
    getLocationButton.setForeground( new Color( getLocationButton.getDisplay(), 225, 255, 255 ) );
    final GeolocationListener listener = new GeolocationListener() {

      @Override
      public void positionReceived( Position position ) {
        openLocation( position.getCoords().getLatitude(), position.getCoords().getLongitude() );
        geolocation.removeGeolocationListener( this );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.