Package com.eclipsesource.tabris.internal.ui.rendering

Examples of com.eclipsesource.tabris.internal.ui.rendering.ActionRenderer


    verify( remoteObject ).destroy();
  }

  @Test
  public void testCreatesGlobalActionsWithUI() {
    ActionRenderer renderer = mock( ActionRenderer.class );
    RemoteRendererFactory factory = mock( RemoteRendererFactory.class );
    when( factory.createActionRenderer( any( UI.class ), any( UIRenderer.class ), any( ActionDescriptor.class ) ) ).thenReturn( renderer );
    when( uiDescriptor.getRendererFactory() ).thenReturn( factory );
    ActionDescriptor descriptor = mock( ActionDescriptor.class );
    when( descriptor.getTitle() ).thenReturn( "foo" );
View Full Code Here


  @Test
  public void testCreatesRegularRemoteAction() {
    ActionDescriptor descriptor = mock( ActionDescriptor.class );
    when( descriptor.getAction() ).thenReturn( mock( Action.class ) );

    ActionRenderer remoteAction = rendererFactory.createActionRenderer( ui, uiRenderer, descriptor );

    assertFalse( remoteAction instanceof RemoteSearchAction );
  }
View Full Code Here

  @Test
  public void testCreatesSearchRemoteAction() {
    ActionDescriptor descriptor = mock( ActionDescriptor.class );
    when( descriptor.getAction() ).thenReturn( new TestSearchAction() );

    ActionRenderer remoteAction = rendererFactory.createActionRenderer( ui, uiRenderer, descriptor );

    assertTrue( remoteAction instanceof RemoteSearchAction );
  }
View Full Code Here

  @Test
  public void testCreateActionRenderer_regular() {
    ActionDescriptor descriptor = mock( ActionDescriptor.class );
    when( descriptor.getAction() ).thenReturn( mock( Action.class ) );

    ActionRenderer renderer = rendererFactory.createActionRenderer( ui, uiRenderer, descriptor );

    assertFalse( renderer instanceof WebSearchAction );
  }
View Full Code Here

  @Test
  public void testCreateActionRenderer_search() {
    ActionDescriptor descriptor = mock( ActionDescriptor.class );
    when( descriptor.getAction() ).thenReturn( new TestSearchAction() );

    ActionRenderer renderer = rendererFactory.createActionRenderer( ui, uiRenderer, descriptor );

    assertTrue( renderer instanceof WebSearchAction );
  }
View Full Code Here

  }

  @Test
  public void testGetActionRenderers() {
    RemotePage page = new RemotePage( ui, uiRenderer, descriptor, mock( PageData.class ) );
    ActionRenderer renderer = mock( ActionRenderer.class );
    RemoteRendererFactory factory = mock( RemoteRendererFactory.class );
    when( factory.createActionRenderer( any( UI.class ), any( UIRenderer.class ), any( ActionDescriptor.class ) ) )
    .thenReturn( renderer );

    page.createActions( factory, shell );
View Full Code Here

    }
  }

  private void createGlobalAction( UIImpl ui, ActionDescriptor actionDescriptor ) {
    RendererFactory rendererFactory = uiDescriptor.getRendererFactory();
    ActionRenderer renderer = rendererFactory.createActionRenderer( ui, uiRenderer, actionDescriptor );
    renderer.createUi( actionsParent );
    globalActionRenderers.add( renderer );
  }
View Full Code Here

    }
    return pages;
  }

  public void setActionEnabled( String id, boolean enabled ) {
    ActionRenderer action = findRemoteAction( id );
    action.setEnabled( enabled );
  }
View Full Code Here

    ActionRenderer action = findRemoteAction( id );
    action.setEnabled( enabled );
  }

  public void setActionVisible( String id, boolean visible ) {
    ActionRenderer action = findRemoteAction( id );
    action.setVisible( visible );
  }
View Full Code Here

    ActionRenderer action = findRemoteAction( id );
    action.setVisible( visible );
  }

  ActionRenderer findRemoteAction( String id ) {
    ActionRenderer result = findActionInGlobalActions( id );
    if( result == null ) {
      result = findActionInPageActions( id );
    }
    whenNull( result ).throwIllegalState( "Action with id " + id + " does not exist." );
    return result;
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.internal.ui.rendering.ActionRenderer

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.