Package com.eclipsesource.tabris.ui

Examples of com.eclipsesource.tabris.ui.UIConfiguration


    assertSame( actionConfiguration, actualConfiguration );
  }

  @Test
  public void testCanGetActionConfigurationForPageAction() {
    UIConfiguration configuration = new UIConfiguration();
    PageConfiguration pageConfiguration = new PageConfiguration( "foo", TestPage.class ).setTopLevel( true );
    PageConfiguration pageConfiguration2 = new PageConfiguration( "foo2", TestPage.class );
    configuration.addPageConfiguration( pageConfiguration );
    configuration.addPageConfiguration( pageConfiguration2 );
    ActionConfiguration actionConfiguration = new ActionConfiguration( "bar", TestAction.class );
    pageConfiguration2.addActionConfiguration( actionConfiguration );
    UIDescriptor uiDescriptor = configuration.getAdapter( UIDescriptor.class );
    Controller controller = new Controller( new RemoteUI( shell ), uiDescriptor );
    UIImpl ui = new UIImpl( shell.getDisplay(), controller, configuration );
    controller.setUI( ui );
    controller.createRootPages( ui );
    controller.createGlobalActions( ui );
View Full Code Here


    assertSame( actionConfiguration, actualConfiguration );
  }

  @Test
  public void testGetActionConfigurationIsNullForNonExistentAction() {
    UIConfiguration configuration = new UIConfiguration();
    PageConfiguration pageConfiguration = new PageConfiguration( "foo", TestPage.class ).setTopLevel( true );
    configuration.addPageConfiguration( pageConfiguration );
    UIDescriptor uiDescriptor = configuration.getAdapter( UIDescriptor.class );
    Controller controller = new Controller( new RemoteUI( shell ), uiDescriptor );
    UIImpl ui = new UIImpl( shell.getDisplay(), controller, configuration );
    controller.setUI( ui );
    controller.createRootPages( ui );
    controller.createGlobalActions( ui );
View Full Code Here

    assertNull( actualConfiguration );
  }

  @Test
  public void testGetPageConfigurationIsNullForNonExistentPage() {
    UIConfiguration configuration = new UIConfiguration();
    PageConfiguration pageConfiguration = new PageConfiguration( "foo", TestPage.class ).setTopLevel( true );
    configuration.addPageConfiguration( pageConfiguration );
    UIDescriptor uiDescriptor = configuration.getAdapter( UIDescriptor.class );
    Controller controller = new Controller( new RemoteUI( shell ), uiDescriptor );
    UIImpl ui = new UIImpl( shell.getDisplay(), controller, configuration );
    controller.setUI( ui );
    controller.createRootPages( ui );
    controller.createGlobalActions( ui );
View Full Code Here

    RemoteUI remoteUI = mock( RemoteUI.class );
    when( remoteUI.getPageParent() ).thenReturn( shell );
    when( remoteUI.getActionsParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.setUI( ui );
    UIConfiguration configuration = mock( UIConfiguration.class );
    when( configuration.getBackground() ).thenReturn( new RGB( 100, 100, 100 ) );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( uiDescriptor );

    controller.update( configuration );

    verify( remoteUI ).setBackground( eq( new Color( ui.getDisplay(), 100, 100, 100 ) ) );
  }
View Full Code Here

    RemoteUI remoteUI = mock( RemoteUI.class );
    when( remoteUI.getPageParent() ).thenReturn( shell );
    when( remoteUI.getActionsParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.setUI( ui );
    UIConfiguration configuration = mock( UIConfiguration.class );
    when( configuration.getForeground() ).thenReturn( new RGB( 100, 100, 100 ) );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( uiDescriptor );

    controller.update( configuration );

    verify( remoteUI ).setForeground( eq( new Color( ui.getDisplay(), 100, 100, 100 ) ) );
  }
View Full Code Here

  }

  @Test
  public void testAttachAddsTransitionListener() {
    Tracking tracking = new Tracking( mock( Tracker.class ) );
    UIConfiguration configuration = mock( UIConfiguration.class );

    tracking.attach( configuration );

    verify( configuration ).addTransitionListener( any( TransitionListener.class ) );
  }
View Full Code Here

  }

  @Test
  public void testAttachAddsActionListener() {
    Tracking tracking = new Tracking( mock( Tracker.class ) );
    UIConfiguration configuration = mock( UIConfiguration.class );

    tracking.attach( configuration );

    verify( configuration ).addActionListener( any( SearchActionListener.class ) );
  }
View Full Code Here

  @Test
  public void testDispatchesPageTransition() {
    EventDispatcher dispatcher = mock( EventDispatcher.class );
    Tracking tracking = new Tracking( dispatcher, new ArrayList<Tracker>() );
    PageConfiguration pageConfiguration = mock( PageConfiguration.class );
    UIConfiguration configuration = mock( UIConfiguration.class );

    tracking.attach( configuration );
    fakePageTransition( configuration, pageConfiguration );

    ArgumentCaptor<DispatchTask> captor = ArgumentCaptor.forClass( DispatchTask.class );
View Full Code Here

  public void testDispatchesActionExecution() {
    EventDispatcher dispatcher = mock( EventDispatcher.class );
    Tracking tracking = new Tracking( dispatcher, new ArrayList<Tracker>() );
    ActionConfiguration actionConfiguration = mock( ActionConfiguration.class );
    when( actionConfiguration.getId() ).thenReturn( "bar" );
    UIConfiguration configuration = mock( UIConfiguration.class );

    tracking.attach( configuration );
    fakeActionExecution( configuration, actionConfiguration );

    ArgumentCaptor<DispatchTask> captor = ArgumentCaptor.forClass( DispatchTask.class );
View Full Code Here

  public void testDispatchesSearch() {
    EventDispatcher dispatcher = mock( EventDispatcher.class );
    Tracking tracking = new Tracking( dispatcher, new ArrayList<Tracker>() );
    ActionConfiguration actionConfiguration = mock( ActionConfiguration.class );
    when( actionConfiguration.getId() ).thenReturn( "bar" );
    UIConfiguration configuration = mock( UIConfiguration.class );

    tracking.attach( configuration );
    fakeSearch( configuration, actionConfiguration, "foo" );

    ArgumentCaptor<DispatchTask> captor = ArgumentCaptor.forClass( DispatchTask.class );
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.ui.UIConfiguration

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.