< prev index next >

src/share/classes/sun/tools/jconsole/BorderedComponent.java

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

@@ -31,26 +31,23 @@
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.BasicGraphicsUtils;
 
+
 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 +95,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 +131,12 @@
     }
 
     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 {
< prev index next >