1 24 25 package org.objectweb.cjdbc.console.views; 26 27 import org.objectweb.cjdbc.common.i18n.Translate; 28 29 36 public class SQLStatViewer extends InfoViewer 37 { 38 static final int COLUMNS = 9; 39 40 45 public SQLStatViewer(Object [][] stats) 46 { 47 super(stats); 48 } 49 50 protected Object [][] getDataTypes(Object [][] stats) 51 { 52 int iSize = stats.length; 53 Object [][] ret = new Object [iSize][]; 54 for (int i = 0; i < iSize; i++) 55 { 56 String [] aStat = (String []) stats[i]; 57 int jSize = aStat.length; 58 ret[i] = new Object [jSize]; 59 ret[i][0] = aStat[0]; 60 for (int j = 1; j < jSize; j++) 61 { 62 if (j == 1) 63 ret[i][j] = new String (aStat[j]); 64 else 65 ret[i][j] = new Float (aStat[j]); 66 } 67 } 68 return ret; 69 } 70 71 74 public String [] getColumnNames() 75 { 76 String [] columnNames = new String [COLUMNS]; 77 columnNames[0] = Translate.get("console.infoviewer.stats.column.0"); 78 columnNames[1] = Translate.get("console.infoviewer.stats.column.1"); 79 columnNames[2] = Translate.get("console.infoviewer.stats.column.2"); 80 columnNames[3] = Translate.get("console.infoviewer.stats.column.3"); 81 columnNames[4] = Translate.get("console.infoviewer.stats.column.4"); 82 columnNames[5] = Translate.get("console.infoviewer.stats.column.5"); 83 columnNames[6] = Translate.get("console.infoviewer.stats.column.6"); 84 columnNames[7] = Translate.get("console.infoviewer.stats.column.7"); 85 columnNames[8] = Translate.get("console.infoviewer.stats.column.8"); 86 return columnNames; 87 } 88 89 92 public void setLabels() 93 { 94 frameTitle = Translate.get("console.infoviewer.stats.frame.title"); 95 infoViewerMenuBarString = Translate.get("console.infoviewer.stats.menubar"); 96 actionToolTipText = Translate 97 .get("console.infoviewer.stats.action.tooltiptext"); 98 actionErrorMessage = Translate 99 .get("console.infoviewer.stats.action.error.message"); 100 actionSuccessMessage = Translate 101 .get("console.infoviewer.stats.action.success.message"); 102 tableHeaderToolTipText = Translate 103 .get("console.infoviewer.table.tooltip.text"); 104 } 105 106 } 107 | Popular Tags |