docs: public void matchListeners(Record record, boolean bCloneListeners, boolean bMatchEnabledState, boolean bSyncReferenceFields, boolean bMatchSelectedState, boolean bMatchOpenMode)
      {
          FileListener listener = this.getListener();
          // Don't add the listeners that already exist in the target record (from the record's addListeners() method).
          FileListener recordListener = record.getListener();
          while ((listener != null) && (recordListener != null))
          {   // Get through the first listeners (The ones added in init in the addListeners() method)
              if (!recordListener.getClass().getName().equals(listener.getClass().getName()))
                  break;  // Not the same... STOP. and start looking for matching listeners.
              if (bMatchEnabledState)
                  recordListener.setEnabledListener(listener.isEnabledListener());
              listener = (FileListener)listener.getNextListener();    // Skip to the next one in the chain.
              recordListener = (FileListener)recordListener.getNextListener();
          }
          while (listener != null)
          {   // Clone all the file behaviors (that want to be cloned)
              int iBehaviorCount = 0;
              FileListener thisListener = this.getListener(listener.getClass());
              while ((thisListener != null) && (thisListener != listener))
              {   // There are more than one, count which one it is.
                  iBehaviorCount++;
                  thisListener = (FileListener)thisListener.getListener(listener.getClass());
              }
              FileListener newBehavior = null;
              newBehavior = record.getListener(listener.getClass());
              while (iBehaviorCount > 0)
              {   // Get the correct one
                  iBehaviorCount--;
                  if (newBehavior != null)
                      newBehavior = (FileListener)newBehavior.getListener(listener.getClass());
              }
              if ((bCloneListeners) && (newBehavior == null))
              {
                  try   {
                      newBehavior = (FileListener)listener.clone(); // Clone the file behaviors
                  } catch (CloneNotSupportedException ex)   {
                      newBehavior = null;
                  }
                  if (newBehavior != null)
                      if (newBehavior.getOwner() == null)
                          record.addListener(newBehavior);        // Add them to the new query
              }
              if ((bMatchEnabledState) && (newBehavior != null))
                  newBehavior.setEnabledListener(listener.isEnabledListener());
              listener = (FileListener)listener.getNextListener();            // Do the next one in the chain
          }
          if ((bSyncReferenceFields) || (bMatchEnabledState) || (bCloneListeners) || (bMatchSelectedState))
          {
              for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
              {
                  BaseField field = this.getField(iFieldSeq);
                  BaseField fieldRecord = record.getField(iFieldSeq);
                  if ((fieldRecord == null) || (field.getClass() != fieldRecord.getClass()))
                      continue;
                  field.matchListeners(fieldRecord, bCloneListeners, bMatchEnabledState, bSyncReferenceFields, bMatchSelectedState);
              }
          }
          if (bMatchOpenMode)
              record.setOpenMode(this.getOpenMode());
      }