本文整理了Java中org.jbundle.base.db.Record.setEnableListeners
方法的一些代码示例,展示了Record.setEnableListeners
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.setEnableListeners
方法的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record
方法名:setEnableListeners
[英]Get the current status (enabled/disabled) for all the listeners.
[中]获取所有侦听器的当前状态(已启用/已禁用)。
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Add this record (Always called from the record class).
* @exception DBException File exception.
*/
public void add(Rec fieldList) throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.ADD_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.add(fieldList);
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_ADD_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Update this record (Always called from the record class).
* @exception DBException File exception.
*/
public void set(Rec fieldList) throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.UPDATE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.set(fieldList);
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_UPDATE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Update this record (Always called from the record class).
* @exception DBException File exception.
*/
public void set(Rec fieldList) throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.UPDATE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.set(fieldList);
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_UPDATE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Update this record (Always called from the record class).
* @exception DBException File exception.
*/
public void set(Rec fieldList) throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.UPDATE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.set(fieldList);
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_UPDATE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Delete this record (Always called from the record class).
* Always override this method.
* @exception DBException File exception.
*/
public void remove() throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.DELETE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.remove();
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_DELETE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Add this record (Always called from the record class).
* @exception DBException File exception.
*/
public void add(Rec fieldList) throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.ADD_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.add(fieldList);
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_ADD_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Add this record (Always called from the record class).
* @exception DBException File exception.
*/
public void add(Rec fieldList) throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.ADD_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.add(fieldList);
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_ADD_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Delete this record (Always called from the record class).
* Always override this method.
* @exception DBException File exception.
*/
public void remove() throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.DELETE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.remove();
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_DELETE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Delete this record (Always called from the record class).
* Always override this method.
* @exception DBException File exception.
*/
public void remove() throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.DELETE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
super.remove();
this.syncCurrentToBase();
rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.AFTER_DELETE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListeners(rgbListenerState);
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Enable or disable all the behaviors.
* @param record The target record.
* @param bEnableRecordBehaviors Enable/disable all the record behaviors.
* @param bEnableFieldBehaviors Enable/disable all the field behaviors.
*/
public static void enableAllBehaviors(Record record, boolean bEnableRecordBehaviors, boolean bEnableFieldBehaviors)
{
if (record == null)
return;
record.setEnableListeners(bEnableRecordBehaviors); // Disable all file behaviors
for (int iFieldSeq = 0; iFieldSeq < record.getFieldCount(); iFieldSeq++)
{
BaseField field = record.getField(iFieldSeq);
field.setEnableListeners(bEnableFieldBehaviors);
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Enable or disable all the behaviors.
* @param record The target record.
* @param bEnableRecordBehaviors Enable/disable all the record behaviors.
* @param bEnableFieldBehaviors Enable/disable all the field behaviors.
*/
public static void enableAllBehaviors(Record record, boolean bEnableRecordBehaviors, boolean bEnableFieldBehaviors)
{
if (record == null)
return;
record.setEnableListeners(bEnableRecordBehaviors); // Disable all file behaviors
for (int iFieldSeq = 0; iFieldSeq < record.getFieldCount(); iFieldSeq++)
{
BaseField field = record.getField(iFieldSeq);
field.setEnableListeners(bEnableFieldBehaviors);
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Enable or disable all the behaviors.
* @param record The target record.
* @param bEnableRecordBehaviors Enable/disable all the record behaviors.
* @param bEnableFieldBehaviors Enable/disable all the field behaviors.
*/
public static void enableAllBehaviors(Record record, boolean bEnableRecordBehaviors, boolean bEnableFieldBehaviors)
{
if (record == null)
return;
record.setEnableListeners(bEnableRecordBehaviors); // Disable all file behaviors
for (int iFieldSeq = 0; iFieldSeq < record.getFieldCount(); iFieldSeq++)
{
BaseField field = record.getField(iFieldSeq);
field.setEnableListeners(bEnableFieldBehaviors);
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Run Method.
*/
public void run()
{
String strID = this.getProperty(DBParams.ID);
if ((strID != null) && (strID.length() > 0))
{
Record recCalendarEntry = this.getMainRecord();
recCalendarEntry.getCounterField().setString(strID);
try {
if (recCalendarEntry.seek(null))
{
recCalendarEntry.edit();
boolean[] rgbEnabled = recCalendarEntry.setEnableListeners(false); // I need to do this since a change in properties will reschedule the jobs.
((PropertiesField)recCalendarEntry.getField(CalendarEntry.kProperties)).setProperty(TASK_COMPLETED, DBConstants.TRUE);
recCalendarEntry.setEnableListeners(rgbEnabled);
recCalendarEntry.set();
}
} catch (DBException ex) {
ex.printStackTrace();
}
}
}
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Update this record (Always called from the record class).
* @param record The record to add.
* @exception DBException File exception.
*/
public void doSet(Record record) throws DBException
{
record = this.moveRecordToBase(record);
int iOpenMode = record.getOpenMode();
RecordChangedHandler recordChangeListener = (RecordChangedHandler)record.getListener(RecordChangedHandler.class);
Object[] rgobjEnabledFields = record.setEnableFieldListeners(false);
boolean[] rgbEnabled = record.setEnableListeners(false);
if (recordChangeListener != null)
recordChangeListener.setEnabledListener(true); // I will need this listener to do the update =ID AND =LastChangeDate
try {
//x record.setOpenMode(0); // Normal set
this.getNextTable().set(record);
} catch (DBException ex) {
throw ex;
} finally {
record.setOpenMode(iOpenMode);
record.setEnableListeners(rgbEnabled);
record.setEnableFieldListeners(rgobjEnabledFields);
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Update this record (Always called from the record class).
* @param record The record to add.
* @exception DBException File exception.
*/
public void doSet(Record record) throws DBException
{
record = this.moveRecordToBase(record);
int iOpenMode = record.getOpenMode();
RecordChangedHandler recordChangeListener = (RecordChangedHandler)record.getListener(RecordChangedHandler.class);
Object[] rgobjEnabledFields = record.setEnableFieldListeners(false);
boolean[] rgbEnabled = record.setEnableListeners(false);
if (recordChangeListener != null)
recordChangeListener.setEnabledListener(true); // I will need this listener to do the update =ID AND =LastChangeDate
try {
//x record.setOpenMode(0); // Normal set
this.getNextTable().set(record);
} catch (DBException ex) {
throw ex;
} finally {
record.setOpenMode(iOpenMode);
record.setEnableListeners(rgbEnabled);
record.setEnableFieldListeners(rgobjEnabledFields);
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Update this record (Always called from the record class).
* @param record The record to add.
* @exception DBException File exception.
*/
public void doSet(Record record) throws DBException
{
record = this.moveRecordToBase(record);
int iOpenMode = record.getOpenMode();
RecordChangedHandler recordChangeListener = (RecordChangedHandler)record.getListener(RecordChangedHandler.class);
Object[] rgobjEnabledFields = record.setEnableFieldListeners(false);
boolean[] rgbEnabled = record.setEnableListeners(false);
if (recordChangeListener != null)
recordChangeListener.setEnabledListener(true); // I will need this listener to do the update =ID AND =LastChangeDate
try {
//x record.setOpenMode(0); // Normal set
this.getNextTable().set(record);
} catch (DBException ex) {
throw ex;
} finally {
record.setOpenMode(iOpenMode);
record.setEnableListeners(rgbEnabled);
record.setEnableFieldListeners(rgobjEnabledFields);
}
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Add this record (Always called from the record class).
* Make the remote add call with the current data.
* @param record The record to add.
* @exception DBException File exception.
*/
public void doAdd(Record record) throws DBException
{
record = this.moveRecordToBase(record);
int iOpenMode = record.getOpenMode();
RecordChangedHandler recordChangeListener = (RecordChangedHandler)record.getListener(RecordChangedHandler.class);
Object[] rgobjEnabledFields = record.setEnableFieldListeners(false);
boolean[] rgbEnabled = record.setEnableListeners(false);
if (recordChangeListener != null)
recordChangeListener.setEnabledListener(true); // I may need this listener (for an update) to do the update =ID AND =LastChangeDate
try {
record.setOpenMode(0); // Normal add
this.getNextTable().add(record);
} catch (DBException ex) {
throw ex;
} finally {
record.setOpenMode(iOpenMode);
record.setEnableListeners(rgbEnabled);
record.setEnableFieldListeners(rgobjEnabledFields);
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Add this record (Always called from the record class).
* Make the remote add call with the current data.
* @param record The record to add.
* @exception DBException File exception.
*/
public void doAdd(Record record) throws DBException
{
record = this.moveRecordToBase(record);
int iOpenMode = record.getOpenMode();
RecordChangedHandler recordChangeListener = (RecordChangedHandler)record.getListener(RecordChangedHandler.class);
Object[] rgobjEnabledFields = record.setEnableFieldListeners(false);
boolean[] rgbEnabled = record.setEnableListeners(false);
if (recordChangeListener != null)
recordChangeListener.setEnabledListener(true); // I may need this listener (for an update) to do the update =ID AND =LastChangeDate
try {
record.setOpenMode(0); // Normal add
this.getNextTable().add(record);
} catch (DBException ex) {
throw ex;
} finally {
record.setOpenMode(iOpenMode);
record.setEnableListeners(rgbEnabled);
record.setEnableFieldListeners(rgobjEnabledFields);
}
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Called when a new blank record is required for the table/query.
* @param bDisplayOption If true, display any changes.
*/
public void doNewRecord(boolean bDisplayOption)
{
UserInfo userTemplate = this.getUserTemplate();
if (userTemplate != null)
{
Record userInfo = this.getOwner();
boolean[] fileListenerStates = userInfo.setEnableListeners(false);
Object[] fieldListenerStates = userInfo.setEnableFieldListeners(false);
userInfo.moveFields(userTemplate, null, bDisplayOption, DBConstants.INIT_MOVE, false, false, false);
userInfo.getField(UserInfo.kID).initField(bDisplayOption);
userInfo.getField(UserInfo.kFirstName).initField(bDisplayOption);
userInfo.getField(UserInfo.kLastName).initField(bDisplayOption);
userInfo.getField(UserInfo.kUserName).initField(bDisplayOption);
userInfo.getField(UserInfo.kPassword).initField(bDisplayOption);
userInfo.getField(UserInfo.kID).setModified(false);
userInfo.getField(UserInfo.kFirstName).setModified(false);
userInfo.getField(UserInfo.kLastName).setModified(false);
userInfo.getField(UserInfo.kUserName).setModified(false);
userInfo.getField(UserInfo.kPassword).setModified(false);
userInfo.setEnableListeners(fileListenerStates);
userInfo.setEnableFieldListeners(fieldListenerStates);
}
super.doNewRecord(bDisplayOption);
}
/**
代码示例来源:origin: org.jbundle.main/org.jbundle.main.db
/**
* Called when a new blank record is required for the table/query.
* @param bDisplayOption If true, display any changes.
*/
public void doNewRecord(boolean bDisplayOption)
{
UserInfo userTemplate = this.getUserTemplate();
if (userTemplate != null)
{
Record userInfo = this.getOwner();
boolean[] fileListenerStates = userInfo.setEnableListeners(false);
Object[] fieldListenerStates = userInfo.setEnableFieldListeners(false);
userInfo.moveFields(userTemplate, null, bDisplayOption, DBConstants.INIT_MOVE, false, false, false, false);
userInfo.getField(UserInfo.ID).initField(bDisplayOption);
userInfo.getField(UserInfo.FIRST_NAME).initField(bDisplayOption);
userInfo.getField(UserInfo.LAST_NAME).initField(bDisplayOption);
userInfo.getField(UserInfo.USER_NAME).initField(bDisplayOption);
userInfo.getField(UserInfo.PASSWORD).initField(bDisplayOption);
userInfo.getField(UserInfo.ID).setModified(false);
userInfo.getField(UserInfo.FIRST_NAME).setModified(false);
userInfo.getField(UserInfo.LAST_NAME).setModified(false);
userInfo.getField(UserInfo.USER_NAME).setModified(false);
userInfo.getField(UserInfo.PASSWORD).setModified(false);
userInfo.setEnableListeners(fileListenerStates);
userInfo.setEnableFieldListeners(fieldListenerStates);
}
super.doNewRecord(bDisplayOption);
}
/**
内容来源于网络,如有侵权,请联系作者删除!