1 31 32 package org.opencms.workplace.editors.directedit; 33 34 53 public final class CmsDirectEditButtonSelection { 54 55 56 public static final CmsDirectEditButtonSelection EDIT = new CmsDirectEditButtonSelection(true, false, false); 57 58 59 public static final CmsDirectEditButtonSelection EDIT_DELETE = new CmsDirectEditButtonSelection(true, true, false); 60 61 62 public static final CmsDirectEditButtonSelection EDIT_DELETE_NEW = new CmsDirectEditButtonSelection( 63 true, 64 true, 65 true); 66 67 68 public static final String VALUE_DELETE = "delete"; 69 70 71 public static final String VALUE_EDIT = "edit"; 72 73 74 public static final String VALUE_NEW = "new"; 75 76 77 private boolean m_showDelete; 78 79 80 private boolean m_showEdit; 81 82 83 private boolean m_showNew; 84 85 86 private String m_stringValue; 87 88 95 private CmsDirectEditButtonSelection(boolean showEdit, boolean showDelete, boolean showNew) { 96 97 m_showEdit = showEdit; 98 m_showDelete = showDelete; 99 m_showNew = showNew; 100 } 101 102 107 public boolean isShowDelete() { 108 109 return m_showDelete; 110 } 111 112 117 public boolean isShowEdit() { 118 119 return m_showEdit; 120 } 121 122 127 public boolean isShowNew() { 128 129 return m_showNew; 130 } 131 132 137 public String toString() { 138 139 if (m_stringValue == null) { 140 StringBuffer result = new StringBuffer (32); 141 if (m_showEdit) { 142 result.append(VALUE_EDIT); 143 } 144 result.append('|'); 145 if (m_showDelete) { 146 result.append(VALUE_DELETE); 147 } 148 result.append('|'); 149 if (m_showNew) { 150 result.append(VALUE_NEW); 151 } 152 m_stringValue = result.toString(); 153 } 154 return m_stringValue; 155 } 156 } | Popular Tags |