@Test public void testSetValue() { editor.setValue( "incorrect_value" ); assertThat( editor.getValue(), is( nullValue() ) ); for ( String type : BARCODE_TYPES ) { editor.setValue( type ); assertThat( (String) editor.getValue(), is( equalTo( type ) ) ); editor.setAsText( type ); assertThat( editor.getAsText(), is( equalTo( type ) ) ); } }
public void setValue( final Object value ) { final Object oldValue = this.value; if ( isValidBarcode( value ) ) { this.value = (String) value; } else { this.value = null; } propertyChangeSupport.firePropertyChange( null, oldValue, this.value ); }
BarcodeTypePropertyEditor implements PropertyEditor { public void setValue( final Object value ) { final Object oldValue = this.value; if ( isValidBarcode( value ) ) { this.value = (String) value; } else { this.value = null; } propertyChangeSupport.firePropertyChange( null, oldValue, this.value ); } }
BarcodeTypePropertyEditor implements PropertyEditor { public void setValue( final Object value ) { final Object oldValue = this.value; if ( isValidBarcode( value ) ) { this.value = (String) value; } else { this.value = null; } propertyChangeSupport.firePropertyChange( null, oldValue, this.value ); } BarcodeTypePropertyEditor(); }
BarcodeTypePropertyEditor implements PropertyEditor { public void setValue( final Object value ) { final Object oldValue = this.value; if ( isValidBarcode( value ) ) { this.value = (String) value; } else { this.value = null; } propertyChangeSupport.firePropertyChange( null, oldValue, this.value ); } BarcodeTypePropertyEditor(); void setValue( final Object value ); Object getValue(); boolean isPaintable(); void paintValue( final Graphics gfx, final Rectangle box ); String getJavaInitializationString(); String getAsText(); void setAsText( final String text ); String[] getTags(); Component getCustomEditor(); boolean supportsCustomEditor(); void addPropertyChangeListener( final PropertyChangeListener listener ); void removePropertyChangeListener( final PropertyChangeListener listener ); }
BarcodeTypePropertyEditor implements PropertyEditor { public void setValue( final Object value ) { final Object oldValue = this.value; if ( isValidBarcode( value ) ) { this.value = (String) value; } else { this.value = null; } propertyChangeSupport.firePropertyChange( null, oldValue, this.value ); } BarcodeTypePropertyEditor(); void setValue( final Object value ); Object getValue(); boolean isPaintable(); void paintValue( final Graphics gfx, final Rectangle box ); String getJavaInitializationString(); String getAsText(); void setAsText( final String text ); String[] getTags(); Component getCustomEditor(); boolean supportsCustomEditor(); void addPropertyChangeListener( final PropertyChangeListener listener ); void removePropertyChangeListener( final PropertyChangeListener listener );  }