1 32 33 package websphinx.workbench; 34 35 import websphinx.*; 36 37 public class HighlightAction implements Action { 38 String color; 39 String scale; 40 String icon; 41 public HighlightAction (String color, String scale, String icon) { 42 this.color = color; 43 this.scale = scale; 44 this.icon = icon; 45 } 46 47 public boolean equals (Object object) { 48 if (! (object instanceof HighlightAction)) 49 return false; 50 HighlightAction a = (HighlightAction)object; 51 return same (a.color, color) 52 && same (a.scale, scale) 53 && same (a.icon, icon); 54 } 55 56 private boolean same (String s1, String s2) { 57 if (s1 == null || s2 == null) 58 return s1 == s2; 59 else 60 return s1.equals (s2); 61 } 62 63 public String getColor () { 64 return color; 65 } 66 67 public String getScale () { 68 return scale; 69 } 70 71 public String getIcon () { 72 return icon; 73 } 74 75 public void connected (Crawler crawler) {} 76 public void disconnected (Crawler crawler) {} 77 78 public void visit (Page page) { 79 if (color != null) 80 page.setLabel ("Workbench.color", color); 81 if (scale != null) 82 page.setLabel ("Workbench.scale", color); 83 if (icon != null) 84 page.setLabel ("Workbench.icon", color); 85 } 86 } 87 88 | Popular Tags |