src/share/classes/sun/tools/jconsole/BorderedComponent.java
Print this page
rev 5340 : 7017818: NLS: JConsoleResources.java cannot be handled by translation team
Reviewed-by: duke
@@ -31,26 +31,24 @@
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.BasicGraphicsUtils;
+import sun.tools.jconsole.resources.Messages;
+
import static javax.swing.SwingConstants.*;
import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
-import static sun.tools.jconsole.Utilities.*;
@SuppressWarnings("serial")
public class BorderedComponent extends JPanel implements ActionListener {
JButton moreOrLessButton;
String valueLabelStr;
JLabel label;
JComponent comp;
boolean collapsed = false;
- private JPopupMenu popupMenu;
-
private Icon collapseIcon;
private Icon expandIcon;
private static Image getImage(String name) {
Toolkit tk = Toolkit.getDefaultToolkit();
@@ -98,11 +96,11 @@
moreOrLessButton.setContentAreaFilled(false);
moreOrLessButton.setBorderPainted(false);
moreOrLessButton.setMargin(new Insets(0, 0, 0, 0));
moreOrLessButton.addActionListener(this);
String toolTip =
- getText("BorderedComponent.moreOrLessButton.toolTip");
+ Messages.BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP;
moreOrLessButton.setToolTipText(toolTip);
borderLabel.add(moreOrLessButton);
borderLabel.setSize(borderLabel.getPreferredSize());
add(borderLabel);
} else {
@@ -134,11 +132,11 @@
}
public void setValueLabel(String str) {
this.valueLabelStr = str;
if (label != null) {
- label.setText(Resources.getText("Current value",valueLabelStr));
+ label.setText(Resources.format(Messages.CURRENT_VALUE, valueLabelStr));
}
}
public void actionPerformed(ActionEvent ev) {
if (collapsed) {
@@ -149,11 +147,11 @@
moreOrLessButton.setIcon(collapseIcon);
} else {
remove(comp);
if (valueLabelStr != null) {
if (label == null) {
- label = new JLabel(Resources.getText("Current value",
+ label = new JLabel(Resources.format(Messages.CURRENT_VALUE,
valueLabelStr));
}
add(label);
}
moreOrLessButton.setIcon(expandIcon);
@@ -437,12 +435,10 @@
* Reinitialize the insets parameter with this Border's current Insets.
* @param c the component for which this border insets value applies
* @param insets the object to be reinitialized
*/
public Insets getBorderInsets(Component c, Insets insets) {
- int height = 16;
-
Border border = getBorder();
if (border != null) {
if (border instanceof AbstractBorder) {
((AbstractBorder)border).getBorderInsets(c, insets);
} else {