本文整理了Java中org.jbundle.base.db.Record.isModified
方法的一些代码示例,展示了Record.isModified
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.isModified
方法的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record
方法名:isModified
[英]Have any fields Changed?
[中]字段有变化吗?
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Have any fields Changed?
* @return true if any fields have changed.
*/
public boolean isModified()
{
return this.isModified(false);
}
/**
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* Have any fields Changed?
* @return true if any fields have changed.
*/
public boolean isModified()
{
return this.isModified(false);
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Have any fields Changed?
* @return true if any fields have changed.
*/
public boolean isModified()
{
return this.isModified(false);
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Process the command.
* <br />Step 1 - Process the command if possible and return true if processed.
* <br />Step 2 - If I can't process, pass to all children (with me as the source).
* <br />Step 3 - If children didn't process, pass to parent (with me as the source).
* <br />Note: Never pass to a parent or child that matches the source (to avoid an endless loop).
* @param strCommand The command to process.
* @param sourceSField The source screen field (to avoid echos).
* @param iCommandOptions If this command creates a new screen, create in a new window?
* @return true if success.
*/
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
boolean bLogin = false;
if (MenuConstants.SUBMIT.equalsIgnoreCase(strCommand))
if (this.getMainRecord().isModified())
bLogin = true;
boolean bFlag = super.doCommand(strCommand, sourceSField, iCommandOptions);
if (MenuConstants.SUBMIT.equalsIgnoreCase(strCommand))
if (bFlag)
if (bLogin)
return super.doCommand(MenuConstants.HOME, sourceSField, iCommandOptions);
return bFlag;
}
/**
代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.acctpay.screen
if (!record.isModified())
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
/**
* free this listener and update/add the target record.
*/
public int writeAndRefresh()
{
try {
if (m_recordToUpdate != null)
if (m_recordToUpdate.isModified(true))
{
if (m_bRefreshAfterUpdate)
m_recordToUpdate.writeAndRefresh();
else
{
if (m_recordToUpdate.getEditMode() == Constants.EDIT_IN_PROGRESS)
m_recordToUpdate.set();
else if (m_recordToUpdate.getEditMode() == Constants.EDIT_ADD)
m_recordToUpdate.add();
}
}
} catch(DBException ex) {
ex.printStackTrace();
}
return DBConstants.NORMAL_RETURN; // For now
}
/**
代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.request.misc
/**
* Same as onAdd, but don't clear the record, so I can redisplay it.
*/
public boolean onAdd()
{
Record record = this.getMainRecord();
try
{
if (record.isModified(false))
{
if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
record.set();
else if (record.getEditMode() == Constants.EDIT_ADD)
record.add();
}
//x record.addNew();
}
catch(DBException e)
{
this.displayError(e);
}
return true;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* free this listener and update/add the target record.
*/
public int writeAndRefresh()
{
try {
if (m_recordToUpdate != null)
if (m_recordToUpdate.isModified(true))
{
if (m_bRefreshAfterUpdate)
m_recordToUpdate.writeAndRefresh();
else
{
if (m_recordToUpdate.getEditMode() == Constants.EDIT_IN_PROGRESS)
m_recordToUpdate.set();
else if (m_recordToUpdate.getEditMode() == Constants.EDIT_ADD)
m_recordToUpdate.add();
}
}
} catch(DBException ex) {
ex.printStackTrace();
}
return DBConstants.NORMAL_RETURN; // For now
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
if (recUserInfo != null)
if (recUserInfo.isModified(false))
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* free this listener and update/add the target record.
*/
public int writeAndRefresh()
{
try {
if (m_recordToUpdate != null)
if (m_recordToUpdate.isModified(true))
{
if (m_bRefreshAfterUpdate)
m_recordToUpdate.writeAndRefresh();
else
{
if (m_recordToUpdate.getEditMode() == Constants.EDIT_IN_PROGRESS)
m_recordToUpdate.set();
else if (m_recordToUpdate.getEditMode() == Constants.EDIT_ADD)
m_recordToUpdate.add();
}
}
if (fieldToUpdate != null)
{
fieldToUpdate.setModified(true);
//?result = fieldToUpdate.getRecord().handleRecordChange(m_fldTarget, DBConstants.FIELD_CHANGED_TYPE, bDisplayOption); // Tell table that I'm getting changed (if not locked)
}
} catch(DBException ex) {
ex.printStackTrace();
}
return DBConstants.NORMAL_RETURN; // For now
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
if (recordCurrent.isModified())
代码示例来源:origin: org.jbundle.base.screen/org.jbundle.base.screen.model
/**
* Process the "Add" toolbar command.
* @return true If command was handled
*/
public boolean onAdd()
{
Record record = this.getMainRecord();
if (record == null)
return false;
try {
if (record.isModified(false))
{
if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
record.set();
else if (record.getEditMode() == Constants.EDIT_ADD)
record.add();
}
record.addNew();
this.clearStatusText();
} catch(DBException ex) {
this.displayError(ex);
return false;
}
return true;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
if (recUserInfo != null)
if (recUserInfo.isModified(false))
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Process the "Add" toolbar command.
* @return true If command was handled
*/
public boolean onAdd()
{
Record record = this.getMainRecord();
if (record == null)
return false;
try {
if (record.isModified(false))
{
if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
record.set();
else if (record.getEditMode() == Constants.EDIT_ADD)
record.add();
}
record.addNew();
this.clearStatusText();
} catch(DBException ex) {
this.displayError(ex);
return false;
}
return true;
}
/**
代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.booking.db
/**
* Get the product type of this detail record.
* This is used to fill in the virtual ProductType field in BookingDetail.
*/
public Object doGetData()
{
String strDesc = DBConstants.BLANK;
Record recBookingDetail = (BookingSub)this.getOwner().getRecord();
Record recProductType = ((ReferenceField)recBookingDetail.getField(BookingDetail.PRODUCT_TYPE_ID)).getReference();
if ((recProductType == null)
|| (recProductType.getEditMode() == DBConstants.EDIT_ADD)
|| (recProductType.getEditMode() == DBConstants.EDIT_NONE))
{
strDesc = recBookingDetail.getRecordName();
if (strDesc.indexOf(Booking.BOOKING_FILE) == 0)
strDesc = strDesc.substring(Booking.BOOKING_FILE.length());
}
else
strDesc = recProductType.getField(ProductType.DESCRIPTION).toString();
if (this.getOwner().getRecord().isModified())
this.getOwner().setData(strDesc);
else
{ // Make sure you don't trigger any field or file changes by setting this here
boolean[] listenersState = this.getOwner().setEnableListeners(false);
this.getOwner().setData(strDesc, Constants.DISPLAY, Constants.INIT_MOVE);
this.getOwner().setModified(false);
this.getOwner().setEnableListeners(listenersState);
}
return super.doGetData();
}
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
break;
case DBConstants.UPDATE_TYPE:
if (this.getOwner().isModified(true))
代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.booking.db
/**
* Get the product type of this detail record.
* This is used to fill in the virtual ProductType field in BookingDetail.
*/
public Object doGetData()
{
String strDesc = DBConstants.BLANK;
Record recBookingDetail = (BookingSub)this.getOwner().getRecord();
Record recProductType = ((ReferenceField)recBookingDetail.getField(BookingDetail.PRODUCT_TYPE_ID)).getReference();
if ((recProductType == null)
|| (recProductType.getEditMode() == DBConstants.EDIT_ADD)
|| (recProductType.getEditMode() == DBConstants.EDIT_NONE))
{
strDesc = recBookingDetail.getRecordName();
if (strDesc.indexOf(Booking.BOOKING_FILE) == 0)
strDesc = strDesc.substring(Booking.BOOKING_FILE.length());
}
else
strDesc = recProductType.getField(ProductType.DESCRIPTION).toString();
if (this.getOwner().getRecord().isModified())
this.getOwner().setData(strDesc);
else
{ // Make sure you don't trigger any field or file changes by setting this here
boolean[] listenersState = this.getOwner().setEnableListeners(false);
this.getOwner().setData(strDesc, Constants.DISPLAY, Constants.INIT_MOVE);
this.getOwner().setModified(false);
this.getOwner().setEnableListeners(listenersState);
}
return super.doGetData();
}
代码示例来源: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
{
Record recBase = this.getBaseRecord();
Record recCurrent = this.getCurrentRecord();
if (fieldList != recBase)
{
if (fieldList != recCurrent)
throw new DBException("Can't change record class then add");
}
else
{
if (recBase != recCurrent)
if (recCurrent.isModified())
this.copyRecordInfo(recBase, recCurrent, false, true);
fieldList = this.moveToCurrentRecord((Record)fieldList);
}
if (fieldList != recBase)
{
this.getBaseRecord().matchListeners(this.getCurrentRecord(), false, true, true, true, true); // Clone the listeners that are not there already.
fieldList.getTable().set(fieldList);
}
else
super.set(fieldList); // Never (hopefully)
// Note, since target record is passed, add listeners are called on the correct record
}
/**
代码示例来源: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
{
Record recBase = this.getBaseRecord();
Record recCurrent = this.getCurrentRecord();
if (fieldList != recBase)
{
if (fieldList != recCurrent)
throw new DBException("Can't change record class then add");
}
else
{
if (recBase != recCurrent)
if (recCurrent.isModified())
this.copyRecordInfo(recBase, recCurrent, false, true);
fieldList = this.moveToCurrentRecord((Record)fieldList);
}
if (fieldList != recBase)
{
this.getBaseRecord().matchListeners(this.getCurrentRecord(), false, true, true, true, true); // Clone the listeners that are not there already.
fieldList.getTable().set(fieldList);
}
else
super.set(fieldList); // Never (hopefully)
// Note, since target record is passed, add listeners are called on the correct record
}
/**
代码示例来源: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
{
Record recBase = this.getBaseRecord();
Record recCurrent = this.getCurrentRecord();
if (fieldList != recBase)
{
if (fieldList != recCurrent)
throw new DBException("Can't change record class then add");
}
else
{
if (recBase != recCurrent)
if (recCurrent.isModified())
this.copyRecordInfo(recBase, recCurrent, false, true);
fieldList = this.moveToCurrentRecord((Record)fieldList);
}
if (fieldList != recBase)
{
this.getBaseRecord().matchListeners(this.getCurrentRecord(), false, true, true, true, true); // Clone the listeners that are not there already.
fieldList.getTable().set(fieldList);
}
else
super.set(fieldList); // Never (hopefully)
// Note, since target record is passed, add listeners are called on the correct record
}
/**
内容来源于网络,如有侵权,请联系作者删除!