/** * 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 iUseSameWindow If this command creates a new screen, create in a new window? * @return true if success. */ public boolean handleCommand(String strCommand, ScreenField sourceSField, int iUseSameWindow) { boolean bHandled = false; if (!(this instanceof BasePanel)) // BasePanel already called doCommand. bHandled = this.doCommand(strCommand, sourceSField, iUseSameWindow); // Do I handle it? if (bHandled == false) if (this.getParentScreen() != null) if (this.getParentScreen() != sourceSField) return this.getParentScreen().handleCommand(strCommand, this, iUseSameWindow); // Send it up to see if the parent wants to handle it return bHandled; } /**
/** * 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 iUseSameWindow If this command creates a new screen, create in a new window? * @return true if success. */ public boolean handleCommand(String strCommand, ScreenField sourceSField, int iUseSameWindow) { boolean bHandled = false; if (!(this instanceof BasePanel)) // BasePanel already called doCommand. bHandled = this.doCommand(strCommand, sourceSField, iUseSameWindow); // Do I handle it? if (bHandled == false) if (this.getParentScreen() != null) if (this.getParentScreen() != sourceSField) return this.getParentScreen().handleCommand(strCommand, this, iUseSameWindow); // Send it up to see if the parent wants to handle it return bHandled; } /**
boolean bFlag = super.doCommand(strCommand, sourceSField, iCommandOptions); // This will send the command to my view if (bFlag) return bFlag; // Handled by my view
boolean bFlag = super.doCommand(strCommand, sourceSField, iCommandOptions); // This will send the command to my view if (bFlag) return bFlag; // Handled by my view