Field old = getField(fieldKey); getFieldMap().remove(fieldKey); lFields.remove(old);
private void checkForm(Locale locale, String formKey, String expectedVarValue) { // Retrieve the Form Form testForm = resources.getForm(locale, formKey); assertNotNull("Form '" +formKey+"' null for locale " + locale, testForm); // Validate the expected Form is retrieved by checking the "localeVar" // value of the field. Field testField = testForm.getField("testProperty"); assertEquals("Incorrect Form '" + formKey + "' for locale '" + locale + "'", expectedVarValue, testField.getVarValue("localeVar")); }
Field old = getField(fieldKey); hFields.remove(fieldKey); lFields.remove(old);
Field field1 = form1.getField("testProperty1"); assertEquals("testProperty1 - const 1", "testConstValue1", field1.getVarValue("var11")); assertEquals("testProperty1 - const 2", "testConstValue2", field1.getVarValue("var12")); Field field2 = form2.getField("testProperty2"); assertEquals("testProperty2 - const 1", "testConstValue1", field2.getVarValue("var21")); assertEquals("testProperty2 - const 2", "testConstValue2", field2.getVarValue("var22")); Field field1_fr = form1_fr.getField("testProperty1_fr"); assertEquals("testProperty1_fr - const 1", "testConstValue1_fr", field1_fr.getVarValue("var11_fr")); assertEquals("testProperty1_fr - const 2", "testConstValue2_fr", field1_fr.getVarValue("var12_fr")); Field field2_fr = form2_fr.getField("testProperty2_fr"); assertEquals("testProperty2_fr - const 1", "testConstValue1_fr", field2_fr.getVarValue("var21_fr")); assertEquals("testProperty2_fr - const 2", "testConstValue2_fr", field2_fr.getVarValue("var22_fr"));
Field old = getField(fieldKey); getFieldMap().remove(fieldKey); lFields.remove(old);
Field field1 = form.getField("field-1"); assertNotNull("field-1 is null.", field1); assertEquals("field-1 property is wrong", "field-1", field1.getProperty()); Field field2 = form.getField("field-2"); assertNotNull("field-2 is null.", field2); assertEquals("field-2 property is wrong", "field-2", field2.getProperty());
Form form = chat.getConfigurationForm(); String value = form.getField("muc#roomconfig_roomname").getValues().next();
/** * Attempts to retrieve the form field from the form with the given <code>formName</code> * and the field with the given <code>fieldName</code>. If it can't be retrieved, null * is returned. * @param form the form to validate. * @param fieldName the name of the field. * @return the found field or null if it could not be found. */ private Field getFormField( final Form form, final String fieldName) { Field field = null; if (form != null) { field = form.getField(fieldName); } return field; }
public List<Field> getAllFields(Form form) { Collection<?> propertyIds = form.getItemPropertyIds(); List<Field> fields = new ArrayList<Field>(propertyIds.size()); for (Object itemPropertyId : propertyIds) { fields.add(form.getField(itemPropertyId)); } return fields; }
protected boolean registeredField(Form form, Field field, PropertyDesc propDesc) { String key = getFieldKey(field, propDesc); return form.getField(key) != null; }
public int offlinemessagecount(){ try { ServiceDiscoveryManager manager = ServiceDiscoveryManager .getInstanceFor(connection); DiscoverInfo info = manager.discoverInfo(null, "http://jabber.org/protocol/offline"); Form extendedInfo = Form.getFormFrom(info); if (extendedInfo != null) { String value = extendedInfo.getField("number_of_messages") .getValues().next(); return Integer.parseInt(value); } } catch (Exception e) { e.printStackTrace(); } return 0; }
if (!result.isValid(actionName)) Field field = form.getField(property); Arg[] args = field.getArgs(actionName); if(args != null)
Field field = form.getField(propertyName);
if (!result.isValid(actionName)) Field field = form.getField(property); Arg[] args = field.getArgs(actionName); if(args != null)
Field field = (Field) form.getField(propertyName);