public CompleteButtonRepresentation() { super("completeButton"); this.onClickScript = new ScriptRepresentation(); this.onClickScript.setType("text/javascript"); this.onClickScript.setContent("document.forms[0].submit();"); }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof CompleteButtonRepresentation)) return false; CompleteButtonRepresentation other = (CompleteButtonRepresentation) obj; boolean equals = (this.text == null && other.text == null) || (this.text != null && this.text.equals(other.text)); if (!equals) return equals; equals = (this.name == null && other.name == null) || (this.name != null && this.name.equals(other.name)); if (!equals) return equals; equals = (this.id == null && other.id == null) || (this.id != null && this.id.equals(other.id)); if (!equals) return equals; equals = (this.onClickScript == null && other.onClickScript == null) || (this.onClickScript != null && this.onClickScript.equals(other.onClickScript)); if (!equals) return equals; equals = (this.i18n == null && other.i18n == null) || (this.i18n != null && this.i18n.entrySet().equals(other.i18n.entrySet())); if (!equals) return equals; equals = (this.format == null && other.format == null) || (this.format != null && this.format.equals(other.format)); return equals; }
@Override public Map<String, Object> getDataMap() { Map<String, Object> data = super.getDataMap(); data.put("text", this.text); data.put("name", this.name); data.put("id", this.id); data.put("onClickScript", this.onClickScript == null ? null : this.onClickScript.getDataMap()); data.put("i18n", this.i18n); data.put("format", this.format); return data; }
.getValue(); if (scriptMap != null) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptMap); this.eventActions.put(entry.getKey(), script); }else{
@Override public int hashCode() { int result = super.hashCode(); int aux = this.elements == null ? 0 : this.elements.hashCode(); result = 37 * result + aux; aux = this.elementsPopulationScript == null ? 0 : this.elementsPopulationScript.hashCode(); result = 37 * result + aux; aux = this.name == null ? 0 : this.name.hashCode(); result = 37 * result + aux; aux = this.id == null ? 0 : this.id.hashCode(); result = 37 * result + aux; return result; } }
@Override public Map<String, Object> getDataMap() { Map<String, Object> data = new HashMap<String, Object>(); data.put("@className", getClass().getName()); data.put("documentation", this.documentation); data.put("id", this.id); data.put("type", this.type); data.put("src", this.src); data.put("content", this.content); if (getHelpers() != null) { List<Object> helpersMap = new ArrayList<Object>(); for (ScriptData helper : getHelpers()) { helpersMap.add(helper.getDataMap()); } data.put("helpers", helpersMap); } data.put("invokeFunction", this.invokeFunction); return data; }
@Override public void setDataMap(Map<String, Object> dataMap) throws FormEncodingException { this.documentation = (String) dataMap.get("documentation"); this.id = (String) dataMap.get("id"); this.type = (String) dataMap.get("type"); this.src = (String) dataMap.get("src"); this.content = (String) dataMap.get("content"); this.invokeFunction = (String) dataMap.get("invokeFunction"); @SuppressWarnings("unchecked") List<Object> helpersMap = (List<Object>) dataMap.get("helpers"); if (helpersMap != null) { List<ScriptData> myHelpers = new ArrayList<ScriptData>(); for (Object obj : helpersMap) { try { @SuppressWarnings("unchecked") Map<String, Object> helperMap = (Map<String, Object>) obj; String helperClass = (String) helperMap.get("@className"); // FBScriptHelper helper = (FBScriptHelper) ReflectionHelper // .newInstance(helperClass); Class<?> clazz = Class.forName(helperClass); //TODO porting ScriptData helper = (ScriptData) clazz.newInstance(); helper.setDataMap(helperMap); } catch (Exception e) { throw new FormEncodingException("Problem creating helper " + obj, e); } } setHelpers(myHelpers); } }
.getValue(); if (scriptMap != null) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptMap); this.eventActions.put(entry.getKey(), script); }else{
@Override public int hashCode() { int result = super.hashCode(); int aux = this.elements == null ? 0 : this.elements.hashCode(); result = 37 * result + aux; aux = this.elementsPopulationScript == null ? 0 : this.elementsPopulationScript.hashCode(); result = 37 * result + aux; aux = this.name == null ? 0 : this.name.hashCode(); result = 37 * result + aux; aux = this.id == null ? 0 : this.id.hashCode(); result = 37 * result + aux; return result; } }
@Override public Map<String, Object> getDataMap() { Map<String, Object> data = new HashMap<String, Object>(); data.put("@className", getClass().getName()); data.put("documentation", this.documentation); data.put("id", this.id); data.put("type", this.type); data.put("src", this.src); data.put("content", this.content); if (getHelpers() != null) { List<Object> helpersMap = new ArrayList<Object>(); for (ScriptData helper : getHelpers()) { helpersMap.add(helper.getDataMap()); } data.put("helpers", helpersMap); } data.put("invokeFunction", this.invokeFunction); return data; }
@Override public void setDataMap(Map<String, Object> dataMap) throws FormEncodingException { this.documentation = (String) dataMap.get("documentation"); this.id = (String) dataMap.get("id"); this.type = (String) dataMap.get("type"); this.src = (String) dataMap.get("src"); this.content = (String) dataMap.get("content"); this.invokeFunction = (String) dataMap.get("invokeFunction"); @SuppressWarnings("unchecked") List<Object> helpersMap = (List<Object>) dataMap.get("helpers"); if (helpersMap != null) { List<ScriptData> myHelpers = new ArrayList<ScriptData>(); for (Object obj : helpersMap) { try { @SuppressWarnings("unchecked") Map<String, Object> helperMap = (Map<String, Object>) obj; String helperClass = (String) helperMap.get("@className"); // FBScriptHelper helper = (FBScriptHelper) ReflectionHelper // .newInstance(helperClass); Class<?> clazz = Class.forName(helperClass); //TODO porting ScriptData helper = (ScriptData) clazz.newInstance(); helper.setDataMap(helperMap); } catch (Exception e) { throw new FormEncodingException("Problem creating helper " + obj, e); } } setHelpers(myHelpers); } }
public CompleteButtonRepresentation() { super("completeButton"); this.onClickScript = new ScriptRepresentation(); this.onClickScript.setType("text/javascript"); this.onClickScript.setContent("document.forms[0].submit();"); }
if (loadScriptsRep != null) { for (FormBuilderDTOHelper scriptRep : loadScriptsRep) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptRep.getMap()); this.onLoadScripts.add(script); if (submitScriptsRep != null) { for (FormBuilderDTOHelper scriptRep : submitScriptsRep) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptRep.getMap()); this.onSubmitScripts.add(script);
@Override public Map<String, Object> getDataMap() { Map<String, Object> data = super.getDataMap(); data.put("text", this.text); data.put("name", this.name); data.put("id", this.id); data.put("onClickScript", this.onClickScript == null ? null : this.onClickScript.getDataMap()); data.put("i18n", this.i18n); data.put("format", this.format); return data; }
@Override public int hashCode() { int result = super.hashCode(); int aux = this.text == null ? 0 : this.text.hashCode(); result = 37 * result + aux; aux = this.name == null ? 0 : this.name.hashCode(); result = 37 * result + aux; aux = this.id == null ? 0 : this.id.hashCode(); result = 37 * result + aux; aux = this.onClickScript == null ? 0 : this.onClickScript.hashCode(); result = 37 * result + aux; aux = this.i18n == null ? 0 : this.i18n.hashCode(); result = 37 * result + aux; aux = this.format == null ? 0 : this.format.hashCode(); result = 37 * result + aux; return result; } }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof ComboBoxRepresentation)) return false; ComboBoxRepresentation other = (ComboBoxRepresentation) obj; boolean equals = (this.elements == null && other.elements == null) || (this.elements != null && this.elements.equals(other.elements)); if (!equals) return equals; equals = (this.elementsPopulationScript == null && other.elementsPopulationScript == null) || (this.elementsPopulationScript != null && this.elementsPopulationScript.equals(other.elementsPopulationScript)); if (!equals) return equals; equals = (this.name == null && other.name == null) || (this.name != null && this.name.equals(other.name)); if (!equals) return equals; equals = (this.id == null && other.id == null) || (this.id != null && this.id.equals(other.id)); return equals; }
if (loadScriptsRep != null) { for (FormBuilderDTOHelper scriptRep : loadScriptsRep) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptRep.getMap()); this.onLoadScripts.add(script); if (submitScriptsRep != null) { for (FormBuilderDTOHelper scriptRep : submitScriptsRep) { ScriptRepresentation script = new ScriptRepresentation(); script.setDataMap(scriptRep.getMap()); this.onSubmitScripts.add(script);
@Override public Map<String, Object> getDataMap() { Map<String, Object> data = super.getDataMap(); data.put("name", this.name); data.put("id", this.id); List<Map<String, Object>> elementsAsMap = new ArrayList<Map<String, Object>>(); if (this.elements != null) { for (OptionRepresentation option : this.elements) { elementsAsMap.add(option.getDataMap()); } } data.put("elements", elementsAsMap); data.put("elementsPopulationScript", this.elementsPopulationScript == null ? null : this.elementsPopulationScript.getDataMap()); return data; }
@Override public int hashCode() { int result = super.hashCode(); int aux = this.text == null ? 0 : this.text.hashCode(); result = 37 * result + aux; aux = this.name == null ? 0 : this.name.hashCode(); result = 37 * result + aux; aux = this.id == null ? 0 : this.id.hashCode(); result = 37 * result + aux; aux = this.onClickScript == null ? 0 : this.onClickScript.hashCode(); result = 37 * result + aux; aux = this.i18n == null ? 0 : this.i18n.hashCode(); result = 37 * result + aux; aux = this.format == null ? 0 : this.format.hashCode(); result = 37 * result + aux; return result; } }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof ComboBoxRepresentation)) return false; ComboBoxRepresentation other = (ComboBoxRepresentation) obj; boolean equals = (this.elements == null && other.elements == null) || (this.elements != null && this.elements.equals(other.elements)); if (!equals) return equals; equals = (this.elementsPopulationScript == null && other.elementsPopulationScript == null) || (this.elementsPopulationScript != null && this.elementsPopulationScript.equals(other.elementsPopulationScript)); if (!equals) return equals; equals = (this.name == null && other.name == null) || (this.name != null && this.name.equals(other.name)); if (!equals) return equals; equals = (this.id == null && other.id == null) || (this.id != null && this.id.equals(other.id)); return equals; }