@Test public void loadDataObjectTest( ) { objectEditor.onContextChange( context ); DataObject dataObject = context.getDataObject( ); verify( view, times( 1 ) ).setTypeSafe( "true" ); verify( view, times( 1 ) ).setPropertyReactive( true ); verify( view, times( 1 ) ).setRole( "EVENT" ); verify( view, times( 1 ) ).setTimeStampField( "field2" ); verify( view, times( 1 ) ).setDurationField( "field3" ); verify( view, times( 1 ) ).setExpires( "1h" ); verify( view, times( 1 ) ).setRemotable( true ); assertFalse( objectEditor.isReadonly( ) ); }
protected void loadDataObject( DataObject dataObject ) { clear(); setReadonly( true ); if ( dataObject != null ) { this.dataObject = dataObject; Annotation annotation = dataObject.getAnnotation( DroolsDomainAnnotations.ROLE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setRole( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.PROPERTY_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setPropertyReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.CLASS_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setClassReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.TYPE_SAFE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setTypeSafe( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.EXPIRES_ANNOTATION ); if ( annotation != null ) { view.setExpires( annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.JAXB_XML_ROOT_ELEMENT_ANNOTATION ); if ( annotation == null ) { annotation = dataObject.getAnnotation( DroolsDomainAnnotations.REMOTABLE_ANNOTATION ); } if ( annotation != null ) { view.setRemotable( Boolean.TRUE ); } loadDuration( dataObject ); loadTimestamp( dataObject ); setReadonly( getContext() == null || getContext().isReadonly() ); } }
DroolsDataObjectEditor extends ObjectEditor implements DroolsDataObjectEditorView.Presenter { protected void loadDataObject( DataObject dataObject ) { clear(); setReadonly( true ); if ( dataObject != null ) { this.dataObject = dataObject; Annotation annotation = dataObject.getAnnotation( DroolsDomainAnnotations.ROLE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setRole( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.PROPERTY_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setPropertyReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.CLASS_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setClassReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.TYPE_SAFE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setTypeSafe( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.EXPIRES_ANNOTATION ); if ( annotation != null ) { view.setExpires( annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.JAXB_XML_ROOT_ELEMENT_ANNOTATION ); if ( annotation == null ) { annotation = dataObject.getAnnotation( DroolsDomainAnnotations.REMOTABLE_ANNOTATION ); } if ( annotation != null ) { view.setRemotable( Boolean.TRUE ); } loadDuration( dataObject ); loadTimestamp( dataObject ); setReadonly( getContext() == null || getContext().isReadonly() ); } } }
DroolsDataObjectEditor extends ObjectEditor implements DroolsDataObjectEditorView.Presenter { protected void loadDataObject( DataObject dataObject ) { clear(); setReadonly( true ); if ( dataObject != null ) { this.dataObject = dataObject; Annotation annotation = dataObject.getAnnotation( DroolsDomainAnnotations.ROLE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setRole( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.PROPERTY_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setPropertyReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.CLASS_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setClassReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.TYPE_SAFE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setTypeSafe( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.EXPIRES_ANNOTATION ); if ( annotation != null ) { view.setExpires( annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.JAXB_XML_ROOT_ELEMENT_ANNOTATION ); if ( annotation == null ) { annotation = dataObject.getAnnotation( DroolsDomainAnnotations.REMOTABLE_ANNOTATION ); } if ( annotation != null ) { view.setRemotable( Boolean.TRUE ); } loadDuration( dataObject ); loadTimestamp( dataObject ); setReadonly( getContext() == null || getContext().isReadonly() ); } } @Inject  DroolsDataObjectEditor( DroolsDataObjectEditorView view,
            DomainHandlerRegistry handlerRegistry,
            Event<DataModelerEvent> dataModelerEvent,
            DataModelCommandBuilder commandBuilder,
            ValidatorService validatorService ); }
DroolsDataObjectEditor extends ObjectEditor implements DroolsDataObjectEditorView.Presenter { protected void loadDataObject( DataObject dataObject ) { clear(); setReadonly( true ); if ( dataObject != null ) { this.dataObject = dataObject; Annotation annotation = dataObject.getAnnotation( DroolsDomainAnnotations.ROLE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setRole( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.PROPERTY_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setPropertyReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.CLASS_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setClassReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.TYPE_SAFE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setTypeSafe( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.EXPIRES_ANNOTATION ); if ( annotation != null ) { view.setExpires( annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.JAXB_XML_ROOT_ELEMENT_ANNOTATION ); if ( annotation == null ) { annotation = dataObject.getAnnotation( DroolsDomainAnnotations.REMOTABLE_ANNOTATION ); } if ( annotation != null ) { view.setRemotable( Boolean.TRUE ); } loadDuration( dataObject ); loadTimestamp( dataObject ); setReadonly( getContext() == null || getContext().isReadonly() ); } } @Inject  DroolsDataObjectEditor( DroolsDataObjectEditorView view,
            DomainHandlerRegistry handlerRegistry,
            Event<DataModelerEvent> dataModelerEvent,
            DataModelCommandBuilder commandBuilder,
            ValidatorService validatorService ); @Override Widget asWidget(); @Override String getName(); @Override String getDomainName(); void setReadonly( boolean readonly ); @Override void onRoleChange(); @Override void onTypeSafeChange(); @Override void onTimeStampFieldChange(); @Override void onDurationFieldChange(); @Override void onPropertyReactiveChange(); @Override void onClassReactiveChange(); @Override void onExpiresChange(); @Override void onRemotableChange(); void clear(); }
DroolsDataObjectEditor extends ObjectEditor implements DroolsDataObjectEditorView.Presenter { protected void loadDataObject( DataObject dataObject ) { clear(); setReadonly( true ); if ( dataObject != null ) { this.dataObject = dataObject; Annotation annotation = dataObject.getAnnotation( DroolsDomainAnnotations.ROLE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setRole( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.PROPERTY_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setPropertyReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.CLASS_REACTIVE_ANNOTATION ); if ( annotation != null ) { view.setClassReactive( Boolean.TRUE ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.TYPE_SAFE_ANNOTATION ); if ( annotation != null ) { String value = annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ) != null ? annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() : UIUtil.NOT_SELECTED; view.setTypeSafe( value ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.EXPIRES_ANNOTATION ); if ( annotation != null ) { view.setExpires( annotation.getValue( DroolsDomainAnnotations.VALUE_PARAM ).toString() ); } annotation = dataObject.getAnnotation( DroolsDomainAnnotations.JAXB_XML_ROOT_ELEMENT_ANNOTATION ); if ( annotation == null ) { annotation = dataObject.getAnnotation( DroolsDomainAnnotations.REMOTABLE_ANNOTATION ); } if ( annotation != null ) { view.setRemotable( Boolean.TRUE ); } loadDuration( dataObject ); loadTimestamp( dataObject ); setReadonly( getContext() == null || getContext().isReadonly() ); } } @Inject  DroolsDataObjectEditor( DroolsDataObjectEditorView view,
            DomainHandlerRegistry handlerRegistry,
            Event<DataModelerEvent> dataModelerEvent,
            DataModelCommandBuilder commandBuilder,
            ValidatorService validatorService ); @Override Widget asWidget(); @Override String getName(); @Override String getDomainName(); void setReadonly( boolean readonly ); @Override void onRoleChange(); @Override void onTypeSafeChange(); @Override void onTimeStampFieldChange(); @Override void onDurationFieldChange(); @Override void onPropertyReactiveChange(); @Override void onClassReactiveChange(); @Override void onExpiresChange(); @Override void onRemotableChange(); void clear();  }