@Override @SuppressWarnings( "unchecked" ) public <T> T getAdapter( Class<T> adapter ) { if( adapter == WidgetLCA.class ) { return ( T )CLabelLCA.INSTANCE; } return super.getAdapter( adapter ); }
@Override @SuppressWarnings("unchecked") public <T> T getAdapter( Class<T> adapter ) { if( adapter == IFileUploadAdapter.class ) { return ( T )fileUploadAdapter; } if( adapter == WidgetLCA.class ) { return ( T )FileUploadLCA.INSTANCE; } return super.getAdapter( adapter ); }
@SuppressWarnings({ "unchecked", "deprecation" }) @Override public <T> T getAdapter( Class<T> adapter ) { T result = super.getAdapter( adapter ); if( adapter == DrawingsCache.class ) { result = ( T )cache; } else if( adapter == WidgetLifeCycleAdapter.class || adapter == org.eclipse.rap.rwt.lifecycle.WidgetLifeCycleAdapter.class ) { return ( T )CLIENT_CANVAS_LCA; } else if( adapter == List.class ) { return ( T )drawListeners; } return result; }
@Override @SuppressWarnings("unchecked") public <T> T getAdapter( Class<T> adapter ) { if( adapter == MenuHolder.class ) { if( menuHolder == null ) { menuHolder = new MenuHolder(); } return ( T )menuHolder; } return super.getAdapter( adapter ); }
@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 ); } } } );
private static void writeGCOperations( final Canvas canvas ) throws IOException { IGCAdapter adapter = ( IGCAdapter )canvas.getAdapter( IGCAdapter.class ); GCOperation[] operations = adapter.getTrimmedGCOperations(); if( operations.length > 0 || adapter.getForceRedraw() ) { GCOperationWriter operationWriter = new GCOperationWriter( canvas ); operationWriter.initialize(); for( int i = 0; i < operations.length; i++ ) { operationWriter.write( operations[ i ] ); } } adapter.clearGCOperations(); adapter.setForceRedraw( false ); } }
private static void writeGCOperations( Canvas canvas ) { GCAdapter adapter = canvas.getAdapter( GCAdapter.class ); GCOperation[] operations = adapter.getTrimmedGCOperations(); if( operations.length > 0 || adapter.getForceRedraw() ) { GCOperationWriter operationWriter = new GCOperationWriter( canvas ); operationWriter.initialize(); for( int i = 0; i < operations.length; i++ ) { operationWriter.write( operations[ i ] ); } operationWriter.render(); } adapter.clearGCOperations(); adapter.setForceRedraw( false ); }