/** * Set the state of this field for binary fields (don't override this). * This calls setState with DISPLAY and SCREEN_MOVE. * @param bState the state to set the data to. * @return The error code. */ public final int setState(boolean bState) { return this.setState(bState, Constants.DISPLAY, Constants.SCREEN_MOVE); } /**
/** * For binary fields, set the current state. * @param state The state to set this field. * @param bDisplayOption Display changed fields if true. * @param iMoveMode The move mode. * @return The error code (or NORMAL_RETURN). */ public int setState(boolean state, boolean bDisplayOption, int iMoveMode) { // Must be overidden if (this.getNextConverter() != null) return this.getNextConverter().setState(state, bDisplayOption, iMoveMode); else return super.setState(state, bDisplayOption, iMoveMode); } /**
/** * Set this control's converter to this HTML param. * @param strParamValue The param to set (if matches button, do the command). * @return An error code. */ public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode) { char chFirst = 'N'; if (strParamValue != null) if (strParamValue.length() > 0) chFirst = strParamValue.charAt(0); boolean bState = false; if ((chFirst == 'T') || (chFirst == 'Y')) // True/Yes bState = true; return this.getConverter().setState(bState, bDisplayOption, iMoveMode); } }
/** * Set this control's converter to this HTML param. * @param strParamValue The value. * @return The error code. */ public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode) { char chFirst = 'N'; if (strParamValue != null) if (strParamValue.length() > 0) chFirst = strParamValue.charAt(0); boolean bState = false; if ((chFirst == 'T') || (chFirst == 'Y')) // True/Yes bState = true; return this.getConverter().setState(bState, bDisplayOption, iMoveMode); } }
/** * Set the data in this field to true or false. */ public int setState(boolean bState, boolean bDisplayOption, int iMoveMode) { Boolean objData = new Boolean(bState); if (this.getDataClass() == Boolean.class) return this.setData(objData, bDisplayOption, iMoveMode); else if (Number.class.isAssignableFrom(this.getDataClass())) return this.setValue(objData.booleanValue() ? 1 : 0, bDisplayOption, iMoveMode); else if (this.getDataClass() == String.class) return this.setString(objData.booleanValue() ? Constants.TRUE : Constants.FALSE, bDisplayOption, iMoveMode); return super.setState(bState, bDisplayOption, iMoveMode); } /**
/** * Convert and move string to this field. * Toggle the field value. * Override this method to convert the String to the actual Physical Data Type. * @param strString the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code (or NORMAL_RETURN). */ public int setString(String string, boolean bDisplayOption, int moveMode) { boolean bNewState = !this.getNextConverter().getState(); return this.getNextConverter().setState(bNewState, bDisplayOption, moveMode); // Toggle the state } }
/** * Convert and move string to this field. * Toggle the field value. * Override this method to convert the String to the actual Physical Data Type. * @param strString the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code (or NORMAL_RETURN). */ public int setString(String string, boolean bDisplayOption, int moveMode) { boolean bNewState = !this.getNextConverter().getState(); return this.getNextConverter().setState(bNewState, bDisplayOption, moveMode); // Toggle the state } }
/** * Convert and move string to this field. * Toggle the field value. * Override this method to convert the String to the actual Physical Data Type. * @param strString the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code (or NORMAL_RETURN). */ public int setString(String string, boolean bDisplayOption, int moveMode) { boolean bNewState = !this.getNextConverter().getState(); return this.getNextConverter().setState(bNewState, bDisplayOption, moveMode); // Toggle the state } }