Package com.eclipsesource.tabris.widgets

Examples of com.eclipsesource.tabris.widgets.Video


  @Before
  public void setUp() {
    Display display = new Display();
    parent = new Shell( display );
    video = new Video( "http://test.com", parent );
    playbackListener = mock( PlaybackListener.class );
    presentationListener = mock( PresentationListener.class );
    new Button( parent, SWT.PUSH );
    lifeCycleAdapter = ( AbstractWidgetLCA )video.getAdapter( WidgetLifeCycleAdapter.class );
    environment.newRequest();
View Full Code Here


  private void readPlaybackMode( Widget widget ) {
    if( wasEventSent( getId( widget ), PLAYBACK_EVENT ) ) {
      String playbackMode = readEventPropertyValueAsString( getId( widget ), PLAYBACK_EVENT, PROPERTY_MODE );
      PlaybackMode newMode = PlaybackMode.valueOf( playbackMode.toUpperCase() );
      Video video = ( Video )widget;
      video.getAdapter( PlaybackAdapter.class ).setPlaybackMode( newMode );
      notifyListenersAboutPlaybackModeChange( newMode, video );
    }
  }
View Full Code Here

  private void readPresentationMode( Widget widget ) {
    if( wasEventSent( getId( widget ), PRESENTATION_EVENT ) ) {
      String presentationMode = readEventPropertyValueAsString( getId( widget ), PRESENTATION_EVENT, PROPERTY_MODE );
      PresentationMode newMode = PresentationMode.valueOf( presentationMode.toUpperCase() );
      Video video = ( Video )widget;
      video.getAdapter( PlaybackAdapter.class ).getOptions().put( PlaybackOptions.PRESENTATION_MODE, newMode );
      notifyListenersAboutPresentationModeChange( newMode, video );
    }
  }
View Full Code Here

  }

  @Override
  public void preserveValues( Widget widget ) {
    ControlLCAUtil.preserveValues( ( Control )widget );
    Video video = ( Video ) widget;
    PlaybackAdapter adapter = video.getAdapter( PlaybackAdapter.class );
    Map<PlaybackOptions, Object> options = adapter.getOptions();
    for( Entry<PlaybackOptions, Object> entry : options.entrySet() ) {
      preserveProperty( video, keyForEnum( entry.getKey() ), jsonizeValue( entry ) );
    }
    preserveListener( video, VIDEO_LISTENER_PROPERTY, adapter.hasVideoListener() );
View Full Code Here

  }

  @Override
  public void renderChanges( Widget widget ) throws IOException {
    ControlLCAUtil.renderChanges( ( Control )widget );
    Video video = ( Video ) widget;
    PlaybackAdapter adapter = video.getAdapter( PlaybackAdapter.class );
    Map<PlaybackOptions, Object> options = adapter.getOptions();
    for( Entry<PlaybackOptions, Object> entry : options.entrySet() ) {
      renderProperty( widget, keyForEnum( entry.getKey() ), jsonizeValue( entry ), null );
    }
    renderListener( video, VIDEO_LISTENER_PROPERTY, adapter.hasVideoListener(), false );
View Full Code Here

    renderListener( video, VIDEO_LISTENER_PROPERTY, adapter.hasVideoListener(), false );
  }

  @Override
  public void renderInitialization( Widget widget ) throws IOException {
    Video video = ( Video ) widget;
    IClientObject clientObject = ClientObjectFactory.getClientObject( video );
    clientObject.create( TYPE );
    clientObject.set( PARENT, WidgetUtil.getId( video.getParent() ) );
    clientObject.set( VIDEO_URL, video.getURL().toString() );
  }
View Full Code Here

  private void createContent( Composite parent ) {
    Composite content = new Composite( parent, SWT.NONE );
    GridDataFactory.fillDefaults().grab( true, true ).align( SWT.FILL, SWT.FILL ).applyTo( content );
    GridLayoutFactory.fillDefaults().applyTo( content );
   
    Video video = new Video( videoUrl, content );
    GridDataFactory.fillDefaults().grab( true, true ).applyTo( video );
   
    Composite controls = new Composite( content, SWT.NONE );
    GridDataFactory.fillDefaults().grab( true, false ).applyTo( controls );
    hookControlsAndVideo( video, controls );
View Full Code Here

  }

  @Override
  public void preserveValues( Widget widget ) {
    ControlLCAUtil.preserveValues( ( Control )widget );
    Video video = ( Video ) widget;
    PlaybackAdapter adapter = video.getAdapter( PlaybackAdapter.class );
    Map<PlaybackOptions, Object> options = adapter.getOptions();
    for( Entry<PlaybackOptions, Object> entry : options.entrySet() ) {
      preserveProperty( video, keyForEnum( entry.getKey() ), jsonizeValue( entry ) );
    }
    preserveListener( video, EVENT_PLAYBACK, adapter.hasPlaybackListener() );
View Full Code Here

  }

  @Override
  public void renderChanges( Widget widget ) throws IOException {
    ControlLCAUtil.renderChanges( ( Control )widget );
    Video video = ( Video ) widget;
    PlaybackAdapter adapter = video.getAdapter( PlaybackAdapter.class );
    Map<PlaybackOptions, Object> options = adapter.getOptions();
    for( Entry<PlaybackOptions, Object> entry : options.entrySet() ) {
      renderProperty( widget, keyForEnum( entry.getKey() ), jsonizeValue( entry ), null );
    }
    renderListener( video, EVENT_PLAYBACK, adapter.hasPlaybackListener(), false );
View Full Code Here

    renderListener( video, EVENT_PRESENTATION, adapter.hasPresentationListener(), false );
  }

  @Override
  public void renderInitialization( Widget widget ) throws IOException {
    Video video = ( Video )widget;
    RemoteObject remoteObject = RemoteObjectFactory.createRemoteObject( video, TYPE_VIDEO );
    remoteObject.setHandler( new VideoOperationHandler( video ) );
    remoteObject.set( PROPERTY_PARENT, WidgetUtil.getId( video.getParent() ) );
    remoteObject.set( PROPERTY_URL, video.getURL().toString() );
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.widgets.Video

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.