1 25 26 package net.killingar.forum.actions.area.customizer; 27 28 import net.killingar.forum.actions.area.AbstractAreaCustomizer; 29 import net.killingar.forum.actions.area.EditMessage; 30 import net.killingar.forum.actions.area.WriteMessage; 31 import net.killingar.forum.internal.FieldData; 32 33 public abstract class AbstractParameterizedCustomizer extends AbstractAreaCustomizer 34 { 35 37 public boolean addMessagePreProccess(WriteMessage in) 39 { 40 return editMessagePreProccess(in); 41 } 42 43 abstract protected void updateParams(FieldData f); 44 45 public boolean editMessagePreProccess(EditMessage in) 46 { 47 if (in.replyMessageID == -1) 48 { 49 FieldData f = new FieldData(); 50 updateParams(f); 51 52 in.body = f.encodeFieldData(); 53 in.subject = "subject"; 54 } 55 56 return true; 57 } 58 59 public void preview(EditMessage in, FieldData f) 60 { 61 if (in.replyMessageID == -1) 62 { 63 updateParams(f); 64 65 in.body = f.encodeFieldData(); 66 in.subject = "subject"; 67 } 68 } 69 70 public void previewMessage(WriteMessage in) 71 { 72 preview(in, new FieldData(in.body)); 73 } 74 75 77 79 } | Popular Tags |