Package com.eclipsesource.tabris.ui.action

Examples of com.eclipsesource.tabris.ui.action.Proposal


  @Test
  @SuppressWarnings("unchecked")
  public void testSetProposals() {
    List<Proposal> proposals = new ArrayList<Proposal>();
    proposals.add( new Proposal( "foo" ) );
    proposals.add( new Proposal( "bar" ) );

    proposalHandler.setProposals( proposals );

    ArgumentCaptor<List> captor = ArgumentCaptor.forClass( List.class );
    verify( actionRenderer ).showProposals( captor.capture() );
View Full Code Here


  public void testSendsProposals() {
    SearchAction action = spy( new TestSearchAction() );
    when( actionDescriptor.getAction() ).thenReturn( action );
    new RemoteSearchAction( ui, uiRenderer, actionDescriptor );
    List<Proposal> proposals = new ArrayList<Proposal>();
    proposals.add( new Proposal( "foo" ) );
    proposals.add( new Proposal( "bar" ) );
    JsonObject properties = new JsonObject();
    properties.add( "query", "bar" );
    environment.dispatchNotify( "Modify", properties );
    ArgumentCaptor<ProposalHandler> captor = ArgumentCaptor.forClass( ProposalHandler.class );
    verify( action ).modified( eq( "bar" ), captor.capture() );
View Full Code Here

  @Test
  public void testSetsProposalsAsProperty() {
    RemoteObject remoteObject = mock( RemoteObject.class );
    ProposalHandlerImpl proposalHandler = new ProposalHandlerImpl( remoteObject );
    List<Proposal> proposals = new ArrayList<Proposal>();
    proposals.add( new Proposal( "foo" ) );
    proposals.add( new Proposal( "bar" ) );

    proposalHandler.setProposals( proposals );

    JsonArray jsonArray = new JsonArray();
    jsonArray.add( "foo" );
View Full Code Here

  public static List<Proposal> findBookTitles( Display display, final String query ) {
    List<Book> books = BookProvider.getBooks( display );
    final List<Proposal> matches = new ArrayList<Proposal>();
    for( Book book : books ) {
      if( contains( book.getTitle(), query ) ) {
        matches.add( new Proposal( book.getTitle() ) );
      }
    }
    return matches;
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.ui.action.Proposal

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.