/** * Pop a command off the history stack. * @return The command at the top of the history stack or null if empty. */ public String popHistory() { return this.popHistory(1, true); } /**
/** * Process the "Home" command. * @return true if successful. */ public boolean onHome() { if (!(this instanceof BaseScreen)) return false; // This can only be called from the main screen BasePanel screenParent = this.getParentScreen(); int count = 0; while (screenParent.popHistory(1, false) != null) { // Pop all the history. count++; } count--; // Want to move back to the first one if (count > 0) screenParent.popHistory(count, true); // Dump all browser history String strLastCommand = Utility.addURLParam(null, DBParams.MENU, DBConstants.BLANK); //"?menu="; // Blank command = home this.handleCommand(strLastCommand, this, ScreenConstants.USE_SAME_WINDOW | ScreenConstants.DONT_PUSH_TO_BROSWER); // Process the last command in this window return true; // Handled } /**
/** * Process the "Home" command. * @return true if successful. */ public boolean onHome() { if (!(this instanceof BaseScreen)) return false; // This can only be called from the main screen BasePanel screenParent = this.getParentScreen(); int count = 0; while (screenParent.popHistory(1, false) != null) { // Pop all the history. count++; } count--; // Want to move back to the first one if (count > 0) screenParent.popHistory(count, true); // Dump all browser history String strLastCommand = Utility.addURLParam(null, Params.MENU, Constant.BLANK); //"?menu="; // Blank command = home this.handleCommand(strLastCommand, this, ScreenConstants.USE_SAME_WINDOW | ScreenConstants.DONT_PUSH_TO_BROWSER); // Process the last command in this window return true; // Handled } /**
this.getParentScreen().popHistory(1, false); this.getParentScreen().pushHistory(strCommand, false);
/** * Process the "Back" toolbar command. * @return true if successful. */ public boolean onBack() { BasePanel parent = this.getParentScreen(); if (parent == null) return false; parent.popHistory(1, false); // Pop command for this screen String strLastCommand = parent.popHistory(1, false); if (strLastCommand != null) // I don't back up into the browser history if the user hit the java back button. { // If that wasn't the first screen, redo pop and update the browser this time parent.pushHistory(strLastCommand, false); strLastCommand = parent.popHistory(1, true); } if ((strLastCommand == null) || (strLastCommand.length() == 0)) { if (parent.getParentScreen() != null) if (!(parent.getParentScreen() instanceof FrameScreen)) return parent.onBack(); // ++Add++ No more to pop, display home screen (if push-down gets messed up) parent.pushHistory(this.getScreenURL(), false); // This is the first screen in the stack } else this.handleCommand(strLastCommand, this, ScreenConstants.USE_SAME_WINDOW | ScreenConstants.DONT_PUSH_TO_BROSWER); // Process the last command return true; // Handled } /**
this.getParentScreen().popHistory(1, false); this.getParentScreen().pushHistory(strCommand, false);
this.getParentScreen().popHistory(1, false); this.getParentScreen().pushHistory(strCommand, false);
/** * Process the "Back" toolbar command. * @return true if successful. */ public boolean onBack() { BasePanel parent = this.getParentScreen(); if (parent == null) return false; parent.popHistory(1, false); // Pop command for this screen String strLastCommand = parent.popHistory(1, false); if (strLastCommand != null) // I don't back up into the browser history if the user hit the java back button. { // If that wasn't the first screen, redo pop and update the browser this time parent.pushHistory(strLastCommand, false); strLastCommand = parent.popHistory(1, true); } if ((strLastCommand == null) || (strLastCommand.length() == 0)) { if (parent.getParentScreen() != null) if (!(parent.getParentScreen() instanceof FrameScreen)) return parent.onBack(); // ++Add++ No more to pop, display home screen (if push-down gets messed up) parent.pushHistory(this.getScreenURL(), false); // This is the first screen in the stack } else this.handleCommand(strLastCommand, this, ScreenConstants.USE_SAME_WINDOW | ScreenConstants.DONT_PUSH_TO_BROWSER); // Process the last command return true; // Handled } /**
this.getParentScreen().popHistory(1, false); this.getParentScreen().pushHistory(strCommand, false);
this.getParentScreen().popHistory(1, false); this.getParentScreen().pushHistory(strCommand, false);
/** * 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) { if ((MenuConstants.FORM.equalsIgnoreCase(strCommand)) || (MenuConstants.FORMLINK.equalsIgnoreCase(strCommand))) { // Add the header field to this screen, so on return the same sub records will display BasePanel parentScreen = this.getParentScreen(); if (parentScreen != null) { parentScreen.popHistory(1, false); parentScreen.pushHistory(this.getScreenURL(), false); // Push this screen onto history stack } } if (strCommand.equalsIgnoreCase(Product.PRICING_DETAIL)) return (this.onForm(null, Product.PRICING_GRID_SCREEN, true, iCommandOptions, null) != null); else if (strCommand.equalsIgnoreCase(Product.INVENTORY_DETAIL)) return (this.onForm(null, Product.INVENTORY_GRID_SCREEN, true, iCommandOptions, null) != null); else return super.doCommand(strCommand, sourceSField, iCommandOptions); }
/** * 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) { if ((MenuConstants.FORM.equalsIgnoreCase(strCommand)) || (MenuConstants.FORMLINK.equalsIgnoreCase(strCommand))) { // Add the header field to this screen, so on return the same sub records will display BasePanel parentScreen = this.getParentScreen(); if (parentScreen != null) { parentScreen.popHistory(1, false); parentScreen.pushHistory(this.getScreenURL(), false); // Push this screen onto history stack } } if (strCommand.equalsIgnoreCase(Product.PRICING_DETAIL)) return (this.onForm(null, Product.PRICING_GRID_SCREEN, true, iCommandOptions, null) != null); else if (strCommand.equalsIgnoreCase(Product.INVENTORY_DETAIL)) return (this.onForm(null, Product.INVENTORY_GRID_SCREEN, true, iCommandOptions, null) != null); else return super.doCommand(strCommand, sourceSField, iCommandOptions); }
/** * Save the current value of this field to the registration database. * and change the URL on the push-down stack to take this into consideration. */ public void saveValue(BasePanel recordOwner) { if (recordOwner != null) { BaseField field = this.getOwner(); String strCommand = ((BasePanel)recordOwner).getParentScreen().popHistory(1, false); if (m_recordOwnerCache != null) if (strCommand != null) if (strCommand.indexOf(m_recordOwnerCache.getClass().getName()) != -1) { // Yes this is the command to open this window Map<String,Object> properties = new Hashtable<String,Object>(); Util.parseArgs(properties, strCommand); properties.put(field.getFieldName(), field.toString()); strCommand = Utility.propertiesToURL(null, properties); } ((BasePanel)recordOwner).getParentScreen().pushHistory(strCommand, false); } } }
/** * Save the current value of this field to the registration database. * and change the URL on the push-down stack to take this into consideration. */ public void saveValue(BasePanel recordOwner) { if (recordOwner != null) { BaseField field = this.getOwner(); String strCommand = ((BasePanel)recordOwner).getParentScreen().popHistory(1, false); if (m_recordOwnerCache != null) if (strCommand != null) if (strCommand.indexOf(m_recordOwnerCache.getClass().getName()) != -1) { // Yes this is the command to open this window Map<String,Object> properties = new Hashtable<String,Object>(); Util.parseArgs(properties, strCommand); properties.put(field.getFieldName(), field.toString()); strCommand = Utility.propertiesToURL(null, properties); } ((BasePanel)recordOwner).getParentScreen().pushHistory(strCommand, false); } } }
/** * 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) { if ((strCommand.equalsIgnoreCase(MenuConstants.FORM)) || (strCommand.equalsIgnoreCase(MenuConstants.FORMLINK))) { BasePanel parentScreen = this.getParentScreen(); if (parentScreen != null) { parentScreen.popHistory(1, false); parentScreen.pushHistory(this.getScreenURL(), false); // Push this screen onto history stack } return (this.onForm(null, ArTrx.CR_DR_SCREEN, true, iCommandOptions, null) != null); } else return super.doCommand(strCommand, sourceSField, iCommandOptions); }
/** * 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) { if ((strCommand.equalsIgnoreCase(MenuConstants.FORM)) || (strCommand.equalsIgnoreCase(MenuConstants.FORMLINK))) { BasePanel parentScreen = this.getParentScreen(); if (parentScreen != null) { parentScreen.popHistory(1, false); parentScreen.pushHistory(this.getScreenURL(), false); // Push this screen onto history stack } return (this.onForm(null, ArTrx.REFUND_SCREEN, true, iCommandOptions, null) != null); } else return super.doCommand(strCommand, sourceSField, iCommandOptions); }
/** * 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) { if (strCommand.equalsIgnoreCase(MenuConstants.POST)) { String strScreen = ArcReportPost.class.getName(); strCommand = this.getScreenURL(); strCommand = this.addScreenParams(this, strCommand); this.getParentScreen().popHistory(1, false); this.getParentScreen().pushHistory(strCommand, false); // Repush this command with the current values strCommand = Utility.addURLParam(null, DBParams.SCREEN, strScreen); strCommand = this.addScreenParams(this, strCommand); } return super.doCommand(strCommand, sourceSField, iCommandOptions); }
/** * Display the "Logon" screen. * @return true if successful. */ public boolean onLogon() { BasePanel parentScreen = this.getParentScreen(); ScreenLocation itsLocation = this.getScreenLocation(); parentScreen.popHistory(1, false); parentScreen.pushHistory(this.getScreenURL(), false); // Update the history to my current state. this.finalizeThisScreen(); // Validate current control, update record, get ready to close screen. Converter fieldConverter = null; int iDisplayFieldDesc = 0; Map<String,Object> properties = null; this.free(); new UserLoginScreen(null, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); return true; } /**
/** * FieldChanged Method. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { BaseField field = this.getOwner(); int iScreenNo = (int)field.getValue(); Record screenRecord = field.getRecord(); BaseScreen screen = (BaseScreen)screenRecord.getRecordOwner(); BasePanel parentScreen = screen.getParentScreen(); boolean bUseSameWindow = true; ScreenLocation itsLocation = screen.getScreenLocation(); screen.removeRecord(screenRecord); screen.free(); // Remove this screen parentScreen.popHistory(1, false); // Don't go back this.getSubScreen(screenRecord, itsLocation, parentScreen, null, iScreenNo); return super.fieldChanged(bDisplayOption, iMoveMode); } /**
/** * Display the "Logon" screen. * @return true if successful. */ public boolean onLogon() { Record record = Record.makeRecordFromClassName(UserInfoModel.THICK_CLASS, this); this.removeRecord(record); BasePanel parentScreen = this.getParentScreen(); ScreenLocation itsLocation = this.getScreenLocation(); parentScreen.popHistory(1, false); parentScreen.pushHistory(this.getScreenURL(), false); // Update the history to my current state. this.finalizeThisScreen(); // Validate current control, update record, get ready to close screen. Map<String,Object> properties = null; this.free(); int docMode = record.commandToDocType(UserInfoModel.LOGIN_SCREEN); record.makeScreen(itsLocation, parentScreen, docMode, properties); return true; } /**