/** * Get the default title for this screen. * Calls the getTitle method of this screen. * @param screenMain The screen to get the title string from. * @return The returned title for this screen. */ public String getTitle(BasePanel screenMain) { String strScreenTitle = DBConstants.BLANK; if (screenMain != null) strScreenTitle = screenMain.getTitle(); return strScreenTitle; } }
/** * Get the default title for this screen. * Calls the getTitle method of this screen. * @param screenMain The screen to get the title string from. * @return The returned title for this screen. */ public String getTitle(BasePanel screenMain) { String strScreenTitle = DBConstants.BLANK; if (screenMain != null) strScreenTitle = screenMain.getTitle(); return strScreenTitle; } }
/** * Parse the HTML for variables and print it. * @param strHTML the html string to output. * @param out The html out stream. */ public void writeHtmlString(String strHTML, PrintWriter out) { int iIndex; if (strHTML == null) return; while ((iIndex = strHTML.indexOf(HtmlConstants.TITLE_TAG)) != -1) { // ** FIX THIS to look for a <xxx/> and look up the token ** strHTML = strHTML.substring(0, iIndex) + ((BasePanel)this.getScreenField()).getTitle() + strHTML.substring(iIndex + HtmlConstants.TITLE_TAG.length()); } out.println(strHTML); } }
/** * Form Header. * @param out The html out stream. * @param reg The resources object. */ public void printHtmlHeader(PrintWriter out, ResourceBundle reg) { String strTitle = this.getProperty("title"); // Menu page if ((strTitle == null) || (strTitle.length() == 0)) strTitle = ((BasePanel)this.getScreenField()).getTitle(); String strHTMLStart = reg.getString("htmlHeaderStart"); String strHTMLEnd = reg.getString("htmlHeaderEnd"); // Note: don't free the reg key (DBServlet will) this.printHtmlHeader(out, strTitle, strHTMLStart, strHTMLEnd); } /**
/** * Form Header. * @param out The html out stream. * @param reg The resources object. */ public void printHtmlHeader(PrintWriter out, ResourceBundle reg) { String strTitle = this.getProperty("title"); // Menu page if ((strTitle == null) || (strTitle.length() == 0)) strTitle = ((BasePanel)this.getScreenField()).getTitle(); String strHTMLStart = reg.getString("htmlHeaderStart"); String strHTMLEnd = reg.getString("htmlHeaderEnd"); // Note: don't free the reg key (DBServlet will) this.printHtmlHeader(out, strTitle, strHTMLStart, strHTMLEnd); } /**
/** * Pop this command off the history stack. * NOTE: Do not use this method in most cases, use the method in BaseApplet. * @return The history command on top of the stack. */ public String popHistory(int quanityToPop, boolean bPopFromBrowser) { String strHistory = null; for (int i = 0; i < quanityToPop; i++) { strHistory = null; if (m_vHistory != null) if (m_vHistory.size() > 0) strHistory = (String)m_vHistory.remove(m_vHistory.size() - 1); } if (bPopFromBrowser) if (this.getAppletScreen() != null) if (this.getAppletScreen().getTask() instanceof BaseAppletReference) ((BaseAppletReference)this.getAppletScreen().getTask()).popBrowserHistory(quanityToPop, strHistory != null, this.getTitle()); // Let browser know about the new screen return strHistory; } /**
/** * Pop this command off the history stack. * NOTE: Do not use this method in most cases, use the method in BaseApplet. * @return The history command on top of the stack. */ public String popHistory(int quanityToPop, boolean bPushToBrowser) { String strHistory = null; for (int i = 0; i < quanityToPop; i++) { strHistory = null; if (m_vHistory != null) if (m_vHistory.size() > 0) strHistory = (String)m_vHistory.remove(m_vHistory.size() - 1); } if (bPushToBrowser) if (this.getAppletScreen() != null) if (this.getAppletScreen().getTask() instanceof BaseApplet) if (((BaseApplet)this.getAppletScreen().getTask()).getBrowserManager() != null) // Let browser know about the new screen ((BaseApplet)this.getAppletScreen().getTask()).getBrowserManager().popBrowserHistory(quanityToPop, strHistory != null, this.getTitle()); // Let browser know about the new screen return strHistory; } /**
/** * Print the top nav menu. * @param out The html out stream. * @param reg The resources object. * @exception DBException File exception. */ public void printHtmlMenubar(PrintWriter out, ResourceBundle reg) throws DBException { char chMenubar = ScreenFieldViewAdapter.getFirstToUpper(this.getProperty(DBParams.MENUBARS), 'Y'); if (chMenubar == 'Y') { String strUserName = this.getProperty(DBParams.USER_NAME); String strUserID = this.getProperty(DBParams.USER_ID); if ((strUserName == null) || (DBConstants.ANON_USER_ID.equals(strUserID)) || (Utility.isNumeric(strUserName))) strUserName = DBConstants.BLANK; String strNav = reg.getString((strUserName.length() > 0) ? "htmlMenubar" : "htmlMenubarAnon"); strNav = Utility.replaceResources(strNav, reg, null, null); String strScreen = ((BasePanel)this.getScreenField()).getScreenURL(); strScreen = Utility.encodeXML(strScreen); String strTitle = this.getProperty("title"); // Menu page if ((strTitle == null) || (strTitle.length() == 0)) strTitle = ((BasePanel)this.getScreenField()).getTitle(); strNav = Utility.replace(strNav, HtmlConstants.URL_TAG, strScreen); strNav = Utility.replace(strNav, HtmlConstants.TITLE_TAG, strTitle); strNav = Utility.replace(strNav, HtmlConstants.USER_NAME_TAG, strUserName); this.writeHtmlString(strNav, out); } } }
/** * Push this command onto the history stack. * @param strHistory The history command to push onto the stack. */ public void pushHistory(String strHistory, boolean bPushToBrowser) { if (m_vHistory == null) m_vHistory = new Vector<String>(); m_vHistory.addElement(strHistory); String strHelp = Utility.fixDisplayURL(strHistory, true, true, true, this); if (this.getAppletScreen() != null) if (this.getAppletScreen().getScreenFieldView() != null) this.getAppletScreen().getScreenFieldView().showDocument(strHelp, MenuConstants.HELP_WINDOW_CHANGE); if (bPushToBrowser) if (this.getAppletScreen() != null) if (this.getAppletScreen().getTask() instanceof BaseAppletReference) ((BaseAppletReference)this.getAppletScreen().getTask()).pushBrowserHistory(strHistory, this.getTitle(), bPushToBrowser); // Let browser know about the new screen } /**
/** * Print the top nav menu. * @param out The html out stream. * @param reg The resources object. * @exception DBException File exception. */ public void printHtmlMenubar(PrintWriter out, ResourceBundle reg) throws DBException { char chMenubar = HBasePanel.getFirstToUpper(this.getProperty(DBParams.MENUBARS), 'Y'); if (chMenubar == 'Y') { String strUserName = this.getProperty(DBParams.USER_NAME); String strUserID = this.getProperty(DBParams.USER_ID); if ((strUserName == null) || (DBConstants.ANON_USER_ID.equals(strUserID)) || (Utility.isNumeric(strUserName))) strUserName = DBConstants.BLANK; String strNav = reg.getString((strUserName.length() > 0) ? "htmlMenubar" : "htmlMenubarAnon"); strNav = Utility.replaceResources(strNav, reg, null, null); String strScreen = ((BasePanel)this.getScreenField()).getScreenURL(); strScreen = Utility.encodeXML(strScreen); String strTitle = this.getProperty("title"); // Menu page if ((strTitle == null) || (strTitle.length() == 0)) strTitle = ((BasePanel)this.getScreenField()).getTitle(); strNav = Utility.replace(strNav, HtmlConstants.URL_TAG, strScreen); strNav = Utility.replace(strNav, HtmlConstants.TITLE_TAG, strTitle); strNav = Utility.replace(strNav, HtmlConstants.USER_NAME_TAG, strUserName); this.writeHtmlString(strNav, out); } } /**
/** * Push this command onto the history stack. * @param strHistory The history command to push onto the stack. */ public void pushHistory(String strHistory, boolean bPushToBrowser) { if (m_vHistory == null) m_vHistory = new Vector<String>(); m_vHistory.addElement(strHistory); String strHelp = Utility.fixDisplayURL(strHistory, true, true, true, this); if (this.getAppletScreen() != null) if (this.getAppletScreen().getScreenFieldView() != null) this.getAppletScreen().getScreenFieldView().showDocument(strHelp, MenuConstants.HELP_WINDOW_CHANGE); if (bPushToBrowser) if (this.getAppletScreen() != null) if (this.getAppletScreen().getTask() instanceof BaseApplet) if (((BaseApplet)this.getAppletScreen().getTask()).getBrowserManager() != null) // Let browser know about the new screen ((BaseApplet)this.getAppletScreen().getTask()).getBrowserManager().pushBrowserHistory(strHistory, this.getTitle()); // Let browser know about the new screen } /**