Set the field or file that owns this listener.
Besides inherited, this method closes the owner record.
@param owner My owner.
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!
    }
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;
    }
346075
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            if (m_converterSource == null)
                m_converterSource = this.getOwner();
            if (m_converterDest != null)
                if (m_converterDest.getField() != null)
                    if (m_converterSource.getField() == this.getOwner())    // Always!
                        if (((BaseField)m_converterDest.getField()).getRecord() != this.getOwner().getRecord())
            { // Not same file, if target file closes, remove this listener!
                ((BaseField)m_converterDest.getField()).getRecord().addListener(new FileRemoveBOnCloseHandler(this));
            }
        }
        else if (m_bFreeChainedConverters)
        {   // Free all the converters in the chain
            while ((m_converterDest != null) && (m_converterDest != m_converterDest.getField()))
            {
                Converter converterNext = null;
                if (m_converterDest instanceof FieldConverter)
                    converterNext = ((FieldConverter)m_converterDest).getNextConverter();
                m_converterDest.free();
                m_converterDest = converterNext;
            }
            while ((m_converterSource != null) && (m_converterSource != m_converterSource.getField()))
            {
                Converter converterNext = null;
                if (m_converterSource instanceof FieldConverter)
                    converterNext = ((FieldConverter)m_converterSource).getNextConverter();
                m_converterSource.free();
                m_converterSource = converterNext;
            }
        }
    }
81577
public void setLifecycleOwner(@Nullable LifecycleOwner lifecycleOwner) {
        this.lifecycleOwner = lifecycleOwner;
        if (recyclerView != null) {
            for (int i = 0; i < recyclerView.getChildCount(); i++) {
                View child = recyclerView.getChildAt(i);
                ViewDataBinding binding = DataBindingUtil.getBinding(child);
                if (binding != null) {
                    binding.setLifecycleOwner(lifecycleOwner);
                }
            }
        }
    }
1075788
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
        {
            if (m_fldSource != null) if (m_fldSource.getRecord() != this.getOwner().getRecord())
                m_fldSource.getRecord().addListener(new FileRemoveBOnCloseHandler(this));     // Not same file, if target file closes, remove this listener!
            InitOnceFieldHandler behavior = (InitOnceFieldHandler)this.getOwner().getListener(InitOnceFieldHandler.class.getName());
            if (this.getOwner().getRecord().getEditMode() == DBConstants.EDIT_CURRENT)
                behavior = null;    // Special case - if there is a current record, make sure initonce works.
            if (behavior != null)
                behavior.setFirstTime(true);  // If this listener exists it doesn't init initially everything up, so disable for a sec.
            this.syncBehaviorToRecord(null);    // Init now
            if (this.getOwner() instanceof ReferenceField)
                if (this.getOwner().getListener(ReadSecondaryHandler.class.getName()) != null)
                {
                    if (behavior != null)
                        behavior.setEnabledListener(false);  // If this listener exists it doesn't init initially everything up, so disable for a sec.
                    ((FieldListener)this.getOwner().getListener(ReadSecondaryHandler.class.getName())).syncBehaviorToRecord(null);
                }
        }
    }
637797
public void setOwner(Path f, String user, String group) throws IOException {
    try (Closeable context = new TimerContextWithLog(this.setOwnerTimer.time(), "setOwner", f, user, group)) {
      super.setOwner(f, user, group);
    }
  }
241926
@Override
    public void setOwner(ApiBaseUser owner) {
        room.setOwner(CommandUtil.getSfsUser(owner, api));
        apiRoom.setOwner(owner);
    }
746686
public void saveValue(ComponentParent recordOwner)
    {
        if (recordOwner != null)
        {
            BaseField field = this.getOwner();
            String strCommand = ((ComponentParent)recordOwner).getParentScreen().popHistory(1, false);
            if (m_recordOwnerCache != null)
                if (strCommand != null)
                    if (strCommand.indexOf(m_recordOwnerCache.getClass().getName()) != -1)
            {   // Yes this is the command to open this window
                Map<String,Object> properties = new Hashtable<String,Object>();
                Util.parseArgs(properties, strCommand);
                properties.put(field.getFieldName(), field.toString());
                strCommand = Utility.propertiesToURL(null, properties);
            }
            ((ComponentParent)recordOwner).getParentScreen().pushHistory(strCommand, false);
        }
    }
1258822
public function setOwner(HTML_QuickForm2_Node $owner)
    {
        if (!$owner instanceof HTML_QuickForm2_Element_InputFile) {
            throw new HTML_QuickForm2_InvalidArgumentException(
                'MimeType Rule can only validate file upload fields, '.
                get_class($owner) . ' given'
            );
        }
        parent::setOwner($owner);
    }
83268
public void setOwner(ListenerOwner owner)
    {
        if (owner != null)
            if (m_buffer == null)
        {   // Save the current key
            KeyArea keyArea = ((Record)owner).getKeyArea(-1);
            m_buffer = new VectorBuffer(null);
            keyArea.setupKeyBuffer(m_buffer, DBConstants.FILE_KEY_AREA);
        }
        super.setOwner(owner);
    }
221989
public boolean addLockedObjectOwner(String owner) {

        if (_owner == null) {
            _owner = new String[1];
        } else {

            int size = _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 (_owner[i].equals(owner)) {
                    return false;
                }
            }

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

        _owner[_owner.length - 1] = owner;
        return true;
    }
476103
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            MoveOnValidHandler moveBehavior = null;
            m_record.setOpenMode(m_record.getOpenMode() | DBConstants.OPEN_CACHE_RECORDS);    // Cache recently used records.
            
            m_bMoveBehavior = false;    // This flag is set automatically if the Valid record listener has to be used
            
            ReadSecondaryHandler listenerDup = (ReadSecondaryHandler)this.getOwner().getListener(this.getClass());
            while ((listenerDup != this) && (listenerDup != null))
            {
                if (listenerDup.getRecord() == this.getRecord())
                    if (listenerDup.getActualKeyArea() == this.getActualKeyArea())
                {
                    listenerDup.setRecord(null);
                    this.getOwner().removeListener(listenerDup, true); // Make sure there is only one
                    break;
                }
                listenerDup = (ReadSecondaryHandler)listenerDup.getListener(this.getClass());
            }
            
            this.fieldChanged(DBConstants.DISPLAY, DBConstants.READ_MOVE);    // SCREEN_MOVE says this is coming from here

            if (owner instanceof ReferenceField)
            {
                m_keyField = m_record.getKeyArea(keyAreaName).getField(DBConstants.MAIN_KEY_FIELD);   // Handle field (note - null keyAreaName -> counter field)
                moveBehavior = new MoveOnValidHandler(((BaseField)owner), m_keyField, null, true, true);        // Its okay to sync the key with references
                m_keyField = null;
            } 
            else
            {
                MainReadOnlyHandler listener = new MainReadOnlyHandler(keyAreaName);
                m_keyField = m_record.getKeyArea(keyAreaName).getField(DBConstants.MAIN_KEY_FIELD);
                m_keyField.addListener(listener); //    Make sure this field has the BaseListener to read it's file
                    // Make sure you move the key field to this field!!
                moveBehavior = new MoveOnValidHandler(((BaseField)owner), m_keyField, null, false, true);
            } 
            m_record.addListener(moveBehavior);
        }
        else
        {
            if (m_bCloseOnFree) if (this.getDependentListener() != null) // If close and file is still open
            {
                this.setDependentListener(null);    // If case you want to delete me!
                if (m_record != null)
                    m_record.free();  // File is still open, and my listener is still there, close it!
            }
            m_record = null;
            m_keyField = null;
        }
    }
676768
public void removeLockedObjectOwner( String owner ) {

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

                    }
                }
                if (this.owner.length == 0) {
                    this.owner = null;
                }
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            LOGGER.error(e, new TextI18n("LockedObject.removeLockedObjectOwner()"));
        }
    }
502675
public void setOwner(HttpServiceContext hsc) {
        // if we have an SC owner, set it's flag to false
        if (null != getServiceContext()) {
            getServiceContext().setRequestOwner(false);
        }
        // if the owner is a new HSC, then init the flags
        if (null != hsc) {
            super.init(hsc);
            getServiceContext().setRequestOwner(true);
            setIncoming(getServiceContext().isInboundConnection());
        }
    }
171243
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner == null)
            return;
        if (m_fldThisFile == null)
            if (thisFileFieldName != null)
                m_fldThisFile = this.getOwner().getField(thisFileFieldName);
        if (m_fldThisFile2 == null)
            if (thisFileFieldName2 != null)
                m_fldThisFile2 = this.getOwner().getField(thisFileFieldName2);
        if (m_fldThisFile3 == null)
            if (thisFileFieldName3 != null)
                m_fldThisFile3 = this.getOwner().getField(thisFileFieldName3);
//?        if (m_fldThisFile != null)
//?            m_fldThisFile.saveEnableListeners(false);     // Don't let behaviors mess with my values.
//?        if (m_fldThisFile2 != null)
//?            m_fldThisFile2.saveEnableListeners(false);    // Note: This is because of a conflict with.
//?        if (m_fldThisFile3 != null)
//?            m_fldThisFile3.saveEnableListeners(false);    // InitOnceFieldHandler, the value is only set once.
//x        this.setMainKey(true, null);    // Initialize the keys
    }
55301
public void setOwner(ListenerOwner owner)
    {
        if (owner != null)
        if (m_fldDest == null)
            if (fieldName != null)
                m_fldDest = ((BaseField)owner).getRecord().getField(fieldName);
        super.setOwner(owner);
    }
368713
public void init(RecordOwner recordOwner)
    {
        m_vRecordList = new RecordList(null);
        m_LinkageList = new Vector<TableLink>();
        
        this.addTables(recordOwner);       // Add any query records or overriding records
        boolean bMainRecord = false;
        for (int i = 0; i < this.getRecordlistCount(); i++)
        {   // DO NOT set the recordowner in queries
            Record record = this.getRecordlistAt(i);
            if (record == recordOwner.getMainRecord())
                bMainRecord = true;
            recordOwner.removeRecord(record);
        }
        
        super.init(recordOwner);
        
        if (bMainRecord == true)
            if (this != recordOwner.getMainRecord())
            {
                recordOwner.removeRecord(this);
                recordOwner.addRecord(this, true);
            }
        this.setupRelationships();
    }