KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > console > views > RecoveryLogViewer


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk.
22  * Contributor(s): ______________________.
23  */

24
25 package org.objectweb.cjdbc.console.views;
26
27 import org.objectweb.cjdbc.common.i18n.Translate;
28
29 /**
30  * This class defines a RecoveryLogViewer
31  *
32  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk</a>
33  * @version 1.0
34  */

35 public class RecoveryLogViewer extends InfoViewer
36 {
37
38   /**
39    * Creates a new <code>RecoveryLogViewer</code> object
40    *
41    * @param data the content of the recovery log
42    */

43   public RecoveryLogViewer(Object JavaDoc[][] data)
44   {
45     super(data);
46   }
47
48   /**
49    * @see org.objectweb.cjdbc.console.views.InfoViewer#getDataTypes(java.lang.Object[][])
50    */

51   protected Object JavaDoc[][] getDataTypes(Object JavaDoc[][] stats)
52   {
53     int iSize = stats.length;
54     Object JavaDoc[][] ret = new Object JavaDoc[iSize][];
55     for (int i = 0; i < iSize; i++)
56     {
57       String JavaDoc[] aStat = (String JavaDoc[]) stats[i];
58       int jSize = aStat.length;
59       ret[i] = new Object JavaDoc[jSize];
60       ret[i][0] = aStat[0];
61       for (int j = 0; j < jSize; j++)
62       {
63         if (j == 2 || j == 3)
64           ret[i][j] = new Long JavaDoc(aStat[j]);
65         else
66           ret[i][j] = new String JavaDoc(aStat[j]);
67       }
68     }
69     return ret;
70   }
71
72   /**
73    * @see org.objectweb.cjdbc.console.views.InfoViewer#getColumnNames()
74    */

75   public String JavaDoc[] getColumnNames()
76   {
77     String JavaDoc[] columnNames = new String JavaDoc[4];
78     columnNames[0] = Translate.get("console.infoviewer.recoverylog.column.0");
79     columnNames[1] = Translate.get("console.infoviewer.recoverylog.column.1");
80     columnNames[2] = Translate.get("console.infoviewer.recoverylog.column.2");
81     columnNames[3] = Translate.get("console.infoviewer.recoverylog.column.3");
82     return columnNames;
83   }
84
85   /**
86    * @see org.objectweb.cjdbc.console.views.InfoViewer#setLabels()
87    */

88   public void setLabels()
89   {
90     frameTitle = Translate.get("console.infoviewer.recoverylog.frame.title");
91     infoViewerMenuBarString = Translate
92         .get("console.infoviewer.recoverylog.menubar");
93     actionToolTipText = Translate
94         .get("console.infoviewer.recoverylog.action.tooltiptext");
95     actionErrorMessage = Translate
96         .get("console.infoviewer.recoverylog.action.error.message");
97     actionSuccessMessage = Translate
98         .get("console.infoviewer.recoverylog.action.success.message");
99     tableHeaderToolTipText = Translate
100         .get("console.infoviewer.table.tooltip.text");
101   }
102
103 }
104
Popular Tags