KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openbravo > erpCommon > utility > NavigationBar


1 /*
2  *************************************************************************
3  * The contents of this file are subject to the Openbravo Public License
4  * Version 1.0 (the "License"), being the Mozilla Public License
5  * Version 1.1 with a permitted attribution clause; you may not use this
6  * file except in compliance with the License. You may obtain a copy of
7  * the License at http://www.openbravo.com/legal/license.html
8  * Software distributed under the License is distributed on an "AS IS"
9  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
10  * License for the specific language governing rights and limitations
11  * under the License.
12  * The Original Code is Openbravo ERP.
13  * The Initial Developer of the Original Code is Openbravo SL
14  * All portions are Copyright (C) 2001-2006 Openbravo SL
15  * All Rights Reserved.
16  * Contributor(s): ______________________________________.
17  ************************************************************************
18 */

19 package org.openbravo.erpCommon.utility;
20
21 import org.openbravo.database.ConnectionProvider;
22 import org.apache.log4j.Logger ;
23
24 public class NavigationBar {
25   static Logger log4j = Logger.getLogger(NavigationBar.class);
26   ConnectionProvider conn;
27   String JavaDoc language = "en_US";
28   String JavaDoc servlet_action = "";
29   String JavaDoc window_name = "";
30   String JavaDoc base_direction = "";
31   String JavaDoc breadcrumb = "";
32   String JavaDoc window_type = "";
33
34   public NavigationBar(ConnectionProvider _conn, String JavaDoc _language, String JavaDoc _action, String JavaDoc _windowName, String JavaDoc _windowType, String JavaDoc _baseDirection, String JavaDoc _breadcrumb) {
35     this.conn = _conn;
36     this.language = _language;
37     this.servlet_action = _action;
38     this.window_name = _windowName;
39     this.base_direction = _baseDirection;
40     this.breadcrumb = _breadcrumb;
41     this.window_type = _windowType;
42   }
43
44   public String JavaDoc toString() {
45     StringBuffer JavaDoc toolbar = new StringBuffer JavaDoc();
46     toolbar.append("<TABLE class=\"Main_ContentPane_NavBar\" id=\"tdtopNavButtons\">\n");
47     toolbar.append(" <TR class=\"Main_NavBar_bg\"><TD></TD>\n");
48     toolbar.append(" <TD class=\"Main_NavBar_LeftButton_cell\">\n");
49     toolbar.append(" <a class=\"Main_NavBar_LeftButton\" HREF=\"../secureApp/GoBack.html\" border=\"0\" onmouseover=\"window.status='");
50     String JavaDoc auxText = Utility.messageBD(conn, "GoBack", language);
51     toolbar.append(auxText);
52     toolbar.append("';return true;\" onmouseout=\"window.status='';return true;\"><IMG SRC=\"").append(base_direction).append("/images/blank.gif\" class=\"Main_NavBar_LeftButton_Icon Main_NavBar_LeftButton_Icon_back\" border=\"0\" alt=\"");
53     toolbar.append(auxText).append("\" title=\"").append(auxText).append("\"");
54     toolbar.append("/></a>\n");
55     toolbar.append(" </TD>\n");
56     toolbar.append(" <TD class=\"Main_NavBar_separator_cell\"></TD>\n");
57     toolbar.append(" <TD class=\"Main_NavBar_LeftButton_cell\">\n");
58     toolbar.append(" <a class=\"Main_NavBar_LeftButton\" HREF=\"#\" onClick=\"submitCommandForm('DEFAULT', false, null, '").append(servlet_action);
59     toolbar.append("', '_self', null, true);return false;\" border=\"0\" onmouseover=\"window.status='");
60     auxText = Utility.messageBD(conn, "Refresh", language);
61     toolbar.append(auxText).append("';return true;\" onmouseout=\"window.status='';return true;\"><IMG SRC=\"");
62     toolbar.append(base_direction).append("/images/blank.gif\" class=\"Main_NavBar_LeftButton_Icon Main_NavBar_LeftButton_Icon_refresh\" border=\"0\" alt=\"");
63     toolbar.append(auxText).append("\" title=\"").append(auxText).append("\"");
64     toolbar.append("></a>\n");
65     toolbar.append(" </TD>\n");
66     toolbar.append(" <TD class=\"Main_NavBar_Breadcrumb_cell\"><span class=\"Main_NavBar_Breadcrumb\" id=\"paramBreadcrumb\">").append(breadcrumb).append("</span></TD>\n");
67     toolbar.append(" <TD></TD>\n");
68     toolbar.append(" <TD class=\"Main_NavBar_RightButton_cell\">\n");
69     toolbar.append(" <a class=\"Main_NavBar_RightButton\" HREF=\"#\" onclick=\"about();return false;\" border=\"0\" onmouseover=\"window.status='");
70     auxText = Utility.messageBD(conn, "About", language);
71     toolbar.append(auxText).append("';return true;\" onmouseout=\"window.status='';return true;\"><IMG SRC=\"").append(base_direction).append("/images/blank.gif\" class=\"Main_NavBar_RightButton_Icon Main_NavBar_RightButton_Icon_about\" border=\"0\"");
72     toolbar.append(" alt=\"").append(auxText).append("\" title=\"").append(auxText).append("\"");
73     toolbar.append("></a>\n");
74     toolbar.append(" </TD>\n");
75     toolbar.append(" <TD class=\"Main_NavBar_separator_cell\"></TD>\n");
76     toolbar.append(" <TD class=\"Main_NavBar_RightButton_cell\">\n");
77     toolbar.append(" <a class=\"Main_NavBar_RightButton\" HREF=\"#\" onclick=\"openHelp(");
78     if (window_type.equalsIgnoreCase("W")) toolbar.append("document.frmMain.inpwindowId.value");
79     else toolbar.append("null");
80     toolbar.append(", '../ad_help/DisplayHelp.html', 'HELP', true, null, null, '");
81     toolbar.append(window_type).append("', '").append(window_name);
82     toolbar.append("');return false;\" border=\"0\" onmouseover=\"window.status='");
83     auxText = Utility.messageBD(conn, "Help", language);
84     toolbar.append(auxText).append("';return true;\" onmouseout=\"window.status='';return true;\"><IMG SRC=\"").append(base_direction).append("/images/blank.gif\" class=\"Main_NavBar_RightButton_Icon Main_NavBar_RightButton_Icon_help\" border=\"0\"");
85     toolbar.append(" alt=\"").append(auxText).append("\" title=\"").append(auxText).append("\"");
86     toolbar.append("></a>\n");
87     toolbar.append(" </TD>\n");
88     toolbar.append(" <TD class=\"Main_NavBar_separator_cell\"></TD>\n");
89     toolbar.append(" <TD class=\"Main_NavBar_bg_logo_left\"></TD>\n");
90     toolbar.append(" <TD class=\"Main_NavBar_bg_logo\" width=\"1\" onclick=\"abrirNuevoBrowser('http://www.openbravo.com', 'Openbravo');return false;\"><IMG SRC=\"").append(base_direction).append("/images/blank.gif\" alt=\"Openbravo\" title=\"Openbravo\" border=\"0\" id=\"openbravoLogo\" class=\"Main_NavBar_logo\"></TD>\n");
91     toolbar.append(" <TD class=\"Main_NavBar_bg_logo_right\"></TD>\n");
92     toolbar.append(" <TD></TD>\n");
93     toolbar.append(" </TR>\n");
94     toolbar.append("</TABLE>");
95     return toolbar.toString();
96   }
97 }
98
Popular Tags