src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java
author vlivanov
Thu, 18 Jan 2018 02:25:18 +0300
changeset 48596 860326263d1f
parent 47216 71c04702a3d5
permissions -rw-r--r--
8194963: SystemDictionary::link_method_handle_constant() can't link MethodHandle.invoke()/invokeExact() Reviewed-by: kvn, psandoz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 12851
diff changeset
     2
 * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.tools.jconsole.inspector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.BorderLayout;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.Color;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.Component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.GridLayout;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import javax.management.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.swing.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.swing.border.TitledBorder;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.swing.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import javax.swing.table.*;
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
    38
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
    39
import sun.tools.jconsole.Messages;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import static sun.tools.jconsole.Utilities.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
@SuppressWarnings("serial")
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
public class XMBeanInfo extends JPanel {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    private static final Color lightYellow = new Color(255, 255, 128);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
    47
     private final int NAME_COLUMN = 0;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    private final int VALUE_COLUMN = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    private final String[] columnNames = {
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
    50
        Messages.NAME,
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
    51
        Messages.VALUE
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    private JTable infoTable = new JTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    private JTable descTable = new JTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    private JPanel infoBorderPanel = new JPanel(new BorderLayout());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    private JPanel descBorderPanel = new JPanel(new BorderLayout());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    private static class ReadOnlyDefaultTableModel extends DefaultTableModel {
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
    59
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
    60
        @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        public void setValueAt(Object value, int row, int col) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    private static class TableRowDivider {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        private String tableRowDividerText;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        public TableRowDivider(String tableRowDividerText) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            this.tableRowDividerText = tableRowDividerText;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
    73
        @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
            return tableRowDividerText;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    private static MBeanInfoTableCellRenderer renderer =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            new MBeanInfoTableCellRenderer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    private static class MBeanInfoTableCellRenderer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            extends DefaultTableCellRenderer {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
    84
        @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        public Component getTableCellRendererComponent(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                JTable table, Object value, boolean isSelected,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                boolean hasFocus, int row, int column) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            Component comp = super.getTableCellRendererComponent(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                    table, value, isSelected, hasFocus, row, column);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            if (value instanceof TableRowDivider) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                JLabel label = new JLabel(value.toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                label.setBackground(ensureContrast(lightYellow,
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
    93
                        label.getForeground()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                label.setOpaque(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
                return label;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            return comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    private static TableCellEditor editor =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            new MBeanInfoTableCellEditor(new JTextField());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    private static class MBeanInfoTableCellEditor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            extends Utils.ReadOnlyTableCellEditor {
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   105
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        public MBeanInfoTableCellEditor(JTextField tf) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            super(tf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        }
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   109
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   110
        @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        public Component getTableCellEditorComponent(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                JTable table, Object value, boolean isSelected,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
                int row, int column) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
            Component comp = super.getTableCellEditorComponent(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                    table, value, isSelected, row, column);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            if (value instanceof TableRowDivider) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                JLabel label = new JLabel(value.toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                label.setBackground(ensureContrast(lightYellow,
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   119
                        label.getForeground()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                label.setOpaque(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                return label;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
            return comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    public XMBeanInfo() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        // Use the grid layout to display the two tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        super(new GridLayout(2, 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        // MBean*Info table
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        infoTable.setModel(new ReadOnlyDefaultTableModel());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        infoTable.setRowSelectionAllowed(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        infoTable.setColumnSelectionAllowed(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        infoTable.getTableHeader().setReorderingAllowed(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        ((DefaultTableModel) infoTable.getModel()).setColumnIdentifiers(columnNames);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        infoTable.getColumnModel().getColumn(NAME_COLUMN).setPreferredWidth(140);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        infoTable.getColumnModel().getColumn(NAME_COLUMN).setMaxWidth(140);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        infoTable.getColumnModel().getColumn(NAME_COLUMN).setCellRenderer(renderer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        infoTable.getColumnModel().getColumn(VALUE_COLUMN).setCellRenderer(renderer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        infoTable.getColumnModel().getColumn(NAME_COLUMN).setCellEditor(editor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        infoTable.getColumnModel().getColumn(VALUE_COLUMN).setCellEditor(editor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        infoTable.addKeyListener(new Utils.CopyKeyAdapter());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        infoTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        JScrollPane infoTableScrollPane = new JScrollPane(infoTable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        infoBorderPanel.setBorder(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                BorderFactory.createTitledBorder("MBeanInfoPlaceHolder"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        infoBorderPanel.add(infoTableScrollPane);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        // Descriptor table
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        descTable.setModel(new ReadOnlyDefaultTableModel());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        descTable.setRowSelectionAllowed(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        descTable.setColumnSelectionAllowed(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        descTable.getTableHeader().setReorderingAllowed(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        ((DefaultTableModel) descTable.getModel()).setColumnIdentifiers(columnNames);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        descTable.getColumnModel().getColumn(NAME_COLUMN).setPreferredWidth(140);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        descTable.getColumnModel().getColumn(NAME_COLUMN).setMaxWidth(140);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        descTable.getColumnModel().getColumn(NAME_COLUMN).setCellRenderer(renderer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        descTable.getColumnModel().getColumn(VALUE_COLUMN).setCellRenderer(renderer);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        descTable.getColumnModel().getColumn(NAME_COLUMN).setCellEditor(editor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        descTable.getColumnModel().getColumn(VALUE_COLUMN).setCellEditor(editor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        descTable.addKeyListener(new Utils.CopyKeyAdapter());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        descTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        JScrollPane descTableScrollPane = new JScrollPane(descTable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        descBorderPanel.setBorder(
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   167
            BorderFactory.createTitledBorder(Messages.DESCRIPTOR));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        descBorderPanel.add(descTableScrollPane);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        // Add the two tables to the grid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        add(infoBorderPanel);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        add(descBorderPanel);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   175
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public void emptyInfoTable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        while (tableModel.getRowCount() > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            tableModel.removeRow(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   183
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    public void emptyDescTable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        DefaultTableModel tableModel = (DefaultTableModel) descTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        while (tableModel.getRowCount() > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            tableModel.removeRow(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   191
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    private void addDescriptor(Descriptor desc, String text) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        if (desc != null && desc.getFieldNames().length > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            DefaultTableModel tableModel = (DefaultTableModel) descTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            Object rowData[] = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            rowData[0] = new TableRowDivider(text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            rowData[1] = new TableRowDivider("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            tableModel.addRow(rowData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            for (String fieldName : desc.getFieldNames()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                rowData[0] = fieldName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                Object fieldValue = desc.getFieldValue(fieldName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                if (fieldValue instanceof boolean[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                    rowData[1] = Arrays.toString((boolean[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                } else if (fieldValue instanceof byte[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                    rowData[1] = Arrays.toString((byte[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                } else if (fieldValue instanceof char[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                    rowData[1] = Arrays.toString((char[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                } else if (fieldValue instanceof double[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                    rowData[1] = Arrays.toString((double[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                } else if (fieldValue instanceof float[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                    rowData[1] = Arrays.toString((float[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                } else if (fieldValue instanceof int[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                    rowData[1] = Arrays.toString((int[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                } else if (fieldValue instanceof long[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                    rowData[1] = Arrays.toString((long[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                } else if (fieldValue instanceof short[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                    rowData[1] = Arrays.toString((short[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                } else if (fieldValue instanceof Object[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                    rowData[1] = Arrays.toString((Object[]) fieldValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                    rowData[1] = fieldValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                tableModel.addRow(rowData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
            tableModel.newDataAvailable(new TableModelEvent(tableModel));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   229
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    public void addMBeanInfo(XMBean mbean, MBeanInfo mbeanInfo) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        emptyInfoTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        emptyDescTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   234
                Messages.MBEAN_INFO);
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   235
        String text = Messages.INFO + ":";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        Object rowData[] = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        rowData[0] = new TableRowDivider(text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        rowData[1] = new TableRowDivider("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   241
        rowData[0] = Messages.OBJECT_NAME;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        rowData[1] = mbean.getObjectName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   244
        rowData[0] = Messages.CLASS_NAME;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        rowData[1] = mbeanInfo.getClassName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   247
        rowData[0] = Messages.DESCRIPTION;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        rowData[1] = mbeanInfo.getDescription();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        tableModel.addRow(rowData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        addDescriptor(mbeanInfo.getDescriptor(), text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        // MBeanConstructorInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        for (MBeanConstructorInfo mbci : mbeanInfo.getConstructors()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
            addMBeanConstructorInfo(mbci,
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   256
                    Messages.CONSTRUCTOR + "-" + i + ":");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
            // MBeanParameterInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
            //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
            int j = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
            for (MBeanParameterInfo mbpi : mbci.getSignature()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
                addMBeanParameterInfo(mbpi,
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   262
                        Messages.PARAMETER + "-" + i + "-" + j + ":");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
                j++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
            i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        tableModel.newDataAvailable(new TableModelEvent(tableModel));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   270
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    public void addMBeanAttributeInfo(MBeanAttributeInfo mbai) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        emptyInfoTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        emptyDescTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   275
                Messages.MBEAN_ATTRIBUTE_INFO);
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   276
        String text = Messages.ATTRIBUTE + ":";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        Object rowData[] = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
        rowData[0] = new TableRowDivider(text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        rowData[1] = new TableRowDivider("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   282
        rowData[0] = Messages.NAME;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        rowData[1] = mbai.getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   285
        rowData[0] = Messages.DESCRIPTION;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        rowData[1] = mbai.getDescription();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   288
        rowData[0] = Messages.READABLE;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        rowData[1] = mbai.isReadable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   291
        rowData[0] = Messages.WRITABLE;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        rowData[1] = mbai.isWritable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   294
        rowData[0] = Messages.IS;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        rowData[1] = mbai.isIs();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   297
        rowData[0] = Messages.TYPE;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
        rowData[1] = mbai.getType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        tableModel.addRow(rowData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
        addDescriptor(mbai.getDescriptor(), text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        tableModel.newDataAvailable(new TableModelEvent(tableModel));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   304
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    public void addMBeanOperationInfo(MBeanOperationInfo mboi) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
        emptyInfoTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        emptyDescTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
        ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   309
                Messages.MBEAN_OPERATION_INFO);
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   310
        String text = Messages.OPERATION + ":";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
        DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
        Object rowData[] = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        rowData[0] = new TableRowDivider(text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        rowData[1] = new TableRowDivider("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   316
        rowData[0] = Messages.NAME;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
        rowData[1] = mboi.getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   319
        rowData[0] = Messages.DESCRIPTION;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
        rowData[1] = mboi.getDescription();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   322
        rowData[0] = Messages.IMPACT;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
        switch (mboi.getImpact()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
            case MBeanOperationInfo.INFO:
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   325
                rowData[1] = Messages.INFO_CAPITALIZED;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
            case MBeanOperationInfo.ACTION:
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   328
                rowData[1] = Messages.ACTION_CAPITALIZED;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
            case MBeanOperationInfo.ACTION_INFO:
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   331
                rowData[1] = Messages.ACTION_INFO_CAPITALIZED;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
            case MBeanOperationInfo.UNKNOWN:
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   334
                rowData[1] = Messages.UNKNOWN_CAPITALIZED;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   338
        rowData[0] = Messages.RETURN_TYPE;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
        rowData[1] = mboi.getReturnType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
        tableModel.addRow(rowData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        addDescriptor(mboi.getDescriptor(), text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        // MBeanParameterInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        for (MBeanParameterInfo mbpi : mboi.getSignature()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
            addMBeanParameterInfo(mbpi,
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   347
                    Messages.PARAMETER + "-" + i++ + ":");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        tableModel.newDataAvailable(new TableModelEvent(tableModel));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   352
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    public void addMBeanNotificationInfo(MBeanNotificationInfo mbni) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
        emptyInfoTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        emptyDescTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   357
                Messages.MBEAN_NOTIFICATION_INFO);
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   358
        String text = Messages.NOTIFICATION + ":";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
        DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        Object rowData[] = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
        rowData[0] = new TableRowDivider(text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
        rowData[1] = new TableRowDivider("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   364
        rowData[0] = Messages.NAME;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
        rowData[1] = mbni.getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   367
        rowData[0] = Messages.DESCRIPTION;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
        rowData[1] = mbni.getDescription();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   370
        rowData[0] = Messages.NOTIF_TYPES;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        rowData[1] = Arrays.toString(mbni.getNotifTypes());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        tableModel.addRow(rowData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        addDescriptor(mbni.getDescriptor(), text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
        tableModel.newDataAvailable(new TableModelEvent(tableModel));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   377
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    private void addMBeanConstructorInfo(MBeanConstructorInfo mbci, String text) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
        DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        Object rowData[] = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
        rowData[0] = new TableRowDivider(text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
        rowData[1] = new TableRowDivider("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   384
        rowData[0] = Messages.NAME;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        rowData[1] = mbci.getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   387
        rowData[0] = Messages.DESCRIPTION;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
        rowData[1] = mbci.getDescription();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        tableModel.addRow(rowData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
        addDescriptor(mbci.getDescriptor(), text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        tableModel.newDataAvailable(new TableModelEvent(tableModel));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
55
5ecee29e98d8 6655515: MBeans tab: operation return values of type Component displayed as String
lmalvent
parents: 2
diff changeset
   394
    // Call on EDT
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
    private void addMBeanParameterInfo(MBeanParameterInfo mbpi, String text) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
        DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
        Object rowData[] = new Object[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        rowData[0] = new TableRowDivider(text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
        rowData[1] = new TableRowDivider("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   401
        rowData[0] = Messages.NAME;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
        rowData[1] = mbpi.getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   404
        rowData[0] = Messages.DESCRIPTION;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
        rowData[1] = mbpi.getDescription();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        tableModel.addRow(rowData);
12851
3334e1c781d0 7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents: 5506
diff changeset
   407
        rowData[0] = Messages.TYPE;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        rowData[1] = mbpi.getType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
        tableModel.addRow(rowData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
        addDescriptor(mbpi.getDescriptor(), text);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
        tableModel.newDataAvailable(new TableModelEvent(tableModel));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
}