1 package net.sourceforge.formview.util; 2 3 import net.sourceforge.formview.FormView; 4 import net.sourceforge.formview.FormViewResources; 5 import net.sourceforge.formview.permission.IPermissionsAdapter; 6 7 public class ApplicationFormViewUtil { 8 9 private static FormViewResources resources = null; 10 11 public static void init(FormViewResources r) { 12 resources = r; 13 } 14 15 protected static FormViewResources getFormViewResources() { 16 if (resources == null) { 17 throw new IllegalArgumentException ("Resources cannot be null."); 18 } 19 return resources; 20 } 21 22 public static FormView getFormView(String formName, String state) { 23 return getFormViewResources().getForm(formName, state); 24 } 25 26 public static String processHtmlContent(FormView form, String state, IPermissionsAdapter permissionsAdapter, String htmlContent) { 27 return getFormViewResources().processHtmlContent(form, state, permissionsAdapter, htmlContent); 28 } 29 } 30 | Popular Tags |