Package com.eclipsesource.tabris.interaction

Examples of com.eclipsesource.tabris.interaction.AppLauncher


  @Test
  public void testHasAppLauncherService() {
    TabrisClient client = new TabrisClientImpl();

    AppLauncher launcher = client.getService( AppLauncher.class );

    assertNotNull( launcher );
  }
View Full Code Here


  @Test
  public void testAppLauncherIsSingleton() {
    TabrisClient client = new TabrisClientImpl();

    AppLauncher launcher = client.getService( AppLauncher.class );

    assertSame( launcher, client.getService( AppLauncher.class ) );
  }
View Full Code Here

    assertTrue( Serializable.class.isAssignableFrom( AppLauncherImpl.class ) );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWithNullOptions() {
    AppLauncher launcher = new AppLauncherImpl();

    launcher.open( null );
  }
View Full Code Here

  }

  @Test
  public void testOpenCreatsCallOperation() {
    RemoteObject remoteObject = environment.getRemoteObject();
    AppLauncher launcher = new AppLauncherImpl();

    launcher.open( new MailOptions( "foo" ) );

    ArgumentCaptor<JsonObject> captor = ArgumentCaptor.forClass( JsonObject.class );
    verify( remoteObject ).call( eq( "open" ), captor.capture() );
    assertEquals( JsonValue.valueOf( App.MAIL.toString() ), captor.getValue().get( "app" ) );
  }
View Full Code Here

  }

  @Test
  public void testOpenCreatsCallOperationWithProperties() {
    RemoteObject remoteObject = environment.getRemoteObject();
    AppLauncher launcher = new AppLauncherImpl();
    LaunchOptions options = new MailOptions( "foo" );
    options.add( "foo", "bar" );
    options.add( "foo1", "bar1" );

    launcher.open( options );

    ArgumentCaptor<JsonObject> captor = ArgumentCaptor.forClass( JsonObject.class );
    verify( remoteObject ).call( eq( "open" ), captor.capture() );
    assertEquals( JsonValue.valueOf( "bar" ), captor.getValue().get( "foo" ) );
    assertEquals( JsonValue.valueOf( "bar1" ), captor.getValue().get( "foo1" ) );
View Full Code Here

  }

  @Test
  public void testOpenUrlCreatesCallOperation() {
    RemoteObject remoteObject = environment.getRemoteObject();
    AppLauncher launcher = new AppLauncherImpl();

    launcher.openUrl( "http://foo.bar" );

    ArgumentCaptor<JsonObject> captor = ArgumentCaptor.forClass( JsonObject.class );
    verify( remoteObject ).call( eq( "openUrl" ), captor.capture() );
    assertEquals( JsonValue.valueOf( "http://foo.bar" ), captor.getValue().get( "url" ) );
  }
View Full Code Here

    assertEquals( JsonValue.valueOf( "http://foo.bar" ), captor.getValue().get( "url" ) );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testOpenUrlFailsWithNull() {
    AppLauncher launcher = new AppLauncherImpl();

    launcher.openUrl( null );
  }
View Full Code Here

    launcher.openUrl( null );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testOpenUrlFailsWithInvalidUrl() {
    AppLauncher launcher = new AppLauncherImpl();

    launcher.openUrl( "fooBar" );
  }
View Full Code Here

    imageLabel.setImage( new Image( parent.getDisplay(), Page.class.getResourceAsStream( "/tabris.png" ) ) );
   
    // Add an action to open a website
    imageLabel.addMouseListener( new MouseAdapter() {
      public void mouseUp( MouseEvent e ) {
        AppLauncher appLauncher = RWT.getClient().getService( AppLauncher.class );
        appLauncher.openUrl( "http://eclipsesource.com/blogs/tag/tabris/" );
      }
  } );
  }
View Full Code Here

  private Display display;

  public int createUI() {
    display = new Display();
    final Shell shell = createShell();
    AppLauncher appLauncher = RWT.getClient().getService( AppLauncher.class );
    if( appLauncher != null ) {
      createToolBar( shell );
      Composite container = createParentComposite( shell );
      createBrowserLauncher( container, appLauncher );
      createMailLauncher( container, appLauncher );
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.interaction.AppLauncher

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.