Package org.eclipse.rap.json

Examples of org.eclipse.rap.json.JsonValue


    super.addPaintListener( listener );
    super.addPaintListener( paintListener );
  }

  private void processClientDrawings( GC gc ) {
    JsonValue drawings = readEventPropertyValue( WidgetUtil.getId( this ), DRAWING_EVENT, DRAWINGS_PROPERTY );
    if( drawings != null ) {
      cacheDrawings( drawings.asString() );
      cache.clearRemoved();
      fireDrawEvent();
    }
    dispatchDrawings( gc );
  }
View Full Code Here


   * </p>
   *
   * @since 1.1
   */
  public JsonValue getProperty( String name ) {
    JsonValue result = null;
    if( properties != null ) {
      result = properties.get( name );
    }
    return result;
  }
View Full Code Here

   * @throws IllegalArgumentException when the shortcut is <code>null</code> or empty.
   */
  public String get( String shortcut ) {
    whenNull( shortcut ).throwIllegalArgument( "shortcut must not be null" );
    when( shortcut.isEmpty() ).throwIllegalArgument( "shortcut must not be empty" );
    JsonValue jsonValue = data.get( shortcut );
    if( jsonValue != null ) {
      return jsonValue.asString();
    }
    return null;
  }
View Full Code Here

    ProcessActionRunner.add( new Runnable() {

      @Override
      public void run() {
        DrawingsCache cache = control.getAdapter( DrawingsCache.class );
        JsonValue drawings = properties.get( DRAWINGS_PROPERTY );
        if( drawings != null ) {
          cache.cache( drawings.asString() );
          cache.clearRemoved();
          fireDrawEvent( ( ClientCanvas )control );
        }
      }
    } );
View Full Code Here

    String message = getAsString( properties, PROPERTY_MESSAGE );
    return new PrintError( printer, jobName, message );
  }

  private String getAsString( JsonObject properties, String property ) {
    JsonValue jsonValue = properties.get( property );
    if ( jsonValue != null ) {
      return jsonValue.asString();
    }
    return null;
  }
View Full Code Here

                            getPropertyAsDouble( properties, PROPERTY_SPEED ) );
  }

  private double getPropertyAsDouble( JsonObject properties, String propertyName ) {
    double result = -1;
    JsonValue value = properties.get( propertyName );
    if( value.isNumber() ) {
      result = value.asDouble();
    }
    return result;
  }
View Full Code Here

  }

  public String get( String shortcut ) {
    whenNull( shortcut ).throwIllegalArgument( "shortcut must not be null" );
    when( shortcut.isEmpty() ).throwIllegalArgument( "shortcut must not be empty" );
    JsonValue jsonValue = data.get( shortcut );
    if( jsonValue != null ) {
      return jsonValue.asString();
    }
    return null;
  }
View Full Code Here

TOP

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

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.