1 31 32 package org.opencms.workplace.administration; 33 34 import org.opencms.workplace.CmsWorkplace; 35 import org.opencms.workplace.tools.A_CmsHtmlIconButton; 36 import org.opencms.workplace.tools.CmsHtmlIconButtonStyleEnum; 37 import org.opencms.workplace.tools.CmsToolMacroResolver; 38 39 49 public class CmsAdminMenuItem { 50 51 52 private boolean m_enabled; 53 54 55 private final String m_helpText; 56 57 58 private final String m_iconPath; 59 60 61 private final String m_id; 62 63 64 private final String m_link; 65 66 67 private final String m_name; 68 69 70 private final String m_target; 71 72 83 public CmsAdminMenuItem( 84 String id, 85 String name, 86 String iconPath, 87 String link, 88 String helpText, 89 boolean enabled, 90 String target) { 91 92 m_id = id; 93 m_name = name; 94 m_iconPath = iconPath; 95 m_link = link; 96 m_helpText = helpText; 97 m_enabled = enabled; 98 m_target = target; 99 } 100 101 106 public String getHelpText() { 107 108 return m_helpText; 109 } 110 111 116 public String getIconPath() { 117 118 return m_iconPath; 119 } 120 121 126 public String getId() { 127 128 return m_id; 129 } 130 131 136 public String getLink() { 137 138 return m_link; 139 } 140 141 146 public String getName() { 147 148 return m_name; 149 } 150 151 156 public String getTarget() { 157 158 return m_target; 159 } 160 161 166 public boolean isEnabled() { 167 168 return m_enabled; 169 } 170 171 178 public String itemHtml(CmsWorkplace wp) { 179 180 StringBuffer html = new StringBuffer (1024); 181 html.append("<table border='0' cellspacing='0' cellpadding='0' width='100%' class='node' id='"); 182 html.append(getId()); 183 html.append("'>\n"); 184 html.append("\t<tr>\n"); 185 html.append("\t\t<td>\n"); 186 String onClic = "return openView('" + getId() + "', '" + m_link + "', '" + m_target + "');"; 187 html.append(A_CmsHtmlIconButton.defaultButtonHtml( 188 wp.getJsp(), 189 CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT, 190 getId(), 191 getName(), 192 getHelpText(), 193 isEnabled(), 194 getIconPath(), 195 null, 196 onClic)); 197 198 html.append("\t\t</td>\n"); 199 html.append("\t</tr>\n"); 200 html.append("</table>\n"); 201 return CmsToolMacroResolver.resolveMacros(html.toString(), wp); 202 } 203 204 } | Popular Tags |