Package org.eclipse.rap.json

Examples of org.eclipse.rap.json.JsonArray


  public void testSendsBackground() {
    RemoteUI remoteUI = createRemoteUI( mock( UI.class ) );

    remoteUI.setBackground( new Color( shell.getDisplay(), 100, 120, 150 ) );

    verify( environment.getRemoteObject() ).set( "background", new JsonArray().add( 100 ).add( 120 ).add( 150 ) );
  }
View Full Code Here


    proposals.add( new Proposal( "foo" ) );
    proposals.add( new Proposal( "bar" ) );

    proposalHandler.setProposals( proposals );

    JsonArray jsonArray = new JsonArray();
    jsonArray.add( "foo" );
    jsonArray.add( "bar" );
    verify( remoteObject ).set( "proposals", jsonArray );
  }
View Full Code Here

    RemoteObject remoteObject = mock( RemoteObject.class );
    ProposalHandlerImpl proposalHandler = new ProposalHandlerImpl( remoteObject );

    proposalHandler.setProposals( new ArrayList<Proposal>() );

    verify( remoteObject ).set( "proposals", new JsonArray() );
  }
View Full Code Here

    remotePage.createControl( shell );

    verify( remoteObject ).set( "parent", "foo1" );
    verify( remoteObject ).set( "title", "bar" );
    verify( remoteObject ).set( "control", WidgetUtil.getId( remotePage.getControl() ) );
    verify( remoteObject ).set( "style", new JsonArray().add( "DEFAULT" ) );
    verify( remoteObject ).set( "topLevel", true );
    ArgumentCaptor<JsonArray> captor = ArgumentCaptor.forClass( JsonArray.class );
    verify( remoteObject ).set( eq( "image" ), captor.capture() );
    assertTrue( captor.getValue().get( 0 ).isString() );
    assertEquals( 49, captor.getValue().get( 1 ).asInt() );
View Full Code Here

    localDescriptor.setPageStyle( PageStyle.FULLSCREEN );

    RemotePage remotePage = new RemotePage( ui, uiRenderer, localDescriptor, mock( PageData.class ) );
    remotePage.createControl( shell );

    verify( remoteObject ).set( "style", new JsonArray().add( "FULLSCREEN" ) );
  }
View Full Code Here

    JsonObject properties = getOperationProperties( WidgetUtil.getId( composite ), CALL, "addListener" );
    assertNotNull( properties );
  }

  private Rectangle toRectangle( Object property ) {
    JsonArray jsonArray = ( JsonArray )property;
    Rectangle result = new Rectangle( jsonArray.get( 0 ).asInt(),
                                      jsonArray.get( 1 ).asInt(),
                                      jsonArray.get( 2 ).asInt(),
                                      jsonArray.get( 3 ).asInt() );
    return result;
  }
View Full Code Here

public class ClientCanvasTestUtil {

  public static final int LINE_WITH = 3;

  public static String createDrawingsWithoutLineWidth() {
    JsonArray drawings = new JsonArray();
    JsonArray polylineParam = createPathParam();
    drawings.add( polylineParam );
    JsonArray colorParam = createColorParam();
    drawings.add( colorParam );
    JsonArray polylineParam2 = createPathParam();
    drawings.add( polylineParam2 );
    return drawings.toString();
  }
View Full Code Here

    drawings.add( polylineParam2 );
    return drawings.toString();
  }

  public static String createDrawings( int lineWidth ) {
    JsonArray drawings = new JsonArray();
    JsonArray polylineParam = createPathParam();
    drawings.add( polylineParam );
    JsonArray lineWidthParam = createLineWidthParam( lineWidth );
    drawings.add( lineWidthParam );
    JsonArray colorParam = createColorParam();
    drawings.add( colorParam );
    JsonArray polylineParam2 = createPathParam();
    drawings.add( polylineParam2 );
    return drawings.toString();
  }
View Full Code Here

    drawings.add( polylineParam2 );
    return drawings.toString();
  }

  private static JsonArray createPathParam() {
    JsonArray drawingParam1 = new JsonArray();
    drawingParam1.add( Constants.PROPERTY_PATH );
    JsonArray path = createPath();
    drawingParam1.add( path );
    return drawingParam1;
  }
View Full Code Here

    drawingParam1.add( path );
    return drawingParam1;
  }

  private static JsonArray createPath() {
    JsonArray polyline = new JsonArray();
    polyline.add( 0 );
    polyline.add( 1 );
    polyline.add( 5 );
    polyline.add( 5 );
    polyline.add( 6 );
    polyline.add( 6 );
    polyline.add( 7 );
    polyline.add( 7 );
    polyline.add( 8 );
    polyline.add( 8 );
    return polyline;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.rap.json.JsonArray

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.