本文整理了Java中org.jbundle.thin.base.db.FieldList
类的一些代码示例,展示了FieldList
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FieldList
类的具体详情如下:
包路径:org.jbundle.thin.base.db.FieldList
类名称:FieldList
[英]FieldList - Collection of field information. This is the thin version of a record.
[中]FieldList—字段信息的收集。这是记录的精简版本。
代码示例来源:origin: org.jbundle.thin.main/org.jbundle.thin.main
/**
* Get the table name.
*/
public String getTableNames(boolean bAddQuotes)
{
return (m_tableName == null) ? DatabaseInfo.DATABASE_INFO_FILE : super.getTableNames(bAddQuotes);
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Get the autosequence field if it exists.
* @return The counterfield or null.
*/
public FieldInfo getCounterField()
{
return this.getField(Constants.MAIN_FIELD);
}
/**
代码示例来源:origin: com.tourapp.thin/com.tourapp.thin.tour.product
/**
* Set up the key areas.
*/
public void setupKeys()
{
KeyAreaInfo keyArea = null;
super.setupKeys();
}
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* I'm done with the model, free the resources.
* Note: This does not free the associated record. it just nulls the reference.
* (although freeing the record will free this table).
*/
public void free()
{
if (m_record != null) // First, release the record for this table
{ // Do not free this.getFieldList() (may be current record)
m_record.setTable(null); // Don't try to free me
m_record.free();
m_record = null;
}
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Reset all the fields to their default value.
* <p />NOTE: After executing, this records edit mode is set to NONE.
* @param bDisplay The the new values (on work in the thick model).
* @throws Exception An exception on initing a field.
*/
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);
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
if ((this.getEditMode() == Constants.EDIT_CURRENT)
|| (this.getEditMode() == Constants.EDIT_IN_PROGRESS))
Object bookmark = this.getCounterField().getData();
if (bookmark != null)
int iOldOpenMode = this.getOpenMode();
this.setOpenMode(Constants.OPEN_REFRESH_TO_CURRENT | (iOldOpenMode/* & Constants.LOCK_TYPE_MASK*/)); // This is only trigger server listeners for changes
&& (this.isModified()))
boolean bLockRecord = this.getEditMode() == Constants.EDIT_IN_PROGRESS;
rgbModified = new boolean[this.getFieldCount()];
for (int iFieldSeq = 0; iFieldSeq < this.getFieldCount(); iFieldSeq++)
rgbModified[iFieldSeq] = this.getField(iFieldSeq).isModified();
String strOldKey = this.getKeyName();
this.setKeyName(Constants.PRIMARY_KEY);
this.getCounterField().setData(bookmark);
boolean bSuccess = this.getTable().seek(null);
this.setKeyName(strOldKey);
this.getTable().addNew();
else
this.getTable().edit(); // If I haven't changed any data, just refresh it.
buffer.resetPosition();
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Convert this record to a string.
* @return A string of all the fields.
*/
public String toString()
{
String string = Constants.BLANK;
for (int iFieldSeq = Constants.MAIN_FIELD; iFieldSeq <= this.getFieldCount() + Constants.MAIN_FIELD - 1; iFieldSeq++) {
FieldInfo field = this.getField(iFieldSeq);
string += field.toString() + '\n';
}
string += '\n';
return string;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed
/**
* Log this transaction.
* @param strTrxType The transaction type.
*/
public void logTrx(FieldList record, String strTrxType)
{
BaseBuffer buffer = this.getBuffer();
buffer.clearBuffer();
buffer.addHeader(strTrxType);
buffer.addHeader(record.getTableNames(false));
buffer.addHeader(record.getCounterField().toString());
if (ProxyConstants.REMOVE != strTrxType)
buffer.fieldsToBuffer(record);
Object objLogData = buffer.getPhysicalData();
this.logTrx(objLogData);
}
/**
代码示例来源:origin: com.tourgeek.thin.app/com.tourgeek.thin.app.booking
if ((strKeyValue != null) && (strKeyValue.length() > 0))
if ((recBooking.getEditMode() == Constants.EDIT_CURRENT) || (recBooking.getEditMode() == Constants.EDIT_IN_PROGRESS))
if (iBookingNo == recBooking.getField(Booking.ID).getValue())
return true; // Already read
if (strKeyValue.equalsIgnoreCase(recBooking.getField(Booking.CODE).toString()))
return true; // Already read
recBooking.getTable().addNew();
recBooking.getField(strKeyField).setString(strKeyValue);
String strOldKeyArea = recBooking.getKeyName();
recBooking.setKeyArea(strKeyField);
bSuccess = recBooking.getTable().seek(Constants.EQUALS);
recBooking.setKeyArea(strOldKeyArea);
if (bSuccess)
bSuccess = this.getTourRecord().getTable().seek(Constants.SEEK_CURRENT_RECORD);
if (bSuccess)
bSuccess = this.getCurrencyRecord().getTable().seek(Constants.SEEK_CURRENT_RECORD);
recBooking.getTable().addNew(); // Clean the booking record
this.getRemoteSession().doRemoteAction(Constants.RESET, null); // Tell the remote session that I'm done with this booking
this.getTourRecord().getTable().addNew(); // Clear tour record
bSuccess = true;
代码示例来源:origin: org.jbundle.thin.base.screen/org.jbundle.thin.base.screen.cal.grid
/**
* Constructor.
*/
public void init(FieldList record, String strStartDateTimeField, String strEndDateTimeField, String strDescriptionField, String strStatusField)
{
m_table = record.getTable();
m_strDescriptionField = strDescriptionField;
m_strStartDateTimeField = strStartDateTimeField;
m_strEndDateTimeField = strEndDateTimeField;
m_strStatusField = strStatusField;
}
/**
代码示例来源:origin: com.tourgeek.thin.app/com.tourgeek.thin.app.booking
/**
* Free.
*/
public void free()
{
if (this.getFieldList(MealPlan.MEAL_PLAN_FILE) != null)
{ // Since the meal plan popup record is shared, I need to free it then disconnect it from the controls.
this.getFieldList(MealPlan.MEAL_PLAN_FILE).free();
FieldList fieldList = this.getFieldList();
for (int iFieldSeq = 0; iFieldSeq < fieldList.getFieldCount(); iFieldSeq++)
{
FieldInfo field = fieldList.getField(iFieldSeq);
Component component = null;
int iIndex = 0;
while ((component = (Component)field.getComponent(iIndex)) != null)
{
if (component instanceof JRemoteComboBox)
if (((JRemoteComboBox)component).getRecord() == this.getFieldList(MealPlan.MEAL_PLAN_FILE))
((JRemoteComboBox)component).setRecord(null);
iIndex++; // Bump counter
}
}
this.removeFieldList(this.getFieldList(MealPlan.MEAL_PLAN_FILE));
}
super.free();
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
if (table.getRecord().getEditMode() == Constants.EDIT_ADD)
for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < table.getRecord().getKeyAreaCount() + Constants.MAIN_KEY_AREA; iKeyArea++)
FieldInfo field = table.getRecord().getCounterField();
if (field != null)
if (!field.isNull())
if (!table.getRecord().isAutoSequence())
this.getPKeyArea(iKeyArea).doWrite(table, table.getRecord().getKeyArea(iKeyArea), bufferNew);
} catch (DBException ex) {
if (ex.getErrorCode() == Constants.DUPLICATE_KEY)
this.getPKeyArea(iKeyArea).doRemove(table, table.getRecord().getKeyArea(iKeyArea), bufferNew);
iKeyArea--;
代码示例来源:origin: com.tourgeek.thin.app/com.tourgeek.thin.app.booking
/**
*
*/
private FieldList cloneFieldList(FieldList item)
{
FieldList fieldList = new FieldList(null);
for (int i = 0; i < item.getFieldCount(); i++)
{
FieldInfo fldSource = item.getField(i);
FieldInfo fldDest = new FieldInfo(fieldList, fldSource.getFieldName(), fldSource.getMaxLength(), fldSource.getFieldDesc(), fldSource.getDefault());
fldDest.setDataClass(fldSource.getDataClass());
}
return fieldList;
}
/**
代码示例来源:origin: com.tourgeek.thin.app/com.tourgeek.thin.app.booking
Integer intID = (Integer)recBooking.getField(strFieldName).getData();
recPricingType.getField("ID").setData(intID);
try {
if (recPricingType.getTable().seek(null))
int intPricingCodes = ((Integer)recPricingType.getField(PricingType.PRICING_CODES).getData()).intValue();
if ((intPricingCodes & PricingType.OPTION_PRICING) != 0)
return true;
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Set the counter to max + 1 again.
* Note: The position is undefined after this call (and the table is closed).
* @param table The table to fix the counter on.
*/
public synchronized void fixCounter(FieldTable table)
{
PKeyArea vKeyArea = this.getPKeyArea(Constants.MAIN_KEY_AREA);
KeyAreaInfo keyArea = table.getRecord().getKeyArea(Constants.MAIN_KEY_AREA);
try {
BaseBuffer buffer = vKeyArea.doMove(Constants.LAST_RECORD, table, keyArea);
if (buffer == null)
m_iCounter = table.getRecord().getStartingID();
else
{
buffer.bufferToFields(table.getRecord(), Constants.DONT_DISPLAY, Constants.READ_MOVE);
Object data = table.getRecord().getCounterField().getData();
if (data instanceof Integer)
m_iCounter = Math.max(m_iCounter, ((Integer)data).intValue() + 1);
}
// Now set the pointer back at the first record
buffer = vKeyArea.doMove(Constants.FIRST_RECORD, table, keyArea);
if (buffer != null) // If not at EOF (empty) back up one record
vKeyArea.doMove(Constants.PREVIOUS_RECORD, table, keyArea);
} catch (DBException ex) {
// Ignore error
}
}
/**
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Reposition to this record using this bookmark.
* @param bookmark The handle to use to position the record.
* @param iHandleType The type of handle (DATA_SOURCE/OBJECT_ID,OBJECT_SOURCE,BOOKMARK).
* @return - true - record found/false - record not found
* @exception FILE_NOT_OPEN.
* @exception DBException File exception.
*/
public boolean doSetHandle(Object bookmark, int iHandleType) throws DBException
{
String strCurrentOrder = this.getRecord().getKeyName();
this.getRecord().setKeyArea(Constants.PRIMARY_KEY);
this.getRecord().getCounterField().setData(bookmark);
boolean bSuccess = this.seek(Constants.EQUALS);
this.getRecord().setKeyArea(strCurrentOrder);
return bSuccess;
}
/**
代码示例来源:origin: org.jbundle.base/org.jbundle.base
/**
* Set the default key order.
* @param String strKeyName the current index.
* @return The new default key area (null if not found).
*/
public KeyArea getKeyArea(String strKeyName)
{
return (KeyArea)super.setKeyArea(strKeyName);
}
/**
代码示例来源:origin: com.tourgeek.thin.app/com.tourgeek.thin.app.booking
try {
FieldList recBooking = this.getFieldList();
if ((recBooking.getEditMode() == Constants.EDIT_NONE) || (recBooking.getEditMode() == Constants.EDIT_ADD))
recBooking.getTable().addNew();
return true;
if (JOptionPane.showConfirmDialog(ScreenUtil.getFrame(this), strMessage, strTitle, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION)
return false;
recBooking.getTable().addNew();
Object objSuccess = this.getRemoteSession().doRemoteAction(Constants.DELETE, null); // Tell the remote session that I'm done with this booking
if (objSuccess instanceof Boolean)
bSuccess = ((Boolean)objSuccess).booleanValue();
recBooking.getTable().addNew(); // Clear the booking record
this.getTourRecord().getTable().addNew(); // Clear tour record
bSuccess = true;
} catch (RemoteException ex) {
代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db
super.free(); // Free fields, free table.
代码示例来源:origin: org.jbundle.thin.base.db/org.jbundle.thin.base.db
/**
* Do a remote command.
* This method simplifies the task of calling a remote method.
* Instead of having to override the session, all you have to do is override
* doRemoteCommand in your record and handleRemoteCommand will call the remote version of the record.
* @param strCommand
* @param properties
* @return
*/
public Object handleRemoteCommand(String strCommand, Map<String, Object> properties, boolean bWriteAndRefresh, boolean bDontCallIfLocal, boolean bCloneServerRecord)
throws DBException, RemoteException
{
RemoteTarget remoteTask = this.getTable().getRemoteTableType(org.jbundle.model.Remote.class);
if (remoteTask == null)
{
if (bDontCallIfLocal)
return Boolean.FALSE;
else
return this.doRemoteCommand(strCommand, properties);
}
return remoteTask.doRemoteAction(strCommand, properties);
}
/**
内容来源于网络,如有侵权,请联系作者删除!