1 24 25 package org.objectweb.cjdbc.console.views; 26 27 import org.objectweb.cjdbc.common.i18n.Translate; 28 29 36 public class ClientsViewer extends InfoViewer 37 { 38 static final int COLUMNS = 8; 39 40 45 public ClientsViewer(Object [][] data) 46 { 47 super(data); 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 == 0 ||j == 1) 63 ret[i][j] = new String (aStat[j]); 64 else if (j == 2 ||j == 3) 65 ret[i][j] = new Integer (aStat[j]); 66 else if (j == 4) 67 ret[i][j] = new Boolean (aStat[j]); 68 else if (j == 5 || j==6 || j==7) 69 ret[i][j] = new Long (aStat[j]); 70 } 71 } 72 return ret; 73 } 74 75 78 public String [] getColumnNames() 79 { 80 String [] columnNames = new String [COLUMNS]; 81 columnNames[0] = Translate.get("console.infoviewer.clients.column.0"); 82 columnNames[1] = Translate.get("console.infoviewer.clients.column.1"); 83 columnNames[2] = Translate.get("console.infoviewer.clients.column.2"); 84 columnNames[3] = Translate.get("console.infoviewer.clients.column.3"); 85 columnNames[4] = Translate.get("console.infoviewer.clients.column.4"); 86 columnNames[5] = Translate.get("console.infoviewer.clients.column.5"); 87 columnNames[6] = Translate.get("console.infoviewer.clients.column.6"); 88 columnNames[7] = Translate.get("console.infoviewer.clients.column.7"); 89 return columnNames; 90 } 91 92 95 public void setLabels() 96 { 97 frameTitle = Translate.get("console.infoviewer.clients.frame.title"); 98 infoViewerMenuBarString = Translate.get("console.infoviewer.clients.menubar"); 99 actionToolTipText = Translate 100 .get("console.infoviewer.clients.action.tooltiptext"); 101 actionErrorMessage = Translate 102 .get("console.infoviewer.clients.action.error.message"); 103 actionSuccessMessage = Translate 104 .get("console.infoviewer.clients.action.success.message"); 105 tableHeaderToolTipText = Translate 106 .get("console.infoviewer.table.tooltip.text"); 107 } 108 109 } 110 | Popular Tags |