@Test public void addAll() { List<StyleKey> keys = StyleKey.getDefinedStyleKeysList(); ElementStyleSheet sheet = new ElementStyleSheet(); setEverySecondKey( sheet, keys ); ElementStyleSheet another = new ElementStyleSheet(); another.addAll( sheet ); assertEverySecondKey( another, keys ); for ( int i = 0; i < keys.size(); i += 2 ) { StyleKey key = keys.get( i ); assertTrue( "addAll() adds properties as local", another.isLocalKey( key ) ); } }
public void addAll( final ElementStyleSheet sourceStyleSheet ) { if ( sourceStyleSheet.source == null || sourceStyleSheet.properties == null ) { return; } ensurePropertiesReady(); for ( int i = 0, len = sourceStyleSheet.properties.length; i < len; i++ ) { final byte sourceFlag = sourceStyleSheet.getFlag( i ); if ( sourceFlag == SOURCE_DIRECT ) { properties[ i ] = sourceStyleSheet.properties[ i ]; setFlag( i, sourceFlag ); } } }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public void addAll( final ElementStyleSheet sourceStyleSheet ) { if ( sourceStyleSheet.source == null || sourceStyleSheet.properties == null ) { return; } ensurePropertiesReady(); for ( int i = 0, len = sourceStyleSheet.properties.length; i < len; i++ ) { final byte sourceFlag = sourceStyleSheet.getFlag( i ); if ( sourceFlag == SOURCE_DIRECT ) { properties[ i ] = sourceStyleSheet.properties[ i ]; setFlag( i, sourceFlag ); } } } }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public void addAll( final ElementStyleSheet sourceStyleSheet ) { if ( sourceStyleSheet.source == null || sourceStyleSheet.properties == null ) { return; } ensurePropertiesReady(); for ( int i = 0, len = sourceStyleSheet.properties.length; i < len; i++ ) { final byte sourceFlag = sourceStyleSheet.getFlag( i ); if ( sourceFlag == SOURCE_DIRECT ) { properties[ i ] = sourceStyleSheet.properties[ i ]; setFlag( i, sourceFlag ); } } } ElementStyleSheet(); }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public void addAll( final ElementStyleSheet sourceStyleSheet ) { if ( sourceStyleSheet.source == null || sourceStyleSheet.properties == null ) { return; } ensurePropertiesReady(); for ( int i = 0, len = sourceStyleSheet.properties.length; i < len; i++ ) { final byte sourceFlag = sourceStyleSheet.getFlag( i ); if ( sourceFlag == SOURCE_DIRECT ) { properties[ i ] = sourceStyleSheet.properties[ i ]; setFlag( i, sourceFlag ); } } } ElementStyleSheet(); long getChangeTracker(); boolean isLocalKey( final StyleKey key ); final Object[] toArray(); Object getStyleProperty( final StyleKey key, final Object defaultValue ); void setBooleanStyleProperty( final StyleKey key, final boolean value ); void setStyleProperty( final StyleKey key, final Object value ); ElementStyleSheet clone(); ElementStyleSheet derive( final boolean preserveId ); StyleKey[] getDefinedPropertyNamesArray(); void addListener( final StyleChangeListener l ); void removeListener( final StyleChangeListener l ); StyleKey[] getPropertyKeys(); List<StyleKey> getPropertyKeyList(); void addAll( final ElementStyleSheet sourceStyleSheet ); void addInherited( final ElementStyleSheet sourceStyleSheet ); void addInherited( final SimpleStyleSheet sourceStyleSheet ); void addDefault( final ElementStyleSheet sourceStyleSheet ); void clear(); long getModificationCount(); long getChangeTrackerHash(); void copyFrom( final ElementStyleSheet style ); }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public void addAll( final ElementStyleSheet sourceStyleSheet ) { if ( sourceStyleSheet.source == null || sourceStyleSheet.properties == null ) { return; } ensurePropertiesReady(); for ( int i = 0, len = sourceStyleSheet.properties.length; i < len; i++ ) { final byte sourceFlag = sourceStyleSheet.getFlag( i ); if ( sourceFlag == SOURCE_DIRECT ) { properties[ i ] = sourceStyleSheet.properties[ i ]; setFlag( i, sourceFlag ); } } } ElementStyleSheet(); long getChangeTracker(); boolean isLocalKey( final StyleKey key ); final Object[] toArray(); Object getStyleProperty( final StyleKey key, final Object defaultValue ); void setBooleanStyleProperty( final StyleKey key, final boolean value ); void setStyleProperty( final StyleKey key, final Object value ); ElementStyleSheet clone(); ElementStyleSheet derive( final boolean preserveId ); StyleKey[] getDefinedPropertyNamesArray(); void addListener( final StyleChangeListener l ); void removeListener( final StyleChangeListener l ); StyleKey[] getPropertyKeys(); List<StyleKey> getPropertyKeyList(); void addAll( final ElementStyleSheet sourceStyleSheet ); void addInherited( final ElementStyleSheet sourceStyleSheet ); void addInherited( final SimpleStyleSheet sourceStyleSheet ); void addDefault( final ElementStyleSheet sourceStyleSheet ); void clear(); long getModificationCount(); long getChangeTrackerHash(); void copyFrom( final ElementStyleSheet style );  }