/** * Set up the default control for this field (A SCheckBox). * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) // Add this view to the list { return new SButtonBox(itsLocation, targetScreen, converter, iDisplayFieldDesc); } }
/** * Initialize class fields. */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Request pAmRequests) { m_pAmRequests = null; m_pAmRequests = pAmRequests; super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, null, "Brochure history", null, null, null); } /**
/** * Set this control's converter to this HTML param. * ie., Check to see if this button was pressed. */ public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode) { String strButtonDesc = this.getButtonDesc(); String strButtonCommand = this.getButtonCommand(); if (strButtonCommand != null) if (strButtonDesc != null) if (strButtonDesc.equals(strParamValue)) { // Button was pressed, do command this.handleCommand(strButtonCommand, this, ScreenConstants.USE_NEW_WINDOW); return DBConstants.NORMAL_RETURN; } // Often this is called in a report needing a value set, so set it: return super.setSFieldValue(strParamValue, bDisplayOption, iMoveMode); } /**
strControlType = HtmlConstants.SUBMIT; String strButtonDesc = ((SButtonBox)this.getScreenField()).getButtonDesc(); if ((strButtonDesc == null) && (((SButtonBox)this.getScreenField()).getImageButtonName() != null)) if (((SButtonBox)this.getScreenField()).getImageButtonName() != null) strImage = ((SButtonBox)this.getScreenField()).getImageButtonName(); String strButtonCommand = ((SButtonBox)this.getScreenField()).getButtonCommand(); if ((strButtonCommand == null) || (strButtonCommand.length() == 0)) strButtonCommand = ThinMenuConstants.FORM; strButtonDesc = ((SButtonBox)this.getScreenField()).getImageButtonName(); String strCommand = "<td><img src=\"" + HtmlConstants.IMAGE_DIR + "buttons/" + ((SButtonBox)this.getScreenField()).getImageButtonName() + ".gif\" width=\"16\" height=\"16\" border=\"0\"></td>"; out.println(strCommand); strButtonDesc = ((SButtonBox)this.getScreenField()).getButtonCommand(); out.println("<td><input type=\"" + strControlType + "\" name=\"" + strFieldName + "\" value=\"" + strButtonDesc + "\"/></td>");
/** * Display this sub-control in html input format? * @param iPrintOptions The view specific print options. * @return True if this sub-control is printable. */ public boolean isPrintableControl(int iPrintOptions) { String strButtonDesc = ((SButtonBox)this.getScreenField()).getButtonDesc(); if ((strButtonDesc == null) && (((SButtonBox)this.getScreenField()).getImageButtonName() != null)) return false; // Image only buttons are ignored in HTML return super.isPrintableControl(iPrintOptions); // Return true } /**
/** * Do I include a description for sField? * Generally yes, except for on GridScreens. * @param sField field to check for description includes. * @return True if successful. */ public boolean getDisplayFieldDesc(ScreenField sField) { if (sField instanceof SButtonBox) if (((SButtonBox)sField).getImageButtonName() == null) return true; // Buttons need their descriptions (if there is no icon) in grid screens return false; // Descriptions are in the header bar (Don't put descriptions in the controls)! } /**
/** * Move the control's value to the field. * @return An error value. */ public int controlToField() { super.controlToField(); Bundle pAmBrocHist = new Bundle(null); BasePanel parentScreen = Screen.makeWindow(null); BundleList pBundleList = new BundleList(pAmBrocHist, null, parentScreen, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null); pBundleList.setEditing(false); m_pAmRequests.addDependentScreen(pBundleList); // When this closes, closes dependent screen return DBConstants.NORMAL_RETURN; }
public void setEnabled(boolean bEnabled) { super.setEnabled(true); // Never disable } };
/** * Do I include a description for sField? * Generally yes, except for on GridScreens. * @param sField field to check for description includes. * @return True if successful. */ public boolean getDisplayFieldDesc(ScreenField sField) { if (sField instanceof SButtonBox) if (((SButtonBox)sField).getImageButtonName() == null) if (!(sField instanceof ExtendedComponent)) return true; // Buttons need their descriptions (if there is no icon) in grid screens return false; // Descriptions are in the header bar (Don't put descriptions in the controls)! } /**
/** * Move the control's value to the field. * @return An error value. */ public int controlToField() { super.controlToField(); Bundle pAmBrocHist = new Bundle(null); BasePanel parentScreen = Screen.makeWindow(null); BundleList pBundleList = new BundleList(pAmBrocHist, null, parentScreen, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null); pBundleList.setEditing(false); m_pAmRequests.addDependentScreen(pBundleList); // When this closes, closes dependent screen return DBConstants.NORMAL_RETURN; }
public void setEnabled(boolean bEnabled) { super.setEnabled(true); // Never disable } };
/** * Set up the default control for this field (A SCheckBox). * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) // Add this view to the list { return new SButtonBox(itsLocation, targetScreen, converter, iDisplayFieldDesc); } }
/** * Initialize class fields. */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Request pAmRequests) { m_pAmRequests = null; m_pAmRequests = pAmRequests; super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, "", "Bundles", null, null, null); } /**
/** * Set this control's converter to this HTML param. * ie., Check to see if this button was pressed. */ public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode) { String strButtonDesc = this.getButtonDesc(); String strButtonCommand = this.getButtonCommand(); if (strButtonCommand != null) if (strButtonDesc != null) if (strButtonDesc.equals(strParamValue)) { // Button was pressed, do command this.handleCommand(strButtonCommand, this, ScreenConstants.USE_NEW_WINDOW); return DBConstants.NORMAL_RETURN; } // Often this is called in a report needing a value set, so set it: return super.setSFieldValue(strParamValue, bDisplayOption, iMoveMode); } /**
/** * Do I include a description for sField? * Generally yes, except for on GridScreens. * @param sField field to check for description includes. */ public boolean getDisplayFieldDesc(ScreenField sField) { if (sField == this) return false; // Panels generally do not have descriptions if (sField instanceof SButtonBox) if (((SButtonBox)sField).getImageButtonName() != null) return false; // Buttons don't need their field descriptions (if there is a icon) in base screens return true; // But the controls in them generally do. } /**
/** * Move the control's value to the field. * @return An error value. */ public int controlToField() { int iErrorCode = super.controlToField(); if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; BasePanel parentScreen = Screen.makeWindow(null); HistoryDisplay pAmBrocHist = new HistoryDisplay(null); ScreenLocation itsLocation = null; BrocHistList pBrocHistList = new BrocHistList(pAmBrocHist, itsLocation, parentScreen, null, ScreenConstants.DONT_DISPLAY_DESC, null); pBrocHistList.setEditing(false); m_pAmRequests.addDependentScreen(pBrocHistList); // When this closes, closes dependent screen //xFileBehavior pSubFileBeh = new SubFileFilter(m_pAmRequests.getField(Request.USE_AGENCY), RequestHistory.USE_AGENCY, m_pAmRequests.getField(Request.PROFILE_ID), RequestHistory.AGENCY_NO, null, -1); //xpAmBrocHist.addListener(pSubFileBeh); m_pAmRequests.getField(Request.PROFILE_CODE).addListener(new FieldReSelectHandler(pBrocHistList)); // Reselect on file change return iErrorCode; }
/** * Add button(s) to the toolbar. */ public void addToolbarButtons(ToolScreen toolScreen) { BaseApplication application = (BaseApplication)this.getTask().getApplication(); String strVendor = Vendor.VENDOR_FILE + ' ' + MenuConstants.LOOKUP; strVendor = application.getResources(ResourceConstants.ACCTPAY_RESOURCE, true).getString(strVendor); String strTour = Tour.TOUR_FILE + ' ' + MenuConstants.LOOKUP; strTour = application.getResources(ResourceConstants.ACCTPAY_RESOURCE, true).getString(strTour); new SButtonBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, strVendor, MenuConstants.LOOKUP, Vendor.VENDOR_FILE, null); new SButtonBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, strTour, MenuConstants.LOOKUP, Tour.TOUR_FILE, null); } /**
/** * Initialize class fields. */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Request pAmRequests) { m_pAmRequests = null; m_pAmRequests = pAmRequests; super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, null, "Brochure history", null, null, null); } /**