< prev index next >

src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java

Print this page
rev 1501 : 7017818: NLS: JConsoleResources.java cannot be handled by translation team
Reviewed-by: mchung, mfang

@@ -35,11 +35,12 @@
 import javax.swing.border.TitledBorder;
 import javax.swing.event.*;
 import javax.swing.table.*;
 import javax.swing.tree.*;
 import sun.tools.jconsole.JConsole;
-import sun.tools.jconsole.Resources;
+
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.inspector.XNodeInfo.Type;
 
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")

@@ -49,12 +50,12 @@
 
     private final int NAME_COLUMN = 0;
     private final int VALUE_COLUMN = 1;
 
     private final String[] columnNames = {
-        Resources.getText("Name"),
-        Resources.getText("Value")
+        Messages.NAME,
+        Messages.VALUE
     };
 
     private JTable infoTable = new JTable();
     private JTable descTable = new JTable();
     private JPanel infoBorderPanel = new JPanel(new BorderLayout());

@@ -162,11 +163,11 @@
         descTable.getColumnModel().getColumn(VALUE_COLUMN).setCellEditor(editor);
         descTable.addKeyListener(new Utils.CopyKeyAdapter());
         descTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
         JScrollPane descTableScrollPane = new JScrollPane(descTable);
         descBorderPanel.setBorder(
-                BorderFactory.createTitledBorder(Resources.getText("Descriptor")));
+            BorderFactory.createTitledBorder(Messages.DESCRIPTOR));
         descBorderPanel.add(descTableScrollPane);
         // Add the two tables to the grid
         //
         add(infoBorderPanel);
         add(descBorderPanel);

@@ -225,39 +226,39 @@
 
     public void addMBeanInfo(XMBean mbean, MBeanInfo mbeanInfo) {
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanInfo"));
-        String text = Resources.getText("Info") + ":";
+                Messages.MBEAN_INFO);
+        String text = Messages.INFO + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ObjectName");
+        rowData[0] = Messages.OBJECT_NAME;
         rowData[1] = mbean.getObjectName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ClassName");
+        rowData[0] = Messages.CLASS_NAME;
         rowData[1] = mbeanInfo.getClassName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbeanInfo.getDescription();
         tableModel.addRow(rowData);
         addDescriptor(mbeanInfo.getDescriptor(), text);
         // MBeanConstructorInfo
         //
         int i = 0;
         for (MBeanConstructorInfo mbci : mbeanInfo.getConstructors()) {
             addMBeanConstructorInfo(mbci,
-                    Resources.getText("Constructor") + "-" + i + ":");
+                    Messages.CONSTRUCTOR + "-" + i + ":");
             // MBeanParameterInfo
             //
             int j = 0;
             for (MBeanParameterInfo mbpi : mbci.getSignature()) {
                 addMBeanParameterInfo(mbpi,
-                        Resources.getText("Parameter") + "-" + i + "-" + j + ":");
+                        Messages.PARAMETER + "-" + i + "-" + j + ":");
                 j++;
             }
             i++;
         }
         tableModel.newDataAvailable(new TableModelEvent(tableModel));

@@ -265,104 +266,104 @@
 
     public void addMBeanAttributeInfo(MBeanAttributeInfo mbai) {
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanAttributeInfo"));
-        String text = Resources.getText("Attribute") + ":";
+                Messages.MBEAN_ATTRIBUTE_INFO);
+        String text = Messages.ATTRIBUTE + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbai.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbai.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Readable");
+        rowData[0] = Messages.READABLE;
         rowData[1] = mbai.isReadable();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Writable");
+        rowData[0] = Messages.WRITABLE;
         rowData[1] = mbai.isWritable();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Is");
+        rowData[0] = Messages.IS;
         rowData[1] = mbai.isIs();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Type");
+        rowData[0] = Messages.TYPE;
         rowData[1] = mbai.getType();
         tableModel.addRow(rowData);
         addDescriptor(mbai.getDescriptor(), text);
         tableModel.newDataAvailable(new TableModelEvent(tableModel));
     }
 
     public void addMBeanOperationInfo(MBeanOperationInfo mboi) {
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanOperationInfo"));
-        String text = Resources.getText("Operation") + ":";
+                Messages.MBEAN_OPERATION_INFO);
+        String text = Messages.OPERATION + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mboi.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mboi.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Impact");
+        rowData[0] = Messages.IMPACT;
         switch (mboi.getImpact()) {
             case MBeanOperationInfo.INFO:
-                rowData[1] = Resources.getText("INFO");
+                rowData[1] = Messages.INFO_CAPITALIZED;
                 break;
             case MBeanOperationInfo.ACTION:
-                rowData[1] = Resources.getText("ACTION");
+                rowData[1] = Messages.ACTION_CAPITALIZED;
                 break;
             case MBeanOperationInfo.ACTION_INFO:
-                rowData[1] = Resources.getText("ACTION_INFO");
+                rowData[1] = Messages.ACTION_INFO_CAPITALIZED;
                 break;
             case MBeanOperationInfo.UNKNOWN:
-                rowData[1] = Resources.getText("UNKNOWN");
+                rowData[1] = Messages.UNKNOWN_CAPITALIZED;
                 break;
         }
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ReturnType");
+        rowData[0] = Messages.RETURN_TYPE;
         rowData[1] = mboi.getReturnType();
         tableModel.addRow(rowData);
         addDescriptor(mboi.getDescriptor(), text);
         // MBeanParameterInfo
         //
         int i = 0;
         for (MBeanParameterInfo mbpi : mboi.getSignature()) {
             addMBeanParameterInfo(mbpi,
-                    Resources.getText("Parameter") + "-" + i++ + ":");
+                    Messages.PARAMETER + "-" + i++ + ":");
         }
         tableModel.newDataAvailable(new TableModelEvent(tableModel));
     }
 
     public void addMBeanNotificationInfo(MBeanNotificationInfo mbni) {
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanNotificationInfo"));
-        String text = Resources.getText("Notification") + ":";
+                Messages.MBEAN_NOTIFICATION_INFO);
+        String text = Messages.NOTIFICATION + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbni.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbni.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("NotifTypes");
+        rowData[0] = Messages.NOTIF_TYPES;
         rowData[1] = Arrays.toString(mbni.getNotifTypes());
         tableModel.addRow(rowData);
         addDescriptor(mbni.getDescriptor(), text);
         tableModel.newDataAvailable(new TableModelEvent(tableModel));
     }

@@ -371,14 +372,14 @@
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbci.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbci.getDescription();
         tableModel.addRow(rowData);
         addDescriptor(mbci.getDescriptor(), text);
         tableModel.newDataAvailable(new TableModelEvent(tableModel));
     }

@@ -387,17 +388,17 @@
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbpi.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbpi.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Type");
+        rowData[0] = Messages.TYPE;
         rowData[1] = mbpi.getType();
         tableModel.addRow(rowData);
         addDescriptor(mbpi.getDescriptor(), text);
         tableModel.newDataAvailable(new TableModelEvent(tableModel));
     }

@@ -423,11 +424,11 @@
         // MBeanAttributeInfo node
         //
         if (ai != null && ai.length > 0) {
             DefaultMutableTreeNode attributes = new DefaultMutableTreeNode();
             XNodeInfo attributesUO = new XNodeInfo(Type.ATTRIBUTES, mbean,
-                    Resources.getText("Attributes"), null);
+                        Messages.ATTRIBUTES, null);
             attributes.setUserObject(attributesUO);
             root.add(attributes);
             for (MBeanAttributeInfo mbai : ai) {
                 DefaultMutableTreeNode attribute = new DefaultMutableTreeNode();
                 XNodeInfo attributeUO = new XNodeInfo(Type.ATTRIBUTE,

@@ -439,11 +440,11 @@
         // MBeanOperationInfo node
         //
         if (oi != null && oi.length > 0) {
             DefaultMutableTreeNode operations = new DefaultMutableTreeNode();
             XNodeInfo operationsUO = new XNodeInfo(Type.OPERATIONS, mbean,
-                    Resources.getText("Operations"), null);
+                        Messages.OPERATIONS, null);
             operations.setUserObject(operationsUO);
             root.add(operations);
             for (MBeanOperationInfo mboi : oi) {
                 // Compute the operation's tool tip text:
                 // "operationname(param1type,param2type,...)"

@@ -471,11 +472,11 @@
         // MBeanNotificationInfo node
         //
         if (mbean.isBroadcaster()) {
             DefaultMutableTreeNode notifications = new DefaultMutableTreeNode();
             XNodeInfo notificationsUO = new XNodeInfo(Type.NOTIFICATIONS, mbean,
-                    Resources.getText("Notifications"), null);
+                        Messages.NOTIFICATIONS, null);
             notifications.setUserObject(notificationsUO);
             root.add(notifications);
             if (ni != null && ni.length > 0) {
                 for (MBeanNotificationInfo mbni : ni) {
                     DefaultMutableTreeNode notification =
< prev index next >