Called when a valid record is read from the table/query.
@param bDisplayOption If true, display any changes.
503952
public void doValidRecord(boolean bDisplayOption)
    {
        m_iOriginalMessageTransportID = (int)this.getOwner().getField(MessageDetail.MESSAGE_TRANSPORT_ID).getValue();
        m_iOriginalDefaultMessageTransportID = (int)this.getOwner().getField(MessageDetail.DEFAULT_MESSAGE_TRANSPORT_ID).getValue();
        super.doValidRecord(bDisplayOption);
    }
196514
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    { // Read a valid record
        if (this.getOwner().getRecord().getField(m_iMainFilesFieldSeq) instanceof DateTimeField)
        {
            DateTimeField thisField = ((DateTimeField)this.getOwner().getRecord().getField(m_iMainFilesFieldSeq));
            double dDate = 0;
            if (m_bMoveCurrentTime)
                dDate = DateField.currentTime();
            else
                dDate = DateField.todaysDate();
            int iErrorCode = thisField.setValue(dDate, bDisplayOption, iMoveMode);        // File written or updated, set the update date
            if (iMoveMode == DBConstants.INIT_MOVE)
                thisField.setModified(false);   // Don't make this record modified just because I set this field.
            return iErrorCode;
        }
        return DBConstants.NORMAL_RETURN;
    }
1031656
public void setEditorDisplayOptions(CmsEditorDisplayOptions clazz) {

        m_editorDisplayOptions = clazz;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_EDITOR_DISPLAY_OPTS_1,
                    m_editorAction.getClass().getName()));
        }
    }
627539
void onDataSetLookupChanged(@Observes DataSetLookupChangedEvent event) {
        DataSetLookup dataSetLookup = event.getDataSetLookup();
        displayerSettings.setDataSet(null);
        displayerSettings.setDataSetLookup(dataSetLookup);
        removeStaleSettings();
        initDisplayer();
        initSettingsEditor();
        showDisplayer();
    }
1259207
public void setDisplayerSetting( DisplayerAttributeDef displayerAttributeDef, String value ) {
        settings.put(getSettingPath(displayerAttributeDef), value);
    }
785023
public int moveIt(boolean bDisplayOption, int iMoveMode)
    {
        if (m_convCheckMark != null) if (m_convCheckMark.getState() == false)
            return DBConstants.NORMAL_RETURN;       // If check mark is false (or no check mark), don't move
        return super.moveIt(bDisplayOption, iMoveMode);
    }
1348914
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        int iErrorCode = DBConstants.NORMAL_RETURN;
        Record record = this.getOwner().getRecord();
        if (record != null)
        {
            try   {
                Object varBookmark = null;
                if (record.getEditMode() == DBConstants.EDIT_IN_PROGRESS)
                { // Update the record
                    if (m_bRefreshAfterWrite)
                        varBookmark = record.getHandle(DBConstants.DATA_SOURCE_HANDLE);
                    record.set();
                }
                else if (record.getEditMode() == DBConstants.EDIT_ADD)
                {
                    record.add();
                    if (m_bRefreshAfterWrite)
                        varBookmark = record.getLastModified(DBConstants.DATA_SOURCE_HANDLE);
                }
                if (varBookmark != null)
                {
                    record.setHandle(varBookmark, DBConstants.DATA_SOURCE_HANDLE);
                    record.edit();
                }
            } catch (DBException ex)    {
                ex.printStackTrace();
                iErrorCode = ex.getErrorCode();
            }
        }
        return iErrorCode;
    }
709997
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        if (m_screenField == null)
            this.lookupSField();
        if (m_bChangeIfNull != null)
        {
            if ((m_bChangeIfNull.booleanValue()) && (!this.getOwner().isNull()))
                return DBConstants.NORMAL_RETURN;
            if ((!m_bChangeIfNull.booleanValue()) && (this.getOwner().isNull()))
                return DBConstants.NORMAL_RETURN;
        }
        if (m_screenField != null)
            m_screenField.requestFocus();
        return DBConstants.NORMAL_RETURN;
    }
1227658
public int setState(boolean bState, boolean bDisplayOption, int iMoveMode)
    {
        int iFieldValue = (int)this.getValue();
        if (!m_bTrueIfMatch)
            bState = !bState; // Do opposite operation
        if (bState)
            iFieldValue |= (1 << m_iBitNumber);     // Set the bit
        else
            iFieldValue &= ~(1 << m_iBitNumber);    // Clear the bit
        return this.setValue(iFieldValue, bDisplayOption, iMoveMode);
    }
858669
public void doNewRecord(boolean bDisplayOption)
    {
        super.doNewRecord(bDisplayOption);
        if (this.getOwner().isOpen())   // Don't do first time!
        {
            String strUserID = ((BaseApplication)this.getOwner().getRecordOwner().getTask().getApplication()).getUserID();
            int iUserID = -1;
            if ((strUserID != null) && (strUserID.length() > 0))
                iUserID = Integer.parseInt(strUserID);
            this.getOwner().getField(UserInfo.ID).setValue(iUserID);
            String strOldKey = this.getOwner().getKeyName();
            try   {
                this.getOwner().setKeyArea(UserInfo.ID_KEY);
                if (!this.getOwner().seek("="))
                {
                    this.getOwner().addNew(); // Make a new one
                }
            } catch (DBException ex)    {
                ex.printStackTrace();
            } finally   {
                this.getOwner().setKeyArea(strOldKey);
            }
        }
    }
568561
public boolean surveyDates(boolean bDisplayOption)
    {
        if (m_recDetail == null)
        {
            RecordOwner recordOwner = this.getRecordOwner();
            m_recDetail = new ProjectTask(recordOwner);
            if (recordOwner != null)
                recordOwner.removeRecord(m_recDetail);
            m_recDetail.addListener(new SubFileFilter(this, true));
        }
        Date startDate = null;
        Date endDate = null;
        try {
            m_recDetail.close();
            while (m_recDetail.hasNext())
            {
                m_recDetail.next();
                Date thisStartDate = null;
                if (!m_recDetail.getField(ProjectTask.START_DATE_TIME).isNull())
                    thisStartDate = ((DateTimeField)m_recDetail.getField(ProjectTask.START_DATE_TIME)).getDateTime();
                if (thisStartDate != null)
                    if ((startDate == null)
                        || (thisStartDate.before(startDate)))
                            startDate = thisStartDate;
                Date thisEndDate = null;
                if (!m_recDetail.getField(ProjectTask.END_DATE_TIME).isNull())
                    thisEndDate = ((DateTimeField)m_recDetail.getField(ProjectTask.END_DATE_TIME)).getDateTime();
                if (thisEndDate != null)
                    if ((endDate == null)
                        || (thisEndDate.after(endDate)))
                            endDate = thisEndDate;
            }
            this.getListener(UpdateChildrenHandler.class).setEnabledListener(false);
            this.edit();
            int iMoveMode = DBConstants.SCREEN_MOVE;
            if (startDate != null)
                ((DateTimeField)this.getField(ProjectTask.START_DATE_TIME)).setDateTime(startDate, bDisplayOption, iMoveMode);
            if (endDate != null)
                ((DateTimeField)this.getField(ProjectTask.END_DATE_TIME)).setDateTime(endDate, bDisplayOption, iMoveMode);
            boolean bHasChildren = true;
            if ((startDate == null) && (endDate == null))
                bHasChildren = false;
            this.getField(ProjectTask.HAS_CHILDREN).setState(bHasChildren);
            if (this.isModified())
            {
                Object bookmark = this.getHandle(DBConstants.BOOKMARK_HANDLE);
                this.set();
                this.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
                return true;    // Record updated
            }
        } catch (DBException ex) {
            ex.printStackTrace();
        } finally {
            this.getListener(UpdateChildrenHandler.class).setEnabledListener(true);
        }
        return false;   // No update required
    }
552141
@Override
    protected void onRangeChanged(HasData<RecordList.Record> display) {

        // Get the new range required.
        range = display.getVisibleRange();
        //if it is the last page don't load more results
        if(display.getRowCount()%range.getLength()!= 0 && display.getRowCount() > 0 && range.getStart() > previousRange.getStart()){
            display.setVisibleRange(previousRange.getStart(), previousRange.getLength());
        }

        updateResults(range.getStart(), range.getLength());
        previousRange = range;
    }
30669
public void initRecord(boolean bDisplay) throws DBException
    {
        int iFieldCount = this.getFieldCount();      // Number of fields to read in
        for (int iFieldSeq = Constants.MAIN_FIELD; iFieldSeq < iFieldCount + Constants.MAIN_FIELD; iFieldSeq++)
        {
            FieldInfo field = this.getField(iFieldSeq);
            field.initField(bDisplay);
        }
        this.setEditMode(Constants.EDIT_NONE);
    }
87949
public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode)
    {
        char chFirst = 'N';
        if (strParamValue != null) if (strParamValue.length() > 0)
            chFirst = strParamValue.charAt(0);
        boolean bState = false;
        if ((chFirst == 'T') || (chFirst == 'Y')) // True/Yes
            bState = true;
        return this.getConverter().setState(bState, bDisplayOption, iMoveMode);
    }
309089
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
    { // Read a valid record
        int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption);      // Initialize the record
        if (iErrorCode == DBConstants.NORMAL_RETURN)
        {
            if (iChangeType == DBConstants.AFTER_ADD_TYPE)
            {
                Object bookmark = this.getOwner().getLastModified(m_iHandleType);
                if (bookmark != null)
                    this.addBookmarkFilter(bookmark);
            }
            if (iChangeType == DBConstants.AFTER_REQUERY_TYPE)
            {
                String strKeyName = null;
                Object objKeyData = null;
                if (this.getOwner().getDefaultOrder() > 0)
                {
                    strKeyName = this.getOwner().getKeyArea().getKeyName();
                    KeyField keyField = this.getOwner().getKeyArea().getKeyField(0);
                    BaseField fldKey = keyField.getField(DBConstants.FILE_KEY_AREA);
                    if (fldKey instanceof ReferenceField)
                    {
                        if (!keyField.getField(DBConstants.END_SELECT_KEY).isNull())
                            if (keyField.getField(DBConstants.END_SELECT_KEY).equals(keyField.getField(DBConstants.START_SELECT_KEY)))
                            {
                                fldKey = keyField.getField(DBConstants.START_SELECT_KEY);   // On a requery this should be the key
                                objKeyData = fldKey.getData();
                            }
                    }
                }
                this.clearBookmarkFilters(strKeyName, objKeyData);
            }
        }
        return iErrorCode;
    }
577562
@Override
    protected void onRangeChanged(HasData<RecordList.Record> display) {
        // Get the new range required.
        range = display.getVisibleRange();
        updateResults(range.getStart(), range.getLength());
    }
333498
public int setState(boolean state, boolean bDisplayOption, int iMoveMode)
    {       // Must be overidden
        if (this.getNextConverter() != null)
            return this.getNextConverter().setState(state, bDisplayOption, iMoveMode);
        else
            return super.setState(state, bDisplayOption, iMoveMode);
    }