/** * 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)! } /**
/** * 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)! } /**
/** * 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. } /**
/** * 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. } /**
/** * Get the field column headings in HTML. * @param out The html out stream. * @exception DBException File exception. */ public void printHtmlHeading(PrintWriter out) { if (this.getScreenField().getConverter() != null) super.printHtmlHeading(out); else if (this.getScreenField().getParentScreen() instanceof GridScreen) { // These are command buttons such as "Form" or "Detail" String strImage = "Form"; if (((SButtonBox)this.getScreenField()).getImageButtonName() != null) strImage = ((SButtonBox)this.getScreenField()).getImageButtonName(); out.println("<th align=\"center\" valign=\"center\"><img src=\"" + HtmlConstants.IMAGE_DIR + "buttons/" + strImage + ".gif\" width=\"16\" height=\"16\" alt=\"Open this record\"></th>"); } } /**
/** * 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 } /**
&& (((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)) 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);