1 4 package org.jahia.data.fields; 5 6 import org.jahia.exceptions.JahiaException; 7 import org.jahia.params.ParamBean; 8 import org.jahia.services.fields.ContentField; 9 10 14 public class JahiaColorField extends JahiaSmallTextField implements JahiaAllowApplyChangeToAllLangField 15 { 16 17 18 public JahiaColorField( Integer ID, 19 Integer jahiaID, 20 Integer pageID, 21 Integer ctnid, 22 Integer fieldDefID, 23 Integer fieldType, 24 Integer connectType, 25 String fieldValue, 26 Integer rank, 27 Integer aclID, 28 Integer versionID, 29 Integer versionStatus, 30 String languageCode) 31 { 32 super(ID, jahiaID, pageID, ctnid, fieldDefID, fieldType, connectType, 33 fieldValue, rank, aclID, versionID, versionStatus, languageCode); 34 35 if ( isShared() ){ 36 this.languageCode = ContentField.SHARED_LANGUAGE; 37 } 38 39 } 41 42 public Object clone() 43 { 44 Object objItem = this.getObject(); 45 46 JahiaColorField st = new JahiaColorField ( 47 new Integer (ID), 48 new Integer (jahiaID), 49 new Integer (pageID), 50 new Integer (ctnid), 51 new Integer (fieldDefID), 52 new Integer (fieldType), 53 new Integer (connectType), 54 fieldValue, new Integer (rank), 55 new Integer (aclID), 56 new Integer (versionID), 57 new Integer (workflowState), 58 new String (getLanguageCode()) ); 59 st.setObject(objItem); 60 return st; 61 } 62 63 66 public boolean isShared (){ 67 return true; 68 } 69 70 76 public void copyValueInAnotherLanguage (JahiaField aField,ParamBean jParams) 77 throws JahiaException { 78 if ( aField == null ){ 79 return; 80 } 81 aField.setValue(this.getValue()); 82 aField.setRawValue(this.getValue()); 83 aField.setObject(this.getObject()); 84 } 85 86 } 87 | Popular Tags |