Package com.eclipsesource.tabris.app

Examples of com.eclipsesource.tabris.app.App.addEventListener()


  @Test
  public void testAddListensTransportsListenOperation() {
    App app = new AppImpl();
    AppListener listener = mock( AppListener.class );

    app.addEventListener( PAUSE, listener );

    verify( environment.getServiceObject() ).listen( "Pause", true );
  }

  @Test
View Full Code Here


  public void testAddEventListenersTransportsListenOperationOnce() {
    App app = new AppImpl();
    AppListener listener = mock( AppListener.class );
    AppListener listener2 = mock( AppListener.class );

    app.addEventListener( PAUSE, listener );
    app.addEventListener( PAUSE, listener2 );

    verify( environment.getServiceObject(), times( 1 ) ).listen( "Pause", true );
  }
View Full Code Here

    App app = new AppImpl();
    AppListener listener = mock( AppListener.class );
    AppListener listener2 = mock( AppListener.class );

    app.addEventListener( PAUSE, listener );
    app.addEventListener( PAUSE, listener2 );

    verify( environment.getServiceObject(), times( 1 ) ).listen( "Pause", true );
  }

  @Test
View Full Code Here

  @Test
  public void testRemoveListensTransportsListenOperation() {
    App app = new AppImpl();
    AppListener listener = mock( AppListener.class );
    app.addEventListener( PAUSE, listener );

    app.removeEventListener( PAUSE, listener );

    RemoteObject remoteObject = environment.getServiceObject();
    InOrder order = inOrder( remoteObject );
View Full Code Here

  @Test
  public void testRemoveEventListenersTransportsListenOperationOnce() {
    App app = new AppImpl();
    AppListener listener = mock( AppListener.class );
    AppListener listener2 = mock( AppListener.class );
    app.addEventListener( PAUSE, listener );
    app.addEventListener( PAUSE, listener2 );

    app.removeEventListener( PAUSE, listener );
    app.removeEventListener( PAUSE, listener2 );
View Full Code Here

  public void testRemoveEventListenersTransportsListenOperationOnce() {
    App app = new AppImpl();
    AppListener listener = mock( AppListener.class );
    AppListener listener2 = mock( AppListener.class );
    app.addEventListener( PAUSE, listener );
    app.addEventListener( PAUSE, listener2 );

    app.removeEventListener( PAUSE, listener );
    app.removeEventListener( PAUSE, listener2 );

    RemoteObject remoteObject = environment.getServiceObject();
View Full Code Here

  @Test
  public void testRemoveOneListenerDoesNotTransportsListenOperation() {
    App app = new AppImpl();
    AppListener listener = mock( AppListener.class );
    AppListener listener2 = mock( AppListener.class );
    app.addEventListener( PAUSE, listener );
    app.addEventListener( PAUSE, listener2 );

    app.removeEventListener( PAUSE, listener );

    RemoteObject remoteObject = environment.getServiceObject();
View Full Code Here

  public void testRemoveOneListenerDoesNotTransportsListenOperation() {
    App app = new AppImpl();
    AppListener listener = mock( AppListener.class );
    AppListener listener2 = mock( AppListener.class );
    app.addEventListener( PAUSE, listener );
    app.addEventListener( PAUSE, listener2 );

    app.removeEventListener( PAUSE, listener );

    RemoteObject remoteObject = environment.getServiceObject();
    InOrder order = inOrder( remoteObject );
View Full Code Here

  }

  private void registerAppStateListener() {
    final App app = RWT.getClient().getService( App.class );
    if( app != null ) {
      app.addEventListener( EventType.PAUSE, new AppListener() {

        public void handleEvent( AppEvent event ) {
          System.out.println("Paused");
          Label output = hal.getText();
          output.setText( "I am going to sleep now.\n" );
View Full Code Here

          output.setText( "I am going to sleep now.\n" );
          output.getParent().layout( true, true );
          sleepMillis = System.currentTimeMillis();
        }
      } );
      app.addEventListener( EventType.RESUME, new AppListener() {

        public void handleEvent( AppEvent event ) {
          System.out.println("Resumed");
          long slept = ( System.currentTimeMillis() - sleepMillis ) / 1000;
          Label output = hal.getText();
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.