AddMasterListeners Method.
12532
public void addMasterListeners()
    {
        super.addMasterListeners();
        this.getField(UserInfo.USER_NAME).addListener(new CheckNonNumericListener(null));
        this.addListener(new ReadOnlyRecordHandler(this.getField(UserInfo.READ_ONLY_RECORD), true));
        this.addListener(new FileListener(null)
        {
            /**
             * Make sure the user group ID is non-null (set it to the anon group id)
             */
            public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
            { // Read a valid record
                switch (iChangeType)
                {
                    case DBConstants.ADD_TYPE:
                    case DBConstants.UPDATE_TYPE:
                        if (this.getOwner().getField(UserInfo.USER_GROUP_ID).isNull())
                            if (this.getOwner().getRecordOwner() != null)
                        {
                            Record recUserControl = (Record)this.getOwner().getRecordOwner().getRecord(UserControl.USER_CONTROL_FILE);
                            if (recUserControl == null)
                            {
                                recUserControl = new UserControl(this.getOwner().getRecordOwner());
                                this.getOwner().addListener(new FreeOnFreeHandler(recUserControl));
                            }
                            this.getOwner().getField(UserInfo.USER_GROUP_ID).moveFieldToThis(recUserControl.getField(UserControl.ANON_USER_GROUP_ID));
                        }
                        break;
                }
                return super.doRecordChange(field, iChangeType, bDisplayOption);        // Initialize the record
            }
            
        });
    }
381162
public void addListeners()
    {
        super.addListeners();
        
        this.getField(Person.NAME).removeListener(this.getField(Person.NAME).getListener(CopyLastHandler.class), true);    // Only if dest is null (ie., company name is null)
        this.getField(Person.NAME).addListener(new CopyFieldHandler(this.getField(Person.NAME_SORT)));
        this.getField(Company.NAME_SORT).addListener(new CheckForTheHandler(null));
        
        CopyLastHandler listener = new CopyLastHandler(this.getField(Company.NAME_SORT));
        this.getField(Company.CONTACT).addListener(listener);    // Only if dest is null (ie., company name is null)
        listener.setOnlyIfDestNull(true);
    }
970991
function Master() {
  EventEmitter.call(this);

  if (config.workerMessageHandler) {
    this.workerMessageHandler = require(config.workerMessageHandler);
  }

  if (!_.isFunction(this.workerMessageHandler)) {
    this.workerMessageHandler = function () {};
  }

  this.workerMessageHandler.bind(this);
}
181695
public void addListeners()
    {
        super.addListeners();
        
        if (this.isContactDisplay())
        {
            ReferenceField field = (ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_INFO_TYPE_ID);
            field.setValue(field.getReferenceRecord(this).getIDFromCode(MessageInfoType.REQUEST));
            field = (ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TYPE_ID);
            field.setValue(field.getReferenceRecord(this).getIDFromCode(MessageType.MESSAGE_OUT));
            field = (ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_STATUS_ID);
            field.setValue(field.getReferenceRecord(this).getIDFromCode(MessageStatus.SENT));
        }
        
        this.getMainRecord().getKeyArea().setKeyOrder(DBConstants.DESCENDING);
        
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.REFERENCE_ID), this.getScreenRecord().getField(MessageLogScreenRecord.REFERENCE_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.REFERENCE_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.REFERENCE_TYPE), this.getScreenRecord().getField(MessageLogScreenRecord.REFERENCE_TYPE), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.REFERENCE_TYPE).addListener(new FieldReSelectHandler(this));
        
        this.getScreenRecord().getField(MessageLogScreenRecord.CONTACT_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_INFO_TYPE_ID), this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_INFO_TYPE_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_INFO_TYPE_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_TYPE_ID), this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TYPE_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TYPE_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_STATUS_ID), this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_STATUS_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_STATUS_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_TRANSPORT_ID), this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TRANSPORT_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TRANSPORT_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.USER_ID), this.getScreenRecord().getField(MessageLogScreenRecord.USER_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.USER_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_TIME), this.getScreenRecord().getField(MessageLogScreenRecord.START_DATE), CompareFileFilter.GREATER_THAN_EQUAL, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.START_DATE).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_TIME), this.getScreenRecord().getField(MessageLogScreenRecord.END_DATE), CompareFileFilter.LESS_THAN_EQUAL, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.END_DATE).addListener(new FieldReSelectHandler(this));
        
        this.setEditing(false);
    }
383802
public void addListeners()
    {
        super.addListeners();
        this.getMainRecord().getField(Issue.PROJECT_ID).addListener(new InitFieldHandler(this.getRecord(IssueControl.ISSUE_CONTROL_FILE).getField(IssueControl.PROJECT_ID)));
        this.getMainRecord().getField(Issue.PROJECT_VERSION_ID).addListener(new InitFieldHandler(this.getRecord(IssueControl.ISSUE_CONTROL_FILE).getField(IssueControl.PROJECT_VERSION_ID)));
        this.getMainRecord().getField(Issue.ISSUE_TYPE_ID).addListener(new InitFieldHandler(this.getRecord(IssueControl.ISSUE_CONTROL_FILE).getField(IssueControl.ISSUE_TYPE_ID)));
        this.getMainRecord().getField(Issue.ISSUE_STATUS_ID).addListener(new InitFieldHandler(this.getRecord(IssueControl.ISSUE_CONTROL_FILE).getField(IssueControl.ISSUE_STATUS_ID)));
        this.getMainRecord().getField(Issue.ISSUE_PRIORITY_ID).addListener(new InitFieldHandler(this.getRecord(IssueControl.ISSUE_CONTROL_FILE).getField(IssueControl.ISSUE_PRIORITY_ID)));
    }
774048
public void addListeners()
    {
        super.addListeners();
        // This is all temporary. It will be much better to display the resources next to the EY for each record
        this.getScreenRecord().getField(ResourceScreenRecord.LANGUAGE).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(Registration.LANGUAGE, this.getScreenRecord().getField(ResourceScreenRecord.LANGUAGE), DBConstants.EQUALS, null, false));
        this.getMainRecord().getField(Registration.LANGUAGE).addListener(new InitFieldHandler(this.getScreenRecord().getField(ResourceScreenRecord.LANGUAGE)));
        this.getScreenRecord().getField(ResourceScreenRecord.LOCALE).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(Registration.LOCALE, this.getScreenRecord().getField(ResourceScreenRecord.LOCALE), DBConstants.EQUALS, null, false));
        this.getMainRecord().getField(Registration.LOCALE).addListener(new InitFieldHandler(this.getScreenRecord().getField(ResourceScreenRecord.LOCALE)));
        
        this.getMainRecord().getField(Registration.CODE).addListener(new InitFieldHandler(this.getHeaderRecord().getField(Resource.CODE)));
    }
836732
public void addListeners()
    {
        super.addListeners();
            // Link the screen field to the passed in record
        ((ReferenceField)this.getScreenRecord().getField(MessageInfoScreenRecord.MESSAGE_INFO_ID)).syncReference(this.getHeaderRecord());
        
        String strManualTransportID = Integer.toString(((ReferenceField)this.getMainRecord().getField(MessageProcessInfo.DEFAULT_MESSAGE_TRANSPORT_ID)).getIDFromCode(MessageTransport.MANUAL));
        this.getMainRecord().getField(MessageProcessInfo.DEFAULT_MESSAGE_TRANSPORT_ID).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(MessageProcessInfo.INITIAL_MESSAGE_STATUS_ID), strManualTransportID, false));
        Converter convCheckMark = new RadioConverter(this.getMainRecord().getField(MessageProcessInfo.DEFAULT_MESSAGE_TRANSPORT_ID), strManualTransportID, false);
        this.getMainRecord().getField(MessageProcessInfo.DEFAULT_MESSAGE_TRANSPORT_ID).addListener(new RemoveConverterOnFreeHandler(convCheckMark));
        this.getMainRecord().getField(MessageProcessInfo.DEFAULT_MESSAGE_TRANSPORT_ID).addListener(new CopyDataHandler(this.getMainRecord().getField(MessageProcessInfo.INITIAL_MESSAGE_STATUS_ID), null, convCheckMark));
    }
376908
public void addListeners()
    {
        super.addListeners();
        Record record = this.getMainRecord();
        Record recClassInfo = this.getRecord(ClassInfo.CLASS_INFO_FILE);
        if (recClassInfo != null)
        {
            record.setKeyArea(Issue.CLASS_INFO_ID_KEY);
            SubFileFilter listener = new SubFileFilter(recClassInfo.getField(ClassInfo.ID), Issue.CLASS_INFO_ID, null, null, null, null, true);
            record.addListener(listener);
            recClassInfo.getField(ClassInfo.ID).addListener(new FieldReSelectHandler(this));
        }
    }
1101334
public void addListeners()
    {
        super.addListeners();
        
        if (m_recHeader != null)
            this.getMainRecord().addListener(new ProjectTaskParentFilter(m_recHeader));
        
        this.setEditing(true);
        this.getMainRecord().addListener(new FileFilter(null)
        {
            public boolean doLocalCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
            {   // Between start and end dates? (Defaults to Currentdate thru +1 year)
                boolean bDontSkip = true;
                if (this.getOwner().getField(ProjectTask.START_DATE_TIME).isNull())
                    bDontSkip = false;
                if (bDontSkip)
                    return super.doLocalCriteria(strbFilter, bIncludeFileName, vParamList);    // Dont skip this record
                else
                    return false;   // Skip this one
            }
                });
    }
832980
private void deliverMasterChangedAnnouncement(final DeviceUpdate update) {
        for (final MasterListener listener : getMasterListeners()) {
            try {
                listener.masterChanged(update);
            } catch (Throwable t) {
                logger.warn("Problem delivering master changed announcement to listener", t);
            }
        }
    }
1237470
public void addListeners()
    {
        super.addListeners();
        Record record = this.getMainRecord();
        Record classInfo = this.getRecord(ClassInfo.CLASS_INFO_FILE);
        if (classInfo != null)
        {
            SubFileFilter listener = new SubFileFilter(classInfo.getField(ClassInfo.CLASS_NAME), ClassResource.CLASS_NAME, null, null, null, null, true);
            record.addListener(listener);
            classInfo.getField(ClassInfo.CLASS_NAME).addListener(new FieldReSelectHandler(this));
        }
    }
1350429
private void addListeners() {
	    this.min.xProperty().addListener((observable, oldValue, nValue) -> {
	        final double currentMin = nValue.doubleValue();
	        final double currentMax = getMaxX();
	        if (currentMax < currentMin) {
	            // min-max constrain is broken
	            maxXProperty().set(currentMin);
	        }
	    });
	    this.min.yProperty().addListener((observable, oValue, nValue) -> {
	        final double currentMin = nValue.doubleValue();
	        final double currentMax = getMaxY();
	        if (currentMax < currentMin) {
	            // min-max constrain is broken
	            maxYProperty().set(currentMin);
	        }
	    });
	    this.max.xProperty().addListener((observable, oValue, nValue) -> {
	        final double currentMax = nValue.doubleValue();
	        final double currentMin = getMinX();
	        if (currentMax < currentMin) {
	            // min-max constrain is broken
	            minXProperty().set(currentMax);
	        }
	    });
	    this.max.yProperty().addListener((observable, oValue, nValue) -> {
	        final double currentMax = nValue.doubleValue();
	        final double currentMin = getMinY();
	        if (currentMax < currentMin) {
	            // min-max constrain is broken
	            minYProperty().set(currentMax);
	        }
	    });
	}
485077
protected void addListeners() {
        Editable text = getText();
        if (text != null) {
            text.setSpan(spanWatcher, 0, text.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
            addTextChangedListener(textWatcher);
        }
    }
1036789
public void addListeners()
    {
        super.addListeners();
        this.getMainRecord().addListener(new MessageDetailDefTransHandler(null));
        String strManualTransportID = Integer.toString(((ReferenceField)this.getMainRecord().getField(MessageDetail.MESSAGE_TRANSPORT_ID)).getIDFromCode(MessageTransport.MANUAL));
        this.getMainRecord().getField(MessageDetail.MESSAGE_TRANSPORT_ID).setDefault(strManualTransportID);
    }
441696
public void addMasterListeners()
    {
        super.addMasterListeners();
        
        this.addListener(new SetUserIDHandler(ProjectTask.ENTERED_BY_USER_ID, true));
        this.addListener(new SetUserIDHandler(ProjectTask.CHANGED_BY_USER_ID, true));
        this.addListener(new DateChangedHandler(ProjectTask.CHANGED_DATE));
        
        FieldListener listener = null;
        this.getField(ProjectTask.END_DATE_TIME).addListener(listener = new InitDateOffsetHandler(this.getField(ProjectTask.DURATION), (DateTimeField)this.getField(ProjectTask.START_DATE_TIME)));
        listener.setRespondsToMode(DBConstants.READ_MOVE, true);
        
        this.getField(ProjectTask.END_DATE_TIME).addListener(listener = new ReComputeTimeOffsetHandler(ProjectTask.DURATION, (DateTimeField)this.getField(ProjectTask.START_DATE_TIME)));
        
        this.getField(ProjectTask.START_DATE_TIME).addListener(listener = new ReComputeEndDateHandler(ProjectTask.END_DATE_TIME, (NumberField)this.getField(ProjectTask.DURATION)));
        
        this.getField(ProjectTask.DURATION).addListener(listener = new ChangeOnChangeHandler(this.getField(ProjectTask.START_DATE_TIME)));
        listener.setRespondsToMode(DBConstants.INIT_MOVE, false);
        
        
        this.getField(ProjectTask.START_DATE_TIME).addListener(new InitFieldHandler((BaseField)null)
        {
            public int fieldChanged(boolean bDisplayOption, int iMoveMode)
            {
                if (!getField(ProjectTask.PARENT_PROJECT_TASK_ID).isNull())
                {
                    Record recParent = ((ReferenceField)getField(ProjectTask.PARENT_PROJECT_TASK_ID)).getReference();
                    if (recParent != null)
                        if ((recParent.getEditMode() == DBConstants.EDIT_IN_PROGRESS) || (recParent.getEditMode() == DBConstants.EDIT_CURRENT))
                        {
                            if (recParent.getField(ProjectTask.HAS_CHILDREN).getState() == true)
                                return this.getOwner().moveFieldToThis(recParent.getField(ProjectTask.END_DATE_TIME), bDisplayOption, iMoveMode);
                            else
                                return this.getOwner().moveFieldToThis(recParent.getField(ProjectTask.START_DATE_TIME), bDisplayOption, iMoveMode);
                        }
                }
                return super.fieldChanged(bDisplayOption, iMoveMode);
            }
        });
        
        this.addListener(new UpdateChildrenHandler(null));
        this.addListener(new UpdateDependenciesHandler(null));
        this.addListener(new SurveyDatesHandler(null));
        
        
        // todo (don) Move these to the server environment
        this.addListener(new SubFileIntegrityHandler(ProjectTask.class.getName(), true));
        
        this.addListener(new SubFileIntegrityHandler(ProjectTaskPredecessor.class.getName(), true));
        
        this.addListener(new SubFileIntegrityHandler(ProjectTaskPredecessor.class.getName(), true)
        {
            public Record getSubRecord()
            {
                if (m_recDependent == null)
                    m_recDependent = this.createSubRecord();
                if (m_recDependent != null)
                {
                    if (m_recDependent.getListener(SubFileFilter.class.getName()) == null)
                    {
                        m_recDependent.addListener(new SubFileFilter(getField(ProjectTask.ID), ProjectTaskPredecessor.PROJECT_TASK_ID, null, null, null, null));
                        m_recDependent.setKeyArea(ProjectTaskPredecessor.PROJECT_TASK_ID_KEY);
                    }
                }
                return m_recDependent;
            }
        });
    }
709511
public void addListeners()
    {
        super.addListeners();
        Record record = this.getMainRecord();
        Record recClassInfo = this.getRecord(ClassInfo.CLASS_INFO_FILE);
        if (recClassInfo != null)
        {
            record.setKeyArea(FieldData.FIELD_FILE_NAME_KEY);
            SubFileFilter listener = new SubFileFilter(recClassInfo.getField(ClassInfo.CLASS_NAME), FieldData.FIELD_FILE_NAME, null, null, null, null, true);
            record.addListener(listener);
        }
        MainFieldHandler fieldBeh = new MainFieldHandler(null);
        this.getMainRecord().getField(FieldData.FIELD_NAME).addListener(fieldBeh);
        this.getMainRecord().setKeyArea(FieldData.FIELD_FILE_NAME_KEY);
    }
241399
function addListener(event, callback, meta) {
  event.listeners.push(callback);
  event.meta.set(callback, meta);
}