Add this record owner to my list.
@param recordOwner The record owner to add
430352
public boolean addRecordOwner(RecordOwnerParent recordOwner)
    {
    	if (recordOwner instanceof BasePanel)
    		return false;		// Panels have their own owner hierarchy - Don't need to manage them
    	if (m_recordOwnerCollection == null)
    		m_recordOwnerCollection = new RecordOwnerCollection(this);
    	return m_recordOwnerCollection.addRecordOwner(recordOwner);
    }
295565
public function useRecord(Record $record): void
    {
        $this->records->add($this->name, $record);
    }
1209369
public void putRawProperties(PropertyOwner propertyOwner)
    {
        if (m_messageDataDescChildren != null)
        {
            for (String strKey : m_messageDataDescChildren.keySet())
            {
                m_messageDataDescChildren.get(strKey).putRawProperties(propertyOwner);
            }
        }
    }
482365
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner == null)
            return;
        if ((m_strFieldNameToCheck != null)
            && (m_strFieldNameToCheck.length() > 0))
            if ((m_fldToCheck == null)
                || (m_fldToCheck.getFieldName() == null)
                || (m_fldToCheck.getFieldName().length() == 0))
                    m_fldToCheck = this.getOwner().getField(m_strFieldNameToCheck); // If you have the fieldname, but not the field, get the field.
        if (m_fldToCompare != null) if (m_fldToCompare.getRecord() != this.getOwner())
            m_fldToCompare.addListener(new FieldRemoveBOnCloseHandler(this));
        if (m_fldToCheck != null) if (m_fldToCheck.getRecord() != this.getOwner())  // If field is not in this file, remember to remove it
            m_fldToCheck.addListener(new FieldRemoveBOnCloseHandler(this));
//x        this.getOwner().close();    // Must requery after setting dependent fields!
    }
191424
void retain(Object owner, Field field) {
        retain();
        Map<String, Integer> fields = owners.get(owner);
        if (fields == null) {
            fields = new HashMap<>();
            owners.put(owner, fields);
        }

        Integer count = fields.get(field.toGenericString());
        if (count == null) {
            fields.put(field.toGenericString(), 1);
        } else {
            count++;
            fields.put(field.toGenericString(), count);
        }
    }
111368
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            if (m_fldValue1 != null)
                if (m_fldValue1.getRecord() != this.getOwner().getRecord())
                    m_fldValue1.addListener(new FieldRemoveBOnCloseHandler(this));      // Not same file, if target file closes, remove this listener!
            if (m_fldValue2 != null)
                if (m_fldValue2.getRecord() != this.getOwner().getRecord())
                if (m_fldValue2.getRecord() != m_fldValue1.getRecord())
                    m_fldValue2.addListener(new FieldRemoveBOnCloseHandler(this));      // Not same file, if target file closes, remove this listener!
        }
    }
335869
public void free(RecordOwner recordOwner)
    {
        if (m_ScreenRecord != null)
            if ((recordOwner == null) || (m_ScreenRecord.getRecordOwner() == recordOwner))
        {
            m_ScreenRecord.free();  // Delete the screen fields
            m_ScreenRecord = null;
        }

        while (this.size() > 0)
        {
            Record record = (Record)this.elementAt(0);
            if ((recordOwner == null) || (record.getRecordOwner() == recordOwner))
                record.free();
            else
                this.removeRecord(record);  // Remove the query from this list
        } 
        this.removeAllElements();
    }
62452
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (m_recordToUpdate == null)
            m_recordToUpdate = this.getOwner();   // Defaults to this file
        if (owner != null) if (this.getOwner() != m_recordToUpdate)
            m_recordToUpdate.addListener(new FileRemoveBOnCloseHandler(this));
        if (m_recordToUpdate != null)
            m_recordToUpdate.setOpenMode((m_recordToUpdate.getOpenMode() | DBConstants.OPEN_LOCK_ON_CHANGE_STRATEGY) & ~(DBConstants.OPEN_READ_ONLY | DBConstants.OPEN_APPEND_ONLY));   // Lock the record if any changes
        if (owner != null)
            if (this.getOwner() == m_recordToUpdate)
                if (this.getOwner().getListener() != this)  // Prevents endless loop (listener is already the first in the list)
        {   // This is special weird logic - This must be the first in the listener list
            this.getOwner().removeListener(this, false);
            super.setOwner(owner);  // Set it back
            this.setNextListener(this.getOwner().getListener());
            this.getOwner().setListener(this);  // This MUST be the first listener on the list.
        }
    }
297471
public Record createSharedRecord(Object objKey, RecordOwner recordOwner)
    {
        if (objKey instanceof Integer)
        {
            int iCalendarType = ((Integer)objKey).intValue();
            if (iCalendarType == CalendarEntry.APPOINTMENT_ID)
                return new Appointment(recordOwner);
            if (iCalendarType == CalendarEntry.ANNIVERSARY_ID)
                return new Anniversary(recordOwner);
        }
        return null;
    }
589791
public Record makeReferenceRecord(RecordOwner recordOwner)
    {
        Record record = super.makeReferenceRecord(recordOwner);
        record.addListener(new CompareFileFilter(record.getField(ContactType.LEVEL), "1", DBConstants.EQUALS, null, true));
        return record;
    }
385583
@SuppressWarnings("unchecked")
	public void addWriter(RecordWriter<Record> writer)
	{
		// avoid using the array-list here to reduce one level of object indirection
		if (this.writers == null) {
			this.writers = new RecordWriter[] {writer};
		}
		else {
			RecordWriter<Record>[] ws = new RecordWriter[this.writers.length + 1];
			System.arraycopy(this.writers, 0, ws, 0, this.writers.length);
			ws[this.writers.length] = writer;
			this.writers = ws;
		}
	}
949936
public void removeLockedObjectOwner(String owner) {

        try {
            if (_owner != null) {
                int size = _owner.length;
                for (int i = 0; i < size; i++) {
                    // check every owner if it is the requested one
                    if (_owner[i].equals(owner)) {
                        // remove the owner
                        String[] newLockedObjectOwner = new String[size - 1];
                        for (int j = 0; j < (size - 1); j++) {
                            if (j < i) {
                                newLockedObjectOwner[j] = _owner[j];
                            } else {
                                newLockedObjectOwner[j] = _owner[j + 1];
                            }
                        }
                        _owner = newLockedObjectOwner;

                    }
                }
                if (_owner.length == 0) {
                    _owner = null;
                }
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("LockedObject.removeLockedObjectOwner()");
            System.out.println(e.toString());
        }
    }
800975
public boolean addLockedObjectOwner( String owner ) {

        if (this.owner == null) {
            this.owner = new String[1];
        } else {

            int size = this.owner.length;
            String[] newLockObjectOwner = new String[size + 1];

            // check if the owner is already here (that should actually not
            // happen)
            for (int i = 0; i < size; i++) {
                if (this.owner[i].equals(owner)) {
                    return false;
                }
            }

            System.arraycopy(this.owner, 0, newLockObjectOwner, 0, size);
            this.owner = newLockObjectOwner;
        }

        this.owner[this.owner.length - 1] = owner;
        return true;
    }
415003
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
            if (m_fldTarget == null)
                if (m_fsTarget != null)
                    m_fldTarget = this.getOwner().getField(m_fsTarget);
    }
1232462
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner == null)
            return;
        if (fieldName != null)
            m_fldTarget = this.getOwner().getField(fieldName);
        if (m_fldTarget != null) if (m_fldTarget.getRecord() != this.getOwner())    // If field is not in this file, remember to remove it
            m_fldTarget.addListener(new FieldRemoveBOnCloseHandler(this));
        if ((this.getOwner().getEditMode() == DBConstants.EDIT_CURRENT) || (this.getOwner().getEditMode() == DBConstants.EDIT_IN_PROGRESS))
            this.setEnabled(m_bEnableOnValid);
        if (this.getOwner().getEditMode() == DBConstants.EDIT_ADD)
            this.setEnabled(m_bEnableOnNew);
    }
635385
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_recordToSync != null)
            m_recordToSync.addListener(new FileRemoveBOnCloseHandler(this));
    }
231367
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null) if (!this.getOwner().isNull())
            // Display the screen that is supposed to be up now
            this.fieldChanged(DBConstants.DISPLAY, DBConstants.INIT_MOVE);
    }