/** * Process the "Display" toolbar command. * @return true if successful. */ public boolean onDisplay() { BasePanel parent = this.getParentScreen(); if (parent == null) return false; return true; // Handled } /**
/** * Process the "Display" toolbar command. * @return true if successful. */ public boolean onDisplay() { BasePanel parent = this.getParentScreen(); if (parent == null) return false; return true; // Handled } /**
/** * Get the environment to use for this record owner. * @return Record owner's environment, or null to use the default enviroment. */ public Task getTask() { if (this.getParentScreen() != null) return this.getParentScreen().getTask(); return null; // Never } /**
/** * Get the environment to use for this record owner. * @return Record owner's environment, or null to use the default enviroment. */ public Task getTask() { if (this.getParentScreen() != null) return this.getParentScreen().getTask(); return null; // Never } /**
/** * Get the top applet screen. * @return The applet screen. */ public AppletScreen getAppletScreen() { // The root window is the ChildScreen if (this.getParentScreen() != null) return getParentScreen().getAppletScreen(); else return null; // This is the top level screen! } /**
/** * Get the top applet screen. * @return The applet screen. */ public AppletScreen getAppletScreen() { // The root window is the ChildScreen if (this.getParentScreen() != null) return getParentScreen().getAppletScreen(); else return null; // This is the top level screen! } /**
/** * Get the top level screen. * @return The top level screen. */ public BasePanel getRootScreen() { if (this.getParentScreen() != null) return super.getRootScreen(); else return (BasePanel)this; // This is the top level screen! } /**
/** * Get the top level screen. * @return The top level screen. */ public BasePanel getRootScreen() { if (this.getParentScreen() != null) return super.getRootScreen(); else return (BasePanel)this; // This is the top level screen! } /**
/** * Initialize. * @param itsLocation The location of this component within the parent. * @param parentScreen The parent screen. * @param fieldConverter The field this screen field is linked to. * @param iDisplayFieldDesc Do I display the field desc? */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc) { m_resources = null; BasePanel myParentScreen = parentScreen; while ((!(myParentScreen instanceof AppletScreen)) && (myParentScreen != null)) myParentScreen = myParentScreen.getParentScreen(); // Always add toolbars to AppletScreen if (myParentScreen == null) myParentScreen = parentScreen; // Only in HTML screens super.init(itsLocation, myParentScreen, fieldConverter, iDisplayFieldDesc); } /**
/** * Initialize. * @param itsLocation The location of this component within the parent. * @param parentScreen The parent screen. * @param fieldConverter The field this screen field is linked to. * @param iDisplayFieldDesc Do I display the field desc? */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String, Object> properties) { m_resources = null; BasePanel myParentScreen = parentScreen; while ((!(myParentScreen instanceof AppletScreen)) && (myParentScreen != null)) myParentScreen = myParentScreen.getParentScreen(); // Always add toolbars to AppletScreen if (myParentScreen == null) myParentScreen = parentScreen; // Only in HTML screens super.init(itsLocation, myParentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**
/** * 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); } } }
BasePanel parent = this.getParentScreen(); if (parent == null) return null;
/** * 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 } /**
/** * 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 } /**
/** * 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 } /**
/** * 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 } /**
/** * Set up m_iScreenSeq so I can find this sub-screen. * @param subScreen The current sub-screen. */ public void setCurrentSubScreen(BasePanel subScreen) { m_screenParent = null; // Screen's parent m_iScreenSeq = -1; if (subScreen != null) m_screenParent = subScreen.getParentScreen(); // Screen's parent if (m_screenParent == null) if (this.getOwner() != null) if (this.getOwner().getRecord() != null) m_screenParent = (BaseScreen)this.getOwner().getRecord().getRecordOwner(); if (m_screenParent == null) if (this.getOwner() != null) if (this.getOwner().getSFieldAt(0) != null) m_screenParent = this.getOwner().getSFieldAt(0).getParentScreen(); if (m_screenParent == null) return; int iBestGuess = -1; for (m_iScreenSeq = 0; m_iScreenSeq < m_screenParent.getSFieldCount(); m_iScreenSeq++) { ScreenField sField = m_screenParent.getSField(m_iScreenSeq); if (sField == subScreen) return; // Found (m_iScreenSeq is correct) if (sField instanceof BaseScreen) iBestGuess = m_iScreenSeq; } m_iScreenSeq = iBestGuess; } public void setCurrentScreenNo(int iCurrentScreenNo)
/** * Set up m_iScreenSeq so I can find this sub-screen. * @param subScreen The current sub-screen. */ public void setCurrentSubScreen(BasePanel subScreen) { m_screenParent = null; // Screen's parent m_iScreenSeq = -1; if (subScreen != null) m_screenParent = subScreen.getParentScreen(); // Screen's parent if (m_screenParent == null) if (this.getOwner() != null) if (this.getOwner().getRecord() != null) m_screenParent = (BaseScreen)this.getOwner().getRecord().getRecordOwner(); if (m_screenParent == null) if (this.getOwner() != null) if (this.getOwner().getSFieldAt(0) != null) m_screenParent = this.getOwner().getSFieldAt(0).getParentScreen(); if (m_screenParent == null) return; int iBestGuess = -1; for (m_iScreenSeq = 0; m_iScreenSeq < m_screenParent.getSFieldCount(); m_iScreenSeq++) { ScreenField sField = m_screenParent.getSField(m_iScreenSeq); if (sField == subScreen) return; // Found (m_iScreenSeq is correct) if (sField instanceof BaseScreen) iBestGuess = m_iScreenSeq; } m_iScreenSeq = iBestGuess; } public void setCurrentScreenNo(int iCurrentScreenNo)
/** * Set up m_iScreenSeq so I can find this sub-screen. * @param subScreen The current sub-screen. */ public void setCurrentSubScreen(BasePanel subScreen) { m_screenParent = null; // Screen's parent m_iScreenSeq = -1; if (subScreen != null) m_screenParent = subScreen.getParentScreen(); // Screen's parent if (m_screenParent == null) if (this.getOwner() != null) if (this.getOwner().getRecord() != null) m_screenParent = (BaseScreen)this.getOwner().getRecord().getRecordOwner(); if (m_screenParent == null) if (this.getOwner() != null) if (this.getOwner().getComponent(0) instanceof ScreenField) m_screenParent = ((ScreenField)this.getOwner().getComponent(0)).getParentScreen(); if (m_screenParent == null) return; int iBestGuess = -1; for (m_iScreenSeq = 0; m_iScreenSeq < m_screenParent.getSFieldCount(); m_iScreenSeq++) { ScreenField sField = m_screenParent.getSField(m_iScreenSeq); if (sField == subScreen) return; // Found (m_iScreenSeq is correct) if (sField instanceof BaseScreen) iBestGuess = m_iScreenSeq; } m_iScreenSeq = iBestGuess; } public void setCurrentScreenNo(int iCurrentScreenNo)