@Test public void testInitializeNullValue() throws Exception { doReturn( null ).when( updateContext ).getParameterValue( ENTRY_NAME ); comp.initialize(); JTextArea textArea = findTextArea( comp ); assertThat( textArea.getText(), is( equalTo( StringUtils.EMPTY ) ) ); assertThat( comp.getBackground(), is( not( equalTo( ParameterReportControllerPane.ERROR_COLOR ) ) ) ); }
public void initialize() { handler.setAdjustingToExternalInput( true ); try { final Object value = updateContext.getParameterValue( parameterName ); if ( value != null ) { try { if ( format != null ) { textArea.setText( format.format( value ) ); } else { textArea.setText( ConverterRegistry.toAttributeValue( value ) ); } } catch ( Exception e ) { textArea.setText( value.toString() ); setBackground( ParameterReportControllerPane.ERROR_COLOR ); } } else { textArea.setText( null ); } } finally { handler.setAdjustingToExternalInput( false ); } }
TextAreaParameterComponent extends JScrollPane implements ParameterComponent { public void initialize() { handler.setAdjustingToExternalInput( true ); try { final Object value = updateContext.getParameterValue( parameterName ); if ( value != null ) { try { if ( format != null ) { textArea.setText( format.format( value ) ); } else { textArea.setText( ConverterRegistry.toAttributeValue( value ) ); } } catch ( Exception e ) { textArea.setText( value.toString() ); setBackground( ParameterReportControllerPane.ERROR_COLOR ); } } else { textArea.setText( null ); } } finally { handler.setAdjustingToExternalInput( false ); } } }
TextAreaParameterComponent extends JScrollPane implements ParameterComponent { public void initialize() { handler.setAdjustingToExternalInput( true ); try { final Object value = updateContext.getParameterValue( parameterName ); if ( value != null ) { try { if ( format != null ) { textArea.setText( format.format( value ) ); } else { textArea.setText( ConverterRegistry.toAttributeValue( value ) ); } } catch ( Exception e ) { textArea.setText( value.toString() ); setBackground( ParameterReportControllerPane.ERROR_COLOR ); } } else { textArea.setText( null ); } } finally { handler.setAdjustingToExternalInput( false ); } } TextAreaParameterComponent( final ParameterDefinitionEntry entry, final ParameterContext parameterContext,
      final ParameterUpdateContext updateContext ); }
TextAreaParameterComponent extends JScrollPane implements ParameterComponent { public void initialize() { handler.setAdjustingToExternalInput( true ); try { final Object value = updateContext.getParameterValue( parameterName ); if ( value != null ) { try { if ( format != null ) { textArea.setText( format.format( value ) ); } else { textArea.setText( ConverterRegistry.toAttributeValue( value ) ); } } catch ( Exception e ) { textArea.setText( value.toString() ); setBackground( ParameterReportControllerPane.ERROR_COLOR ); } } else { textArea.setText( null ); } } finally { handler.setAdjustingToExternalInput( false ); } } TextAreaParameterComponent( final ParameterDefinitionEntry entry, final ParameterContext parameterContext,
      final ParameterUpdateContext updateContext ); JComponent getUIComponent(); void initialize(); }
TextAreaParameterComponent extends JScrollPane implements ParameterComponent { public void initialize() { handler.setAdjustingToExternalInput( true ); try { final Object value = updateContext.getParameterValue( parameterName ); if ( value != null ) { try { if ( format != null ) { textArea.setText( format.format( value ) ); } else { textArea.setText( ConverterRegistry.toAttributeValue( value ) ); } } catch ( Exception e ) { textArea.setText( value.toString() ); setBackground( ParameterReportControllerPane.ERROR_COLOR ); } } else { textArea.setText( null ); } } finally { handler.setAdjustingToExternalInput( false ); } } TextAreaParameterComponent( final ParameterDefinitionEntry entry, final ParameterContext parameterContext,
      final ParameterUpdateContext updateContext ); JComponent getUIComponent(); void initialize();  }