1 13 package info.magnolia.cms.gui.control; 14 15 import java.util.Iterator ; 16 17 18 22 public class FunctionBarItem extends ContextMenuItem { 23 24 private boolean active = false; 25 26 public FunctionBarItem(String name) { 27 super(name); 28 this.active = false; 29 } 30 31 35 public FunctionBarItem(ContextMenuItem item) { 36 this.setName(item.getName()); 37 this.setLabel(item.getLabel()); 38 if (item.getIcon() != null) { 39 this.setIcon(item.getIcon().replaceFirst("/16/", "/24/")); 40 } 41 this.setJavascriptMenuName(item.getJavascriptMenuName()); 42 this.setOnclick(item.getOnclick()); 43 java.util.List jsConds = item.getJavascriptConditions(); 44 for (Iterator iter = jsConds.iterator(); iter.hasNext();) { 45 String condition = (String ) iter.next(); 46 this.addJavascriptCondition(condition); 47 } 49 this.active = false; 50 } 51 52 55 public boolean isActive() { 56 return active; 57 } 58 59 62 public void setActive(boolean active) { 63 this.active = active; 64 } 65 66 70 public String getInactiveIcon() { 71 if (super.getIcon() != null) { 72 return super.getIcon().replaceFirst(".gif", "_inactive.gif"); 73 } 74 return null; 75 } 76 } 77 | Popular Tags |