public BaseMessageFilter setupRecordListener(JMessageListener listener, boolean bTrackMultipleRecords, boolean bAllowEchos, boolean bReceiveAllAdds)
    {
        BaseMessageFilter filter = null;
        MessageManager messageManager = null;
        if (listener == null)
            listener = this.getRecordOwner();
        if (listener != null)
            if (this.getRecordOwner() != null)
                if (this.getRecordOwner().getTask() != null)
                    messageManager = ((Application)this.getRecordOwner().getTask().getApplication()).getMessageManager();
        if (messageManager != null)
        {
            Object source = null;
            if (bAllowEchos)
                source = DBConstants.BLANK;     // Non-null object that will never be a source
            if (!bTrackMultipleRecords)
                filter = new RecordMessageFilter(this, source);
            else
                filter = new GridRecordMessageFilter(this, source, bReceiveAllAdds);
            filter.addMessageListener(listener);
            messageManager.addMessageFilter(filter);
        }
        return filter;
    }
public BaseMessageFilter setupRecordListener ( JMessageListener listener , boolean bTrackMultipleRecords , boolean bAllowEchos , boolean bReceiveAllAdds ) { BaseMessageFilter filter = null ; MessageManager messageManager = null ; if ( listener == null ) listener = this . getRecordOwner ( ) ; if ( listener != null ) if ( this . getRecordOwner ( ) != null ) if ( this . getRecordOwner ( ) . getTask ( ) != null ) messageManager = ( ( Application ) this . getRecordOwner ( ) . getTask ( ) . getApplication ( ) ) . getMessageManager ( ) ; if ( messageManager != null ) { Object source = null ; if ( bAllowEchos ) source = DBConstants . BLANK ; if ( ! bTrackMultipleRecords ) filter = new RecordMessageFilter ( this , source ) ; else filter = new GridRecordMessageFilter ( this , source , bReceiveAllAdds ) ; filter . addMessageListener ( listener ) ; messageManager . addMessageFilter ( filter ) ; } return filter ; }
Set up a listener to notify when an external change is made to the current record.
@param listener The listener to set to the new filter. If null, use the record's recordowner.
@param bTrackMultipleRecord Use a GridRecordMessageFilter to watch for multiple records.
@param bAllowEchos Allow this record to be notified of changes (usually for remotes hooked to grid tables).
@param bReceiveAllAdds If true, receive all add notifications, otherwise just receive the adds on secondary reads.
@return The new filter.