@Test public void testOnAddProperty() { when ( view.getNewPropertyName() ).thenReturn( "newPropertyName" ); when ( view.getNewPropertyValue() ).thenReturn( "newPropertyValue" ); presenter.onAddProperty(); verify( view , times( 1 ) ).getNewPropertyName(); verify( view , times( 1 ) ).getNewPropertyValue(); assertEquals( 1, presenter.getProperties().size() ); assertEquals( 1, dataProvider.getList().size() ); assertEquals( "newPropertyName", presenter.getProperties().get( 0 ).getName() ); assertEquals( "newPropertyValue", presenter.getProperties().get( 0 ).getValue() ); }
@Override public void onAddProperty() { String propertyName = view.getNewPropertyName(); String propertyValue = view.getNewPropertyValue(); if ( properties == null ) { properties = new ArrayList<PropertyRow>( ); } properties.add( new PropertyRowImpl( propertyName, propertyValue ) ); setProperties( properties ); view.setNewPropertyName( "" ); view.setNewPropertyValue( "" ); }
PersistenceUnitPropertyGrid implements IsWidget,
                   PersistenceUnitPropertyGridView.Presenter { @Override public void onAddProperty() { String propertyName = view.getNewPropertyName(); String propertyValue = view.getNewPropertyValue(); if ( properties == null ) { properties = new ArrayList<PropertyRow>( ); } properties.add( new PropertyRowImpl( propertyName, propertyValue ) ); setProperties( properties ); view.setNewPropertyName( "" ); view.setNewPropertyValue( "" ); } }
PersistenceUnitPropertyGrid implements IsWidget,
                   PersistenceUnitPropertyGridView.Presenter { @Override public void onAddProperty() { String propertyName = view.getNewPropertyName(); String propertyValue = view.getNewPropertyValue(); if ( properties == null ) { properties = new ArrayList<PropertyRow>( ); } properties.add( new PropertyRowImpl( propertyName, propertyValue ) ); setProperties( properties ); view.setNewPropertyName( "" ); view.setNewPropertyValue( "" ); } PersistenceUnitPropertyGrid(); @Inject  PersistenceUnitPropertyGrid( PersistenceUnitPropertyGridView view ); }
PersistenceUnitPropertyGrid implements IsWidget,
                   PersistenceUnitPropertyGridView.Presenter { @Override public void onAddProperty() { String propertyName = view.getNewPropertyName(); String propertyValue = view.getNewPropertyValue(); if ( properties == null ) { properties = new ArrayList<PropertyRow>( ); } properties.add( new PropertyRowImpl( propertyName, propertyValue ) ); setProperties( properties ); view.setNewPropertyName( "" ); view.setNewPropertyValue( "" ); } PersistenceUnitPropertyGrid(); @Inject  PersistenceUnitPropertyGrid( PersistenceUnitPropertyGridView view ); @Override Widget asWidget(); void setProperties( List<PropertyRow> properties ); List<PropertyRow> getProperties(); @Override void onAddProperty(); @Override void onRemoveProperty( PropertyRow propertyRow ); void setReadOnly( boolean readOnly ); void redraw(); }
PersistenceUnitPropertyGrid implements IsWidget,
                   PersistenceUnitPropertyGridView.Presenter { @Override public void onAddProperty() { String propertyName = view.getNewPropertyName(); String propertyValue = view.getNewPropertyValue(); if ( properties == null ) { properties = new ArrayList<PropertyRow>( ); } properties.add( new PropertyRowImpl( propertyName, propertyValue ) ); setProperties( properties ); view.setNewPropertyName( "" ); view.setNewPropertyValue( "" ); } PersistenceUnitPropertyGrid(); @Inject  PersistenceUnitPropertyGrid( PersistenceUnitPropertyGridView view ); @Override Widget asWidget(); void setProperties( List<PropertyRow> properties ); List<PropertyRow> getProperties(); @Override void onAddProperty(); @Override void onRemoveProperty( PropertyRow propertyRow ); void setReadOnly( boolean readOnly ); void redraw();  }