Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param iMainFilesField The sequence of the date changed field in this record.
@param field The date changed field in this record.
335352
public void init(Record record, DateTimeField field)
    {
        super.init(record);
        m_field = field;
        FieldDataScratchHandler listener = new FieldDataScratchHandler(null);
        listener.setAlwaysEnabled(true);    // Since this holds the current key
        m_field.addListener(listener); // I will need the original value for the sql update
        this.setMasterSlaveFlag(FileListener.RUN_IN_SLAVE | FileListener.RUN_IN_MASTER); // Set date key in slave code, check for error in master code
    }
665453
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
            if (m_converter != null) if (m_converter.getField() != null)
                if (((BaseField)m_converter.getField()).getRecord() != owner)
                    {   // Points to different file... make sure this is removed if the other file is closed
                        ((BaseField)m_converter.getField()).addListener(new FieldRemoveBOnCloseHandler(this));
                    }
    }
1194731
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    { // Read a valid record
        if (this.getOwner() != null)
        {
            IntegerField thisField = ((IntegerField)this.getOwner().getRecord().getField(m_iMainFilesFieldSeq));
            if (this.getOwner().getRecord().getRecordOwner() != null)
                if (this.getOwner().getRecord().getRecordOwner().getTask() != null)
                    if (this.getOwner().getRecord().getRecordOwner().getTask().getApplication() != null)
            {
                int iUserID = -1;
                if (this.getOwner().getRecord().getRecordOwner() != null)
                    if (((BaseApplication)this.getOwner().getRecord().getRecordOwner().getTask().getApplication()) != null)
                    if (((BaseApplication)this.getOwner().getRecord().getRecordOwner().getTask().getApplication()).getUserID() != null)
                    if (((BaseApplication)this.getOwner().getRecord().getRecordOwner().getTask().getApplication()).getUserID().length() > 0)
                        iUserID = Integer.parseInt(((BaseApplication)this.getOwner().getRecord().getRecordOwner().getTask().getApplication()).getUserID());     // File written or updated, set the user name
                int iErrorCode = thisField.setValue(iUserID, bDisplayOption, DBConstants.SCREEN_MOVE);
                if (iMoveMode == DBConstants.INIT_MOVE)
                    thisField.setModified(false);   // Don't make this record modified just because I set this field.
                return iErrorCode;
            }
        }
        return DBConstants.ERROR_RETURN;    // Can't set a field that is not long!
    }
169604
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            BaseField field = m_field;
            if (field != null)
                if (field.getRecord() != owner)
            {   // Points to different file... make sure this is removed if the other file is closed
                field.addListener(new FieldRemoveBOnCloseHandler(this));
            }
        }
    }
1257509
public BaseField setupField(int iFieldSeq)
    {
        BaseField field = null;
        //if (iFieldSeq == 0)
        //{
        //  field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 1)
        //{
        //  field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 2)
        //{
        //  field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
        //  field.setHidden(true);
        //}
        if (iFieldSeq == 3)
            field = new StringField(this, DESCRIPTION, 60, null, null);
        if (iFieldSeq == 4)
            field = new IntegerField(this, SEQUENCE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 5)
            field = new StringField(this, KIND, 10, null, null);
        if (iFieldSeq == 6)
            field = new PartTypeField(this, PART_TYPE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 7)
            field = new JnlpFileField(this, JNLP_FILE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 8)
            field = new StringField(this, PATH, 128, null, null);
        if (field == null)
            field = super.setupField(iFieldSeq);
        return field;
    }
590836
public void init(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties)
    {
        super.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties);
    }
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));
        }
    }
1279859
public void init(Object parent, Object record)
    {
        super.init(parent, record);

        this.addSubPanels(this);
        
        if (this.getBaseApplet() != null)
            if (this.getBaseApplet().getProperty(Constants.OBJECT_ID) != null)
                if (this.getFieldList() != null)
                    if ((this.getFieldList().getEditMode() == Constants.EDIT_NONE) || (this.getFieldList().getEditMode() == Constants.EDIT_ADD))
        {
            FieldInfo field = this.getFieldList().getCounterField();
            field.setString(this.getBaseApplet().getProperty(Constants.OBJECT_ID));
            this.readKeyed(field);
        }
        this.fieldsToControls();
    }
98059
@Override
	public void collect(T record)  {
		if (record != null) {
			this.delegate.setInstance(record);
			try {
				for (RecordWriter<SerializationDelegate<T>> writer : writers) {
					writer.emit(this.delegate);
				}
			}
			catch (IOException e) {
				throw new RuntimeException("Emitting the record caused an I/O exception: " + e.getMessage(), e);
			}
			catch (InterruptedException e) {
				throw new RuntimeException("Emitting the record was interrupted: " + e.getMessage(), e);
			}
		}
		else {
			throw new NullPointerException("The system does not support records that are null."
								+ "Null values are only supported as fields inside other objects.");
		}
	}
453170
public void addRecord(Rec record, boolean bMainQuery)
    {
        if (m_vRecordList == null)
            m_vRecordList = new RecordList(null);
        if (record == null)
            return;
        if (((Record)record).getRecordOwner() != null)      // Screen already here?
            if (((Record)record).getRecordOwner() != this)      // Screen already here?
                ((Record)record).getRecordOwner().removeRecord(record);      // Already belongs to another owner, remove it!
        m_vRecordList.addRecord(record, bMainQuery);
        if (((Record)record).getRecordOwner() == null)      // Screen already here?
            ((Record)record).setRecordOwner(this);    // This is the file for this screen
    }
414730
public void add(SingleImageRecord record) {
        if (records == null)
            records = new ArrayList<>();
        records.add(record);
    }
1045331
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_fldMain != null) if (m_fldMain.getRecord() != owner)
            m_fldMain.addListener(new FieldRemoveBOnCloseHandler(this));
    }
821780
@Override
	public void addField(final SchemaField field) {

		if (field instanceof FieldDefinition) {
			addField((FieldDefinition) field);
		} else if (field instanceof CopyFieldDefinition) {
			addCopyField((CopyFieldDefinition) field);
		}
	}
672288
public void init(BaseField field, GridScreenParent gridScreen, GridComponent sPopupBox)
    {
        super.init(field);
        m_gridScreen = gridScreen;
        m_sPopupBox = sPopupBox;
        Record gridFile = null;
        if (gridScreen != null)
            gridFile = (Record)gridScreen.getMainRecord();
        if (gridFile != null)
        {   // Remove this listener when the file closes
            FileListener listener = new FileRemoveBOnCloseHandler(this);    // If this closes first, this will remove FileListener
            gridFile.addListener(listener);   // Remove this if you close the file first
        }
    }
1284175
public BaseField setupField(int iFieldSeq)
    {
        BaseField field = null;
        //if (iFieldSeq == 0)
        //{
        //  field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 1)
        //{
        //  field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 2)
        //{
        //  field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
        //  field.setHidden(true);
        //}
        if (iFieldSeq == 3)
            field = new DateTimeField(this, START_DATE_TIME, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 4)
            field = new DateTimeField(this, END_DATE_TIME, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 5)
            field = new StringField(this, DESCRIPTION, 60, null, null);
        if (iFieldSeq == 6)
            field = new RepeatIntervalField(this, REPEAT_INTERVAL_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 7)
            field = new ShortField(this, REPEAT_COUNT, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 8)
            field = new CalendarCategoryField(this, CALENDAR_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 9)
            field = new BooleanField(this, HIDDEN, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
        if (iFieldSeq == 10)
            field = new PropertiesField(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (field == null)
            field = super.setupField(iFieldSeq);
        return field;
    }
564926
public void addRecord(Rec record, boolean bMainQuery)
    {
        if (record == null)
            return;
        if (this.contains(record))
        {     // Don't add this twice.
            if (!bMainQuery)
                return;
            this.removeRecord(record);  // Change order
        }
        if (bMainQuery)
            this.insertElementAt(record, 0);
        else
            this.addElement(record);
    }
807189
public void addListener(Record record, FileListener listener)
    {
        if (this.getNextTable() != null)
            this.getNextTable().addListener(record, listener);
    }