Set the field or file that owns this listener.
@param owner My owner.
330802
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() == null)
            return;
        if (m_fldDest.getRecord() != this.getOwner())  // If field is not in this file, remember to remove it
            m_fldDest.addListener(new FieldRemoveBOnCloseHandler(this));
        if (m_fldSource != null) if (m_fldSource.getRecord() != this.getOwner()) if (m_fldSource.getRecord() != m_fldDest.getRecord())
            m_fldSource.addListener(new FieldRemoveBOnCloseHandler(this));
        if ((this.getOwner().getEditMode() == DBConstants.EDIT_CURRENT) || (this.getOwner().getEditMode() == DBConstants.EDIT_IN_PROGRESS))
            if (m_bMoveOnValid)
                this.moveTheData(DBConstants.DISPLAY, DBConstants.INIT_MOVE);  // Do trigger a record change.
        if (this.getOwner().getEditMode() == DBConstants.EDIT_ADD)
            if (m_bMoveOnNew)
                this.moveTheData(DBConstants.DISPLAY, DBConstants.INIT_MOVE);  // Do trigger a record change.
    }
1101045
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_fldToDisable != null)
            if (this.getOwner().getRecord() != m_fldToDisable.getRecord())
                m_fldToDisable.addListener(new FieldRemoveBOnCloseHandler(this)); // Make sure you remove this listener if m_fldToDisable is gone.
        if (owner != null)
            if (m_fldToDisable == null)
                m_fldToDisable = this.getOwner();
        if (owner != null)
            this.fieldChanged(DBConstants.DONT_DISPLAY, DBConstants.INIT_MOVE);
        if (owner == null)
            m_fldToDisable.setEnabled(true);    // Remove the behavior = reenable the field
    }
1305677
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_recordToSync != null)
        {
            if (!m_recordToSync.getBaseRecord().getTableNames(false).equals(this.getOwner().getBaseRecord().getTableNames(false)))
            {   // Must be the same base tables!
                m_recordToSync = null;
                return;
            }
            m_recordToSync.addListener(new FileRemoveBOnCloseHandler(this));
        }
    }
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;
    }
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);
    }
1127518
public void setPropertiesField(Field fldProperties)
    {
        if (fldProperties != null)
        {
            m_fldProperties = (PropertiesField)fldProperties;
            this.loadFieldProperties();
            this.addListener(new FileListener(null)
            {
                public void setOwner(ListenerOwner owner)
                {
                    if (owner == null)
                        if (this.getOwner() != null)
                            ((PropertiesInput)PropertiesInput.this).restoreFieldProperties();
                    super.setOwner(owner);
                }
            });
        }
    }
337724
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            Record recUserInfo = this.getOwner();
            RecordOwner recordOwner = recUserInfo.getRecordOwner();
            Record recUserScreenRecord = (Record)recordOwner.getScreenRecord();
            // This will flag the password as changed:
            recUserScreenRecord.getField(UserScreenRecord.NEW_PASSWORD_1).addListener(new ChangeOnChangeHandler(recUserInfo.getField(UserInfo.PASSWORD), true));
            recUserScreenRecord.getField(UserScreenRecord.NEW_PASSWORD_2).addListener(new ChangeOnChangeHandler(recUserInfo.getField(UserInfo.PASSWORD), true));
        }
    }
871525
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
        {
            if (this.getOwner().getListener(this.getClass()) != this)
                if (((MainFieldHandler)this.getOwner().getListener(this.getClass())).getActualKeyArea() == this.getActualKeyArea())
                    this.getOwner().removeListener(this.getOwner().getListener(this.getClass()), true); // Make sure there is only one of these
        }
    }
2116
public void setOwner(String src, String username, String group
  ) throws IOException {
    INode[] inodes = null;
    writeLock();
    try {
      if (isInSafeMode()) {
        throw new SafeModeException("Cannot set permission for " + src, safeMode);
      }
      inodes = dir.getExistingPathINodes(src);
      if (isPermissionCheckingEnabled(inodes)) {
        FSPermissionChecker pc = checkOwner(src, inodes);
        if (!pc.isSuper) {
          if (username != null && !pc.user.equals(username)) {
            if (this.permissionAuditOnly) {
              // do not throw the exception, we would like to only log.
              LOG.warn("PermissionAudit failed on " + src + 
                  ": non-super user cannot change owner.");
            } else {
              throw new AccessControlException("Non-super user cannot change owner.");
            }
          }
          if (group != null && !pc.containsGroup(group)) {
            if (this.permissionAuditOnly) {
              // do not throw the exception, we would like to only log.
              LOG.warn("PermissionAudit failed on " + src + 
                  ": user does not belong to " + group + " .");
            } else {
              throw new AccessControlException("User does not belong to " + group
                  + " .");
            }
          }
        }
      }
      dir.setOwner(src, username, group);
    } finally {
      writeUnlock();
    }
    getEditLog().logSync(false);
    if (auditLog.isInfoEnabled()) {
      logAuditEvent(getCurrentUGI(),
        Server.getRemoteIp(),
        "setOwner", src, null, getLastINode(inodes));
    }
  }
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);
        }
    }
1270149
@SuppressWarnings("unchecked")
	<K, E extends PoolableObject<V>> E releaseOwner() {
		this.owner = null;
		return (E) this;
	}
1224929
@Override public void onAttached(Run<?,?> owner) {
        for (Cause c : causeBag.keySet()) {
            if (c != null) {
                c.onAddedTo(owner);
            }
        }
    }
680122
void release(Object owner, Field field) {
        Map<String, Integer> fields = owners.get(owner);
        if(fields != null) {
            release();

            Integer count = fields.get(field.toGenericString());
            if(--count > 0) {
                fields.put(field.toGenericString(), count);
            } else {
                fields.remove(field.toGenericString());
            }
        }

        if(fields != null && fields.isEmpty()) {
            owners.remove(owner);
        }
    }
414751
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            if (m_fldTarget != null)
                if (m_fldTarget.getRecord() != this.getOwner().getRecord())
                    m_fldTarget.addListener(new FieldRemoveBOnCloseHandler(this));      // Not same file, if target file closes, remove this listener!
            if (this.getFieldTarget() != null)
                if (!(this.getFieldTarget().isVirtual()) && (!(this.getFieldTarget().getRecord() instanceof ScreenRecord)))
                    if (this.respondsToMode(DBConstants.READ_MOVE) == true)
                        if (this.respondsToMode(DBConstants.INIT_MOVE) == true)
            {   // This is a performance issue if the field I'm updating is connected to a file
                this.setRespondsToMode(DBConstants.READ_MOVE, false);   // Usually, you only want to recompute on screen change
                this.setRespondsToMode(DBConstants.INIT_MOVE, false);   // Usually, you only want to recompute on screen change
            }
        }
    }
1046314
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
            this.getOwner().setOpenMode(this.getOwner().getOpenMode() | DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY);    // Make sure keys are updated before sync
    }
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);
    }
520780
public static void setProperty(String key, String value, PropertyOwner propertyOwner, Map<String,Object> properties)
    {
        if (propertyOwner != null)
        {
            propertyOwner.setProperty(key, value);
        }
        if (properties != null)
        {
            if (value != null)
                properties.put(key, value);
            else
                properties.remove(key);
        }
    }