home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / IBM VisualAge for Java Enterprise v4.0 Retail / ivj40 / setup / IDE.Cab / F77449_VAJava2StatusLabelUI.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-04-25  |  1.3 KB  |  39 lines

  1. package com.ibm.ivb.jface.vajava2;
  2.  
  3. import com.ibm.ivb.jface.parts.StatusLabel;
  4. import com.ibm.ivb.jface.plaf.StatusLabelUI;
  5. import javax.swing.JComponent;
  6. import javax.swing.border.Border;
  7. import javax.swing.border.CompoundBorder;
  8. import javax.swing.border.EmptyBorder;
  9. import javax.swing.plaf.ComponentUI;
  10.  
  11. public class VAJava2StatusLabelUI extends StatusLabelUI {
  12.    private static final String kCBIBMCopyright = "(c) Copyright IBM Corporation 1998";
  13.    protected static VAJava2StatusLabelUI labelUI;
  14.    protected static Border border;
  15.  
  16.    public static ComponentUI createUI(JComponent var0) {
  17.       if (labelUI == null) {
  18.          labelUI = new VAJava2StatusLabelUI();
  19.          border = new CompoundBorder(new StatusBorder(), new EmptyBorder(0, 5, 0, 5));
  20.       }
  21.  
  22.       return labelUI;
  23.    }
  24.  
  25.    public void installUI(JComponent var1) {
  26.       super.installUI(var1);
  27.       StatusLabel var2 = (StatusLabel)var1;
  28.       ((JComponent)var2).setBorder(border);
  29.    }
  30.  
  31.    public void uninstallUI(JComponent var1) {
  32.       super.uninstallUI(var1);
  33.       if (var1.getBorder() == border) {
  34.          var1.setBorder((Border)null);
  35.       }
  36.  
  37.    }
  38. }
  39.