1 13 package info.magnolia.cms.gui.control; 14 15 import info.magnolia.cms.util.FreeMarkerUtil; 16 17 import java.util.HashMap ; 18 import java.util.Map ; 19 20 21 25 public class FunctionBar extends ContextMenu { 26 27 30 private String javascriptName; 31 32 35 private boolean searchable = false; 36 37 40 private String onSearchFunction = "function(val){alert(val)}"; 41 42 45 private String searchStr = ""; 46 47 50 public FunctionBar(String menuName) { 51 super(menuName); 52 this.javascriptName = "mgnlFunctionBar"; 53 } 54 55 58 public String getHtml() { 59 Map params = new HashMap (); 60 params.put("functionBar", this); 61 return FreeMarkerUtil.process("info/magnolia/cms/gui/control/FunctionBar.ftl", params); 62 } 63 64 67 public String getJavascript() { 68 Map params = new HashMap (); 69 params.put("functionBar", this); 70 return FreeMarkerUtil.process("info/magnolia/cms/gui/control/FunctionBarJavascript.ftl", params); 71 } 72 73 76 public boolean hasMenuItems() { 77 return !this.getMenuItems().isEmpty(); 78 } 79 80 83 public String getJavascriptName() { 84 return javascriptName; 85 } 86 87 90 public void setJavascriptName(String javascriptName) { 91 this.javascriptName = javascriptName; 92 } 93 94 97 public boolean isSearchable() { 98 return this.searchable; 99 } 100 101 104 public void setSearchable(boolean searchable) { 105 this.searchable = searchable; 106 } 107 108 111 public String getOnSearchFunction() { 112 return this.onSearchFunction; 113 } 114 115 118 public void setOnSearchFunction(String onSearch) { 119 this.onSearchFunction = onSearch; 120 } 121 122 125 public String getSearchStr() { 126 return this.searchStr; 127 } 128 129 132 public void setSearchStr(String searchStr) { 133 this.searchStr = searchStr; 134 } 135 } 136 | Popular Tags |