/** * "Clone" this screen. * @return true if successful. */ public boolean onClone() { String strLastCommand = this.getScreenURL(); if ((strLastCommand == null) || (strLastCommand.length() == 0)) return false; // Can't process this else this.handleCommand(strLastCommand, this, ScreenConstants.USE_NEW_WINDOW | ScreenConstants.DONT_PUSH_TO_BROSWER); // Process the last command in a new window return true; // Handled } /**
/** * "Clone" this screen. * @return true if successful. */ public boolean onClone() { String strLastCommand = this.getScreenURL(); if ((strLastCommand == null) || (strLastCommand.length() == 0)) return false; // Can't process this else this.handleCommand(strLastCommand, this, ScreenConstants.USE_NEW_WINDOW | ScreenConstants.DONT_PUSH_TO_BROWSER); // Process the last command in a new window return true; // Handled } /**
/** * Display this screen's toolbars in print format. * @param out print stream. * @param iPrintOptions The view specific options. * @exception DBException File exception. */ public boolean printZmlToolbarData(PrintWriter out, int iHtmlOptions) { boolean bFieldsFound = super.printZmlToolbarData(out, iHtmlOptions); String strAgentParam = this.getProperty("agent"); if (strAgentParam == null) strAgentParam = "no"; BasePanel screen = (BasePanel)this.getScreenField(); String strURL = HtmlConstants.SERVLET_LINK + screen.getScreenURL(); if (strAgentParam.equalsIgnoreCase("yes")) strURL = screen.addURLParam(strURL, "agent", "no"); else strURL = screen.addURLParam(strURL, "agent", "yes"); if (strAgentParam.equalsIgnoreCase("yes")) out.println("<br/><a href=\"" + strURL + "\">If you are <b>not</b> a travel agent, click here</a>"); else out.println("<br/><a href=\"" + strURL + "\">If you are a travel agent, click here</a>"); bFieldsFound = true; return bFieldsFound; } /**
String strURL = super.getScreenURL(); try { if ((this.getHeaderRecord() != null)
String strURL = super.getScreenURL(); try { if ((this.getHeaderRecord() != null)
/** * 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); } } /**
/** * 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); } } }
/** * Print the top nav menu. * @param out The html out stream. * @param reg The resources object. * @exception DBException File exception. */ public void printHtmlTrailer(PrintWriter out, ResourceBundle reg) throws DBException { char chMenubar = HBasePanel.getFirstToUpper(this.getProperty(DBParams.TRAILERS), 'H'); if (chMenubar == 'H') if (((BasePanel)this.getScreenField()).isMainMenu()) chMenubar = 'Y'; if (chMenubar == 'Y') { String strNav = reg.getString("htmlTrailer"); strNav = Utility.replaceResources(strNav, reg, null, null); String strScreen = ((BasePanel)this.getScreenField()).getScreenURL(); strScreen = Utility.encodeXML(strScreen); strNav = Utility.replace(strNav, HtmlConstants.URL_TAG, strScreen); this.writeHtmlString(strNav, out); } } /**
/** * Process the "Back" toolbar command. * @return true if successful. */ public boolean onBack() { BasePanel parent = this.getParentScreen(); if (parent == null) return false; parent.popHistory(1, false); // Pop command for this screen String strLastCommand = parent.popHistory(1, false); if (strLastCommand != null) // I don't back up into the browser history if the user hit the java back button. { // If that wasn't the first screen, redo pop and update the browser this time parent.pushHistory(strLastCommand, false); strLastCommand = parent.popHistory(1, true); } if ((strLastCommand == null) || (strLastCommand.length() == 0)) { if (parent.getParentScreen() != null) if (!(parent.getParentScreen() instanceof FrameScreen)) return parent.onBack(); // ++Add++ No more to pop, display home screen (if push-down gets messed up) parent.pushHistory(this.getScreenURL(), false); // This is the first screen in the stack } else this.handleCommand(strLastCommand, this, ScreenConstants.USE_SAME_WINDOW | ScreenConstants.DONT_PUSH_TO_BROWSER); // Process the last command return true; // Handled } /**
/** * Process the "Back" toolbar command. * @return true if successful. */ public boolean onBack() { BasePanel parent = this.getParentScreen(); if (parent == null) return false; parent.popHistory(1, false); // Pop command for this screen String strLastCommand = parent.popHistory(1, false); if (strLastCommand != null) // I don't back up into the browser history if the user hit the java back button. { // If that wasn't the first screen, redo pop and update the browser this time parent.pushHistory(strLastCommand, false); strLastCommand = parent.popHistory(1, true); } if ((strLastCommand == null) || (strLastCommand.length() == 0)) { if (parent.getParentScreen() != null) if (!(parent.getParentScreen() instanceof FrameScreen)) return parent.onBack(); // ++Add++ No more to pop, display home screen (if push-down gets messed up) parent.pushHistory(this.getScreenURL(), false); // This is the first screen in the stack } else this.handleCommand(strLastCommand, this, ScreenConstants.USE_SAME_WINDOW | ScreenConstants.DONT_PUSH_TO_BROSWER); // Process the last command return true; // Handled } /**
/** * Process the "Help" toolbar command. * @param bUseSameWindow Use the same window? * @retrun true if successful. */ public boolean onHelp(int iOptions) { String strPrevAction = this.getScreenURL(); if ((strPrevAction == null) || (strPrevAction.length() == 0)) return false; // Can't handle help if I'm not the target screen. // Note: The following is a hack to make the demo screen stop displaying after the first help is pressed if (this.getProperty("displayInitialHelp") != null) if ((this.getProperty("helplanguage") != null) && (this.getProperty("helplanguage").length() > 0)) if (this.getTask() != null) if (this.getTask().getApplication() != null) this.getTask().getApplication().setProperty("helplanguage", this.getTask().getApplication().getLanguage(true)); strPrevAction = Utility.fixDisplayURL(strPrevAction, true, true, true, this); BaseAppletReference applet = null; if (this.getAppletScreen() != null) if (this.getAppletScreen().getScreenFieldView() != null) applet = (BaseAppletReference)this.getAppletScreen().getScreenFieldView().getControl(); if (applet != null) iOptions = applet.getHelpPageOptions(iOptions); if ((MenuConstants.HELP_WEB_OPTION & iOptions) == MenuConstants.HELP_WEB_OPTION) return this.getScreenFieldView().showDocument(strPrevAction, iOptions & 1); // Not standalone else return this.getAppletScreen().showHelpScreen(strPrevAction, iOptions); } /**
parentScreen.pushHistory(this.getScreenURL(), false); // Update the history to my current state. parentScreen.pushHistory(this.getScreenURL(), false); // Update the history to my current state.
parentScreen.pushHistory(this.getScreenURL(), false); // Update the history to my current state. parentScreen.pushHistory(this.getScreenURL(), false); // Update the history to my current state.
/** * Print the top nav menu. * @param out The html out stream. * @param reg The resources object. * @exception DBException File exception. */ public void printHtmlLogo(PrintWriter out, ResourceBundle reg) throws DBException { char chMenubar = HBasePanel.getFirstToUpper(this.getProperty(DBParams.LOGOS), 'H'); if (chMenubar == 'H') if (((BasePanel)this.getScreenField()).isMainMenu()) chMenubar = 'Y'; if (chMenubar == 'Y') { String strNav = reg.getString("htmlLogo"); strNav = Utility.replaceResources(strNav, reg, null, null); String strScreen = ((BasePanel)this.getScreenField()).getScreenURL(); strScreen = Utility.encodeXML(strScreen); String strUserName = ((MainApplication)this.getTask().getApplication()).getUserName(); if (Utility.isNumeric(strUserName)) strUserName = DBConstants.BLANK; String strLanguage = this.getTask().getApplication().getLanguage(false); strNav = Utility.replace(strNav, HtmlConstants.URL_TAG, strScreen); strNav = Utility.replace(strNav, HtmlConstants.USER_NAME_TAG, strUserName); strNav = Utility.replace(strNav, "<language/>", strLanguage); this.writeHtmlString(strNav, out); } } /**
/** * Process the "Help" toolbar command. * @param bUseSameWindow Use the same window? * @retrun true if successful. */ public boolean onHelp(int iOptions) { String strPrevAction = this.getScreenURL(); if ((strPrevAction == null) || (strPrevAction.length() == 0)) return false; // Can't handle help if I'm not the target screen. // Note: The following is a hack to make the demo screen stop displaying after the first help is pressed if (this.getProperty("displayInitialHelp") != null) if ((this.getProperty("helplanguage") != null) && (this.getProperty("helplanguage").length() > 0)) if (this.getTask() != null) if (this.getTask().getApplication() != null) this.getTask().getApplication().setProperty("helplanguage", this.getTask().getApplication().getLanguage(true)); strPrevAction = Utility.fixDisplayURL(strPrevAction, true, true, true, this); BaseApplet applet = null; if (this.getAppletScreen() != null) if (this.getAppletScreen().getScreenFieldView() != null) applet = (BaseApplet)this.getAppletScreen().getScreenFieldView().getControl(); if (applet != null) iOptions = applet.getHelpPageOptions(iOptions); if ((MenuConstants.HELP_WEB_OPTION & iOptions) == MenuConstants.HELP_WEB_OPTION) return this.getScreenFieldView().showDocument(strPrevAction, iOptions & 1); // Not standalone else return this.getAppletScreen().showHelpScreen(strPrevAction, iOptions); } /**