View Javadoc

1   package org.catacomb.druid.gui.base;
2   
3   import java.awt.Color;
4   
5   import org.catacomb.druid.swing.DLabel;
6   import org.catacomb.interlish.structure.Receiver;
7   import org.catacomb.interlish.structure.StatusDisplay;
8   
9   public class DruStatusBar extends DruPanel implements Receiver, StatusDisplay {
10      static final long serialVersionUID = 1001;
11  
12      DLabel label;
13  
14  
15  
16      public DruStatusBar() {
17          label = new DLabel(" messages ");
18  
19          addSingleDComponent(label);
20      }
21  
22  
23  
24      public void showStatus(String txt) {
25          // wrap markup in <html> if not there to tell label to render as html;
26          if (txt.indexOf("/>") > 0 || txt.indexOf("</") > 0) {
27              if (txt.startsWith("<html>")) {
28                  label.setText(txt);
29              } else {
30                  label.setText("<html>" + txt + "</html>");
31              }
32  
33          } else {
34              label.setText(txt);
35          }
36  
37      }
38  
39  
40      public void setBg(Color c) {
41          super.setBg(c);
42          label.setBg(c);
43      }
44  
45  
46  
47  }