Package com.eclipsesource.tabris.ui

Examples of com.eclipsesource.tabris.ui.Action


    assertArrayEquals( UITestUtil.getImageBytes(), descriptor.getImage() );
  }

  @Test
  public void testSetImageReturnsDescriptor() {
    Action action = mock( Action.class );
    InputStream image = ActionDescriptorTest.class.getResourceAsStream( "testImage.png" );
    ActionDescriptor descriptor = new ActionDescriptor( "foo", action );

    ActionDescriptor actualDescriptor = descriptor.setImage( ImageUtil.getBytes( image ) );
View Full Code Here


    assertSame( descriptor, actualDescriptor );
  }

  @Test
  public void testGetPlacementPriority() {
    Action action = mock( Action.class );
    ActionDescriptor descriptor = new ActionDescriptor( "foo", action );

    descriptor.setPlacementPrority( PlacementPriority.HIGH );

    assertSame( PlacementPriority.HIGH, descriptor.getPlacementPriority() );
View Full Code Here

    assertSame( PlacementPriority.HIGH, descriptor.getPlacementPriority() );
  }

  @Test
  public void testSetPlacementPriorityReturnsDescriptor() {
    Action action = mock( Action.class );
    ActionDescriptor descriptor = new ActionDescriptor( "foo", action );

    ActionDescriptor actualDescriptor = descriptor.setPlacementPrority( PlacementPriority.HIGH );

    assertSame( descriptor, actualDescriptor );
View Full Code Here

  }

  @Test
  public void testCallsExecuteOnEvent() {
    new RemoteAction( ui, uiRenderer, actionDescriptor );
    Action action = mock( Action.class );
    mockUI( mock( ActionListener.class ) );
    when( actionDescriptor.getAction() ).thenReturn( action );

    environment.dispatchNotify( "Selection", new JsonObject() );
View Full Code Here

  @Test
  public void testNotifiesListenerOnExecuteEvent() {
    ActionListener listener = mock( ActionListener.class );
    mockUI( listener );
    new RemoteAction( ui, uiRenderer, actionDescriptor );
    Action action = mock( Action.class );
    when( actionDescriptor.getAction() ).thenReturn( action );

    environment.dispatchNotify( "Selection", new JsonObject() );

    verify( listener ).executed( ui, action );
View Full Code Here

  @Test
  public void testFindsAction() {
    Controller controller = mock( Controller.class );
    RemoteAction remoteAction = mock( RemoteAction.class );
    ActionDescriptor descriptor = mock( ActionDescriptor.class );
    Action action = mock( Action.class );
    when( descriptor.getAction() ).thenReturn( action );
    when( remoteAction.getDescriptor() ).thenReturn( descriptor );
    when( controller.findRemoteAction( "foo" ) ).thenReturn( remoteAction );
    ActionOperatorImpl actionOperator = new ActionOperatorImpl( controller );

    Action actualAction = actionOperator.getAction( "foo" );

    assertSame( action, actualAction );
  }
View Full Code Here

  public InternalActionConfiguration( String actionId, Class<? extends Action> actionType ) {
    super( actionId, actionType );
  }

  public ActionDescriptor createDescriptor() {
    Action action = InstanceCreator.createInstance( actionType );
    return new ActionDescriptor( actionId, action, title, image, visible, enabled, prominence );
  }
View Full Code Here

  private ServerPushSession pushSession;

  public RemoteSearchAction( UI ui, RemoteUI uiRenderer, ActionDescriptor descriptor ) {
    super( ui, uiRenderer, descriptor );
    Action action = descriptor.getAction();
    ( ( Adaptable )action ).getAdapter( PropertyChangeNotifier.class ).setPropertyChangeHandler( this );
  }
View Full Code Here

  private final Listener textModifyListener;

  public WebSearchAction( UI ui, WebUI uiRenderer, ActionDescriptor descriptor ) {
    super( ui, uiRenderer, descriptor );
    textModifyListener = new TextModifyListener( this );
    Action action = descriptor.getAction();
    ( ( Adaptable )action ).getAdapter( PropertyChangeNotifier.class ).setPropertyChangeHandler( this );
  }
View Full Code Here

  }

  private ActionConfiguration findPageActionConfiguration( Action action ) {
    List<ActionRenderer> pageActionRenderers = currentFlow.getCurrentRenderer().getActionRenderers();
    for( ActionRenderer renderer : pageActionRenderers ) {
      Action pageAction = renderer.getDescriptor().getAction();
      if( pageAction == action ) {
        String actionId = renderer.getDescriptor().getId();
        return ui.getPageConfiguration( getCurrentPage() ).getActionConfiguration( actionId );
      }
    }
View Full Code Here

TOP

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

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.