/** * Override this to add your tool buttons. */ public void setupStartSFields() { new SCannedBox(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.BACK); } /**
/** * Initialize class fields. */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties) { super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**
/** * Process the command. */ public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) { Record record = null; if (m_fldAgencyOrPax != null) if (m_fldAgencyOrPax.getString().equalsIgnoreCase("P")) { record = m_record; m_record = m_PaPax; } boolean bFlag = super.doCommand(strCommand, sourceSField, iCommandOptions); if (record != null) m_record = record; return bFlag; }
/** * Add the navigation button(s) to the left of the grid row. */ public void addNavButtons() { SCannedBox box = new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.FORM, MenuConstants.FORMLINK, null); box.setRequestFocusEnabled(false); if ((m_iDisplayFieldDesc & ScreenConstants.SELECT_MODE) == ScreenConstants.SELECT_MODE) new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.SELECT, MenuConstants.SELECT, null); } /**
/** * Set up all the screen fields. */ public void setupSFields() { this.setScreenRecord(this.getMainRecord()); this.getRecord(BankReconScreenRecord.BANK_RECON_SCREEN_RECORD_FILE).getField(BankReconScreenRecord.START_CLEARED).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BankReconScreenRecord.BANK_RECON_SCREEN_RECORD_FILE).getField(BankReconScreenRecord.DEPOSITS_CLEARED).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BankReconScreenRecord.BANK_RECON_SCREEN_RECORD_FILE).getField(BankReconScreenRecord.CHECKS_CLEARED).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BankReconScreenRecord.BANK_RECON_SCREEN_RECORD_FILE).getField(BankReconScreenRecord.NEW_CLEARED).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.setEnabled(false); SCannedBox box = new SCannedBox(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, MenuConstants.POST, MenuConstants.POST, MenuConstants.POST, null); box.setEnabled(true); box.setRequestFocusEnabled(true); } /**
if (strCommand.equalsIgnoreCase(this.getButtonCommand())) if (sourceSField == this) strCommand = this.getProperties(strCommand, properties); if (this.getRecord() != null) if (this.getRecord().getRecordOwner() != null) task = this.getRecord().getRecordOwner().getTask(); GridScreen screen = (GridScreen)this.getRecord().makeScreen(null, parentScreen, ScreenConstants.SELECT_MODE, true, true, true, true, properties); if (this.getRecord().getRecordOwner() == null) screen.setSelectQuery(this.getRecord(), false); // Since this record isn't linked to the screen, manually link it. if (this.getRecord() != null) if (this.getRecord().getEditMode() == Constants.EDIT_IN_PROGRESS) this.getRecord().set(); if (this.getRecord().getEditMode() == Constants.EDIT_ADD) this.getRecord().add(); this.getRootScreen().displayError(e); this.getRecord().next(); this.getRootScreen().displayError(e); this.getRecord().makeScreen(null, parentScreen, ScreenConstants.MAINT_MODE, true, true, true, true, properties); this.getRecord().makeScreen(null, parentScreen, ScreenConstants.MAINT_MODE, true, true, true, true, properties);
String strCommand = button.getButtonCommand(); if (strCommand.equalsIgnoreCase(MenuConstants.BACK))
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); for (int i = 0; ;i++) { ScreenField sField = (ScreenField)this.getRecord(TransactionType.TRANSACTION_TYPE_FILE).getField(TransactionType.SOURCE_TRX_STATUS_ID).getComponent(i); if (sField == null) break; if (sField instanceof SCannedBox) { String strCommand = Utility.addURLParam(null, DBParams.COMMAND, ((SCannedBox)sField).getButtonCommand()); BaseField field = this.getRecord(TransactionType.TRANSACTION_TYPE_FILE).getField(TransactionType.TRX_DESC_ID); strCommand = Utility.addURLParam(strCommand, field.getFieldName(), field.toString()); field = this.getRecord(TransactionType.TRANSACTION_TYPE_FILE).getField(TransactionType.TRX_SYSTEM_ID); strCommand = Utility.addURLParam(strCommand, field.getFieldName(), field.toString()); ((SCannedBox)sField).setButtonCommand(strCommand); } } Record recTrxStatus = ((ReferenceField)this.getMainRecord().getField(TransactionType.SOURCE_TRX_STATUS_ID)).getReferenceRecord(this); this.getMainRecord().getField(TransactionType.SOURCE_TRX_STATUS_ID).addListener(new MoveOnChangeHandler(this.getMainRecord().getField(TransactionType.SOURCE_PREFERRED_SIGN), recTrxStatus.getField(TrxStatus.PREFERRED_SIGN))); this.getMainRecord().getField(TransactionType.SOURCE_TRX_STATUS_ID).addListener(new MoveOnChangeHandler(this.getMainRecord().getField(TransactionType.SOURCE_TRX_DESC_ID), recTrxStatus.getField(TrxStatus.TRX_DESC_ID))); } /**
/** * Set up all the screen fields. */ public void setupSFields() { Converter fieldConverter = this.getRecord(UserScreenRecord.kUserScreenRecordFile).getField(UserScreenRecord.kStatusLine); new SStaticText(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, fieldConverter, ScreenConstants.DONT_DISPLAY_FIELD_DESC); this.getRecord(UserScreenRecord.kUserScreenRecordFile).getField(UserScreenRecord.kuser).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); Converter converter = new HashSHAConverter(this.getRecord(UserScreenRecord.kUserScreenRecordFile).getField(UserScreenRecord.kpassword)); converter = new FieldLengthConverter(converter, 20); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(UserScreenRecord.kUserScreenRecordFile).getField(UserScreenRecord.ksaveuser).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); SCannedBox loginButton = new SCannedBox(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.LOGIN); loginButton.setRequestFocusEnabled(true); BaseApplication application = (BaseApplication)this.getTask().getApplication(); String strDesc = application.getResources(ResourceConstants.MAIN_RESOURCE, true).getString(UserEntryScreen.CREATE_NEW_USER); String strCommand = Utility.addURLParam(null, DBParams.SCREEN, UserEntryScreen.class.getName()); new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.DONT_SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, strDesc, MenuConstants.FORM, strCommand, MenuConstants.FORM + "Tip"); this.setDefaultButton(loginButton); } /**
if (strCommand.equalsIgnoreCase(this.getButtonCommand())) if (sourceSField == this) strCommand = this.getProperties(strCommand, properties); if (this.getRecord() != null) if (this.getRecord().getRecordOwner() != null) task = this.getRecord().getRecordOwner().getTask(); if (task == null) task = BaseApplet.getSharedInstance(); GridScreen screen = (GridScreen)this.getRecord().makeScreen(null, parentScreen, ScreenConstants.SELECT_MODE, true, true, true, true, properties); if (this.getRecord().getScreen() == null) screen.setSelectQuery(this.getRecord(), false); // Since this record isn't linked to the screen, manually link it. if (this.getRecord() != null) if (this.getRecord().getEditMode() == Constants.EDIT_IN_PROGRESS) this.getRecord().set(); if (this.getRecord().getEditMode() == Constants.EDIT_ADD) this.getRecord().add(); this.getRootScreen().displayError(e); this.getRecord().next(); this.getRootScreen().displayError(e); this.getRecord().makeScreen(null, parentScreen, ScreenConstants.MAINT_MODE, true, true, true, true, properties);
if (sField instanceof SCannedBox) String strCommand = ((SCannedBox)sField).getButtonCommand(); if ((Product.INVENTORY_DETAIL.equals(strCommand)) || (Product.PRICING_DETAIL.equals(strCommand)))
if (sField instanceof SCannedBox) String strCommand = Utility.addURLParam(null, DBParams.COMMAND, ((SCannedBox)sField).getButtonCommand()); BaseField field = this.getRecord(TransactionType.TRANSACTION_TYPE_FILE).getField(TransactionType.TRX_DESC_ID); BaseField fldSrc = field; field = this.getRecord(TransactionType.TRANSACTION_TYPE_FILE).getField(TransactionType.TRX_SYSTEM_ID); strCommand = Utility.addURLParam(strCommand, field.getFieldName(), field.toString()); ((SCannedBox)sField).setButtonCommand(strCommand);
/** * Override this to add your tool buttons. */ public void setupEndSFields() { new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.HELP); } /**
/** * Set up all the screen fields. */ public void setupSFields() { super.setupSFields(); Converter converter = new HashSHAConverter(this.getRecord(UserScreenRecord.kUserScreenRecordFile).getField(UserScreenRecord.kCurrentPassword)); converter = new FieldLengthConverter(converter, 20); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); converter = new HashSHAConverter(this.getRecord(UserScreenRecord.kUserScreenRecordFile).getField(UserScreenRecord.kNewPassword1)); converter = new FieldLengthConverter(converter, 20, 6); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); converter = new HashSHAConverter(this.getRecord(UserScreenRecord.kUserScreenRecordFile).getField(UserScreenRecord.kNewPassword2)); converter = new FieldLengthConverter(converter, 20, 6); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); SCannedBox submitButton = new SCannedBox(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.SUBMIT); submitButton.setRequestFocusEnabled(true); } /**
/** * Initialize class fields. */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties) { super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**
/** * Process the command. */ public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) { Record record = null; if (m_fldAgencyOrPax != null) if (m_fldAgencyOrPax.getString().equalsIgnoreCase("P")) { record = m_record; m_record = m_PaPax; } boolean bFlag = super.doCommand(strCommand, sourceSField, iCommandOptions); if (record != null) m_record = record; return bFlag; }
if (sField instanceof SCannedBox) String strCommand = ((SCannedBox)sField).getButtonCommand(); if (Hotel.MEAL_DETAIL.equals(strCommand)) this.getRecord(Hotel.HOTEL_FILE).addListener(new EnableOnValidHandler(sField, true, false));
/** * Controls for a report screen. */ public void setupMiddleSFields() { new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.DISPLAY); new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.PRINT); } }
String strMessage = application.getResources(ResourceConstants.ERROR_RESOURCE, true).getString(strDisplay); new SStaticString(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, strMessage); new SCannedBox(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.BACK); new MenuToolbar(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC); this.resizeToContent(strDisplay); converter = new FieldLengthConverter(converter, 20); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, ScreenConstants.DISPLAY_DESC); SCannedBox loginBox = new SCannedBox(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.LOGIN); loginBox.setRequestFocusEnabled(true); strDesc = application.getResources(ResourceConstants.MAIN_RESOURCE, true).getString("Create new account"); String strCommand = Utility.addURLParam(null, DBParams.SCREEN, UserEntryScreen.class.getName()); new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.DONT_SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, strDesc, MenuConstants.FORM, strCommand, MenuConstants.FORM + DBConstants.TIP); this.setDefaultButton(loginBox); ((BaseField)converter.getField()).addListener(new FieldListener(null)
/** * Initialize class fields. */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties) { super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**