@Test public void getDefinedPropertyNamesArray_ReturnsNamesOfSetProperties() { List<StyleKey> keys = StyleKey.getDefinedStyleKeysList(); ElementStyleSheet sheet = new ElementStyleSheet(); setEverySecondKey( sheet, keys ); StyleKey[] names = sheet.getDefinedPropertyNamesArray(); assertEquals( keys.size(), names.length ); for ( int i = 0; i < names.length; i++ ) { StyleKey key = keys.get( i ); if ( i % 2 == 0 ) { assertEquals( key, names[ i ] ); } else { assertNull( String.format( "Key[%d]: %s", i, key.name ), names[i] ); } } }
public StyleKey[] getDefinedPropertyNamesArray() { if ( source == null ) { return ElementStyleSheet.EMPTY_KEYS; } final StyleKey[] retval = propertyKeys.toArray( new StyleKey[ propertyKeys.size() ] ); for ( int i = 0, len = retval.length; i < len; i++ ) { if ( getFlag( i ) != SOURCE_DIRECT ) { retval[ i ] = null; } } return retval; }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public StyleKey[] getDefinedPropertyNamesArray() { if ( source == null ) { return ElementStyleSheet.EMPTY_KEYS; } final StyleKey[] retval = propertyKeys.toArray( new StyleKey[ propertyKeys.size() ] ); for ( int i = 0, len = retval.length; i < len; i++ ) { if ( getFlag( i ) != SOURCE_DIRECT ) { retval[ i ] = null; } } return retval; } }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public StyleKey[] getDefinedPropertyNamesArray() { if ( source == null ) { return ElementStyleSheet.EMPTY_KEYS; } final StyleKey[] retval = propertyKeys.toArray( new StyleKey[ propertyKeys.size() ] ); for ( int i = 0, len = retval.length; i < len; i++ ) { if ( getFlag( i ) != SOURCE_DIRECT ) { retval[ i ] = null; } } return retval; } ElementStyleSheet(); }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public StyleKey[] getDefinedPropertyNamesArray() { if ( source == null ) { return ElementStyleSheet.EMPTY_KEYS; } final StyleKey[] retval = propertyKeys.toArray( new StyleKey[ propertyKeys.size() ] ); for ( int i = 0, len = retval.length; i < len; i++ ) { if ( getFlag( i ) != SOURCE_DIRECT ) { retval[ i ] = null; } } return retval; } 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 StyleKey[] getDefinedPropertyNamesArray() { if ( source == null ) { return ElementStyleSheet.EMPTY_KEYS; } final StyleKey[] retval = propertyKeys.toArray( new StyleKey[ propertyKeys.size() ] ); for ( int i = 0, len = retval.length; i < len; i++ ) { if ( getFlag( i ) != SOURCE_DIRECT ) { retval[ i ] = null; } } return retval; } 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 );  }