本文整理汇总了Java中sun.tools.jconsole.Resources.getText方法的典型用法代码示例。如果您正苦于以下问题:Java Resources.getText方法的具体用法?Java Resources.getText怎么用?Java Resources.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.tools.jconsole.Resources
的用法示例。
在下文中一共展示了Resources.getText方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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));
}
示例2: 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));
}
示例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;
}
示例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;
}
示例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);
}
示例6: 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");
}
示例7: 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));
}
示例8: 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));
}
示例9: 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));
}
示例10: 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;
}
示例11: setupDisplay
import sun.tools.jconsole.Resources; //导入方法依赖的package包/类
private void setupDisplay(XOpenTypeData data) {
setBackground(Color.white);
container =
new JScrollPane(data,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JPanel buttons = new JPanel(new FlowLayout(FlowLayout.LEFT));
tabularPrev = new JButton(Resources.getText("<"));
tabularNext = new JButton(Resources.getText(">"));
JPanel tabularButtons = new JPanel(new FlowLayout(FlowLayout.LEFT));
tabularButtons.add(tabularPrev);
tabularPrev.addActionListener(this);
tabularLabel = new JLabel(tabularNavigationSingle);
tabularLabel.setEnabled(false);
tabularButtons.add(tabularLabel);
tabularButtons.add(tabularNext);
tabularNext.addActionListener(this);
tabularButtons.setBackground(Color.white);
prev = new JButton(Resources.getText("<<"));
prev.addActionListener(this);
buttons.add(prev);
incr = new JButton(Resources.getText(">"));
incr.addActionListener(this);
decr = new JButton(Resources.getText("<"));
decr.addActionListener(this);
JPanel array = new JPanel();
array.setBackground(Color.white);
array.add(decr);
compositeLabel = new JLabel(compositeNavigationSingle);
compositeLabel.setEnabled(false);
array.add(compositeLabel);
array.add(incr);
buttons.add(array);
setLayout(new BorderLayout());
buttons.setBackground(Color.white);
JPanel navigationPanel = new JPanel(new BorderLayout());
navigationPanel.setBackground(Color.white);
navigationPanel.add(tabularButtons, BorderLayout.NORTH);
navigationPanel.add(buttons, BorderLayout.WEST);
add(navigationPanel, BorderLayout.NORTH);
add(container, BorderLayout.CENTER);
Dimension d = new Dimension((int)container.getPreferredSize().
getWidth() + 20,
(int)container.getPreferredSize().
getHeight() + 20);
setPreferredSize(d);
}
示例12: addMBeanOperationInfo
import sun.tools.jconsole.Resources; //导入方法依赖的package包/类
public void addMBeanOperationInfo(MBeanOperationInfo mboi) {
emptyInfoTable();
emptyDescTable();
((TitledBorder) infoBorderPanel.getBorder()).setTitle(
Resources.getText("MBeanOperationInfo"));
String text = Resources.getText("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[1] = mboi.getName();
tableModel.addRow(rowData);
rowData[0] = Resources.getText("Description");
rowData[1] = mboi.getDescription();
tableModel.addRow(rowData);
rowData[0] = Resources.getText("Impact");
switch (mboi.getImpact()) {
case MBeanOperationInfo.INFO:
rowData[1] = Resources.getText("INFO");
break;
case MBeanOperationInfo.ACTION:
rowData[1] = Resources.getText("ACTION");
break;
case MBeanOperationInfo.ACTION_INFO:
rowData[1] = Resources.getText("ACTION_INFO");
break;
case MBeanOperationInfo.UNKNOWN:
rowData[1] = Resources.getText("UNKNOWN");
break;
}
tableModel.addRow(rowData);
rowData[0] = Resources.getText("ReturnType");
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++ + ":");
}
tableModel.newDataAvailable(new TableModelEvent(tableModel));
}
示例13: addTableData
import sun.tools.jconsole.Resources; //导入方法依赖的package包/类
protected void addTableData(DefaultTableModel tableModel,
XMBean mbean,
MBeanAttributeInfo[] attributesInfo,
HashMap<String, Object> attributes,
HashMap<String, Object> unavailableAttributes,
HashMap<String, Object> viewableAttributes) {
Object rowData[] = new Object[2];
int col1Width = 0;
int col2Width = 0;
for (int i = 0; i < attributesInfo.length; i++) {
rowData[0] = (attributesInfo[i].getName());
if (unavailableAttributes.containsKey(rowData[0])) {
rowData[1] = Resources.getText("Unavailable");
} else if (viewableAttributes.containsKey(rowData[0])) {
rowData[1] = viewableAttributes.get(rowData[0]);
if (!attributesInfo[i].isWritable() ||
!Utils.isEditableType(attributesInfo[i].getType())) {
rowData[1] = getZoomedCell(mbean, (String) rowData[0], rowData[1]);
}
} else {
rowData[1] = attributes.get(rowData[0]);
}
tableModel.addRow(rowData);
//Update column width
//
String str = null;
if(rowData[0] != null) {
str = rowData[0].toString();
if(str.length() > col1Width)
col1Width = str.length();
}
if(rowData[1] != null) {
str = rowData[1].toString();
if(str.length() > col2Width)
col2Width = str.length();
}
}
updateColumnWidth(col1Width, col2Width);
}