当前位置: 首页>>代码示例>>Java>>正文


Java Resources类代码示例

本文整理汇总了Java中sun.tools.jconsole.Resources的典型用法代码示例。如果您正苦于以下问题:Java Resources类的具体用法?Java Resources怎么用?Java Resources使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Resources类属于sun.tools.jconsole包,在下文中一共展示了Resources类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addMBeanNotificationInfo

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public void addMBeanNotificationInfo(MBeanNotificationInfo mbni) {
    emptyInfoTable();
    emptyDescTable();
    ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
            Resources.getText("MBeanNotificationInfo"));
    String text = Resources.getText("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[1] = mbni.getName();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Description");
    rowData[1] = mbni.getDescription();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("NotifTypes");
    rowData[1] = Arrays.toString(mbni.getNotifTypes());
    tableModel.addRow(rowData);
    addDescriptor(mbni.getDescriptor(), text);
    tableModel.newDataAvailable(new TableModelEvent(tableModel));
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:24,代码来源:XMBeanInfo.java

示例2: addMBeanParameterInfo

import sun.tools.jconsole.Resources; //导入依赖的package包/类
private void addMBeanParameterInfo(MBeanParameterInfo mbpi, String text) {
    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[1] = mbpi.getName();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Description");
    rowData[1] = mbpi.getDescription();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Type");
    rowData[1] = mbpi.getType();
    tableModel.addRow(rowData);
    addDescriptor(mbpi.getDescriptor(), text);
    tableModel.newDataAvailable(new TableModelEvent(tableModel));
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:19,代码来源:XMBeanInfo.java

示例3: getToolTip

import sun.tools.jconsole.Resources; //导入依赖的package包/类
@Override
public String getToolTip(int row, int column) {
    if (isCellError(row, column)) {
        return (String) unavailableAttributes.get(getValueName(row));
    }
    if (isColumnEditable(column)) {
        Object value = getValue(row);
        String tip = null;
        if (value != null) {
            tip = value.toString();
            if(isAttributeViewable(row, VALUE_COLUMN))
                tip = Resources.getText("Double click to expand/collapse")+
                    ". " + tip;
        }

        return tip;
    }

    if(column == NAME_COLUMN) {
        int index = convertRowToIndex(row);
        if (index != -1) {
            return attributesInfo[index].getDescription();
        }
    }
    return null;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:27,代码来源:XMBeanAttributes.java

示例4: getToolTip

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public String getToolTip(int row, int col) {
    if(col == 1) {
        Object value = getModel().getValueAt(row, col);
        if (value != null) {
            if(isClickableElement(value))
                return Resources.getText("Double click to visualize")
                + ". " + value.toString();
            else
                return value.toString();
        }
    }
    return null;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:14,代码来源:XOpenTypeViewer.java

示例5: viewed

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public void viewed(XOpenTypeViewer viewer) throws Exception {
    if (size == 0)
        throw new Exception(Resources.getText("Empty array"));
    if (dimension > 1)
        throw new Exception(Resources.getText("Dimension is not " +
                "supported:") +
                dimension);
    super.viewed(viewer);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:10,代码来源:XOpenTypeViewer.java

示例6: toString

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public String toString() {
    if (dimension > 1) {
        return Resources.getText("Dimension is not supported:") +
                dimension;
    } else {
        return elemType.getTypeName() + "[" + size + "]";
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:9,代码来源:XOpenTypeViewer.java

示例7: performInvokeRequest

import sun.tools.jconsole.Resources; //导入依赖的package包/类
void performInvokeRequest(final JButton button) {
    final OperationEntry entryIf = operationEntryTable.get(button);
    new SwingWorker<Object, Void>() {
        @Override
        public Object doInBackground() throws Exception {
            return mbean.invoke(button.getText(),
                    entryIf.getParameters(), entryIf.getSignature());
        }
        @Override
        protected void done() {
            try {
                Object result = get();
                // sends result notification to upper level if
                // there is a return value
                if (entryIf.getReturnType() != null &&
                        !entryIf.getReturnType().equals(Void.TYPE.getName()) &&
                        !entryIf.getReturnType().equals(Void.class.getName())) {
                    fireChangedNotification(OPERATION_INVOCATION_EVENT, button, result);
                } else {
                    new ThreadDialog(
                            button,
                            Resources.getText("Method successfully invoked"),
                            Resources.getText("Info"),
                            JOptionPane.INFORMATION_MESSAGE).run();
                }
            } catch (Throwable t) {
                t = Utils.getActualException(t);
                if (JConsole.isDebug()) {
                    t.printStackTrace();
                }
                new ThreadDialog(
                        button,
                        Resources.getText("Problem invoking") + " " +
                        button.getText() + " : " + t.toString(),
                        Resources.getText("Error"),
                        JOptionPane.ERROR_MESSAGE).run();
            }
        }
    }.execute();
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:41,代码来源:XOperations.java

示例8: getActionLabel

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public static String getActionLabel(int type) {
    if(type == ARRAY ||
       type == OPEN)
        return Resources.getText("visualize");
    if(type == NUMERIC)
        return Resources.getText("plot");
    return Resources.getText("expand");
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:9,代码来源:XDataViewer.java

示例9: addMBeanInfo

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public void addMBeanInfo(XMBean mbean, MBeanInfo mbeanInfo) {
    emptyInfoTable();
    emptyDescTable();
    ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
            Resources.getText("MBeanInfo"));
    String text = Resources.getText("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[1] = mbean.getObjectName();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("ClassName");
    rowData[1] = mbeanInfo.getClassName();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("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 + ":");
        // MBeanParameterInfo
        //
        int j = 0;
        for (MBeanParameterInfo mbpi : mbci.getSignature()) {
            addMBeanParameterInfo(mbpi,
                    Resources.getText("Parameter") + "-" + i + "-" + j + ":");
            j++;
        }
        i++;
    }
    tableModel.newDataAvailable(new TableModelEvent(tableModel));
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:40,代码来源:XMBeanInfo.java

示例10: addMBeanAttributeInfo

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public void addMBeanAttributeInfo(MBeanAttributeInfo mbai) {
    emptyInfoTable();
    emptyDescTable();
    ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
            Resources.getText("MBeanAttributeInfo"));
    String text = Resources.getText("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[1] = mbai.getName();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Description");
    rowData[1] = mbai.getDescription();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Readable");
    rowData[1] = mbai.isReadable();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Writable");
    rowData[1] = mbai.isWritable();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Is");
    rowData[1] = mbai.isIs();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Type");
    rowData[1] = mbai.getType();
    tableModel.addRow(rowData);
    addDescriptor(mbai.getDescriptor(), text);
    tableModel.newDataAvailable(new TableModelEvent(tableModel));
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:33,代码来源:XMBeanInfo.java

示例11: addMBeanConstructorInfo

import sun.tools.jconsole.Resources; //导入依赖的package包/类
private void addMBeanConstructorInfo(MBeanConstructorInfo mbci, String text) {
    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[1] = mbci.getName();
    tableModel.addRow(rowData);
    rowData[0] = Resources.getText("Description");
    rowData[1] = mbci.getDescription();
    tableModel.addRow(rowData);
    addDescriptor(mbci.getDescriptor(), text);
    tableModel.newDataAvailable(new TableModelEvent(tableModel));
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:16,代码来源:XMBeanInfo.java

示例12: getCellRenderer

import sun.tools.jconsole.Resources; //导入依赖的package包/类
@Override
public synchronized TableCellRenderer getCellRenderer(int row, int column) {
    //In case we have a repaint thread that is in the process of
    //repainting an obsolete table, just ignore the call.
    //It can happen when MBean selection is switched at a very quick rate
    if (row >= getRowCount()) {
        return null;
    }

    DefaultTableCellRenderer renderer;
    String toolTip = null;
    UserDataCell cell = getUserDataCell(row, column);
    if (cell != null && cell.isInited()) {
        renderer = (DefaultTableCellRenderer) cell.getRenderer();
    } else {
        renderer =
                (DefaultTableCellRenderer) super.getCellRenderer(row, column);
    }

    if (cell != null) {
        toolTip = Resources.getText("Double click to expand/collapse") +
                ". " + cell.toString();
    } else {
        Object val =
                ((DefaultTableModel) getModel()).getValueAt(row, column);
        if (val != null) {
            toolTip = val.toString();
        }
    }

    renderer.setToolTipText(toolTip);

    return renderer;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:35,代码来源:XMBeanNotifications.java

示例13: isColumnEditable

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public boolean isColumnEditable(int column) {
    if (column < getColumnCount()) {
        return getColumnName(column).equals(Resources.getText("Value"));
    }
    else {
        return false;
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:9,代码来源:XMBeanAttributes.java

示例14: popupAndLog

import sun.tools.jconsole.Resources; //导入依赖的package包/类
private void popupAndLog(Throwable ex, String method, String key) {
    ex = Utils.getActualException(ex);
    if (JConsole.isDebug()) ex.printStackTrace();

    String message = (ex.getMessage() != null) ? ex.getMessage()
            : ex.toString();
    EventQueue.invokeLater(
            new ThreadDialog(component, message+"\n",
                             Resources.getText(key),
                             JOptionPane.ERROR_MESSAGE));
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:12,代码来源:XMBeanAttributes.java

示例15: main

import sun.tools.jconsole.Resources; //导入依赖的package包/类
public static void main(String... args) {
    List<String> errors = new ArrayList<>();
    // Ensure that all Message fields have a corresponding key/value
    // in the resource bundle and that mnemonics can be looked
    // up where applicable.
    ResourceBundle rb = ResourceBundle.getBundle(RESOURCE_BUNDLE);
    for (Field field : Messages.class.getFields()) {
        if (isResourceKeyField(field)) {
            String resourceKey = field.getName();
            String message = readField(field);
            if (message.startsWith(MISSING_RESOURCE_KEY_PREFIX)) {
                errors.add("Can't find message (and perhaps mnemonic) for "
                        + Messages.class.getSimpleName() + "."
                        + resourceKey + " in resource bundle.");
            } else {
                String resourceMessage = rb.getString(resourceKey);
                if (hasMnemonicIdentifier(resourceMessage)) {
                    int mi = Resources.getMnemonicInt(message);
                    if (mi == 0) {
                        errors.add("Could not look up mnemonic for message '"
                                + message + "'.");
                    }
                }
            }
        }
    }

    // Ensure that there is Message class field for every resource key.
    for (String key : Collections.list(rb.getKeys())) {
        try {
            Messages.class.getField(key);
        } catch (NoSuchFieldException nfe) {
            errors.add("Can't find static field ("
                    + Messages.class.getSimpleName() + "." + key
                    + ") matching '" + key
                    + "' in resource bundle. Unused message?");
        }
    }

    if (errors.size() > 0) {
        throwError(errors);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:44,代码来源:ResourceCheckTest.java


注:本文中的sun.tools.jconsole.Resources类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。