1 31 32 package org.opencms.workplace.list; 33 34 import org.opencms.workplace.CmsWorkplace; 35 import org.opencms.workplace.tools.A_CmsHtmlIconButton; 36 import org.opencms.workplace.tools.CmsHtmlIconButtonStyleEnum; 37 38 47 public class CmsListItemSelectionAction extends CmsListDirectAction { 48 49 50 private final String m_multiActionId; 51 52 53 private String m_selectedItemId; 54 55 61 public CmsListItemSelectionAction(String id, String multiActionId) { 62 63 super(id); 64 m_multiActionId = multiActionId; 65 } 66 67 70 public String buttonHtml(CmsWorkplace wp) { 71 72 if (!isVisible()) { 73 return ""; 74 } 75 String html = "<input type='radio' value='" + getItem().getId() + "' name='" + getListId() + getId() + "'"; 76 if (!isEnabled()) { 77 html += " disabled"; 78 } 79 if (getItem().getId().equals(getSelectedItemId())) { 80 html += " checked"; 81 } 82 html += ">\n"; 83 return A_CmsHtmlIconButton.defaultButtonHtml( 84 wp.getJsp(), 85 CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT, 86 getId(), 87 html, 88 getHelpText().key(wp.getLocale()), 89 true, 90 null, 91 null, 92 null); 93 } 94 95 100 public String getMultiActionId() { 101 102 return m_multiActionId; 103 } 104 105 110 public String getSelectedItemId() { 111 112 return m_selectedItemId; 113 } 114 115 120 public void setSelectedItemId(String selectedItemId) { 121 122 m_selectedItemId = selectedItemId; 123 } 124 } 125 | Popular Tags |