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