Examples of FormElement


Examples of com.google.gwt.dom.client.FormElement

     *
     * @return the generated form element
     */
    public static FormElement generateHiddenForm(String action, Method method, String target, Map<String, String> values) {

        FormElement formElement = Document.get().createFormElement();
        formElement.setMethod(method.name());
        if (ClientStringUtil.isNotEmptyOrWhitespaceOnly(target)) {
            formElement.setTarget(target);
        }
        formElement.setAction(action);
        for (Entry<String, String> input : values.entrySet()) {
            formElement.appendChild(createHiddenInput(input.getKey(), input.getValue()));
        }
        return formElement;
    }
View Full Code Here

Examples of com.google.wave.api.FormElement

    Map<String, String> properties = context.deserialize(
        json.getAsJsonObject().get(PROPERTIES_TAG), GsonFactory.STRING_MAP_TYPE);

    if (FormElement.getFormElementTypes().contains(type)) {
      result = new FormElement(type, properties);
    } else if (type == ElementType.GADGET) {
      result = new Gadget(properties);
    } else if (type == ElementType.IMAGE) {
      result = new Image(properties);
    } else if (type == ElementType.ATTACHMENT) {
View Full Code Here

Examples of com.google.wave.api.FormElement

    int startIndex = b.length();
    b.append(LOGIN_LINK_TEXT + "\n\n");
    wavelet.getRootBlip().append(b.toString());

    // Add button to click when authentication is complete.
    wavelet.getRootBlip().append(new FormElement(ElementType.BUTTON, LOGIN_BUTTON_ID,
        LOGIN_BUTTON_CAPTION));

    // Linkify the authorization link.
    wavelet.getRootBlip().range(startIndex, startIndex + LOGIN_LINK_TEXT.length()).annotate(
        LINK_ANNOTATION_KEY, url);
View Full Code Here

Examples of com.google.wave.api.FormElement

   * @return a form element of the right type and with the right name and
   *         optionally an initial value.
   */

  protected FormElement createFormElement(Document doc, E element, String initialValue) {
    FormElement formElement = new FormElement(elementType, doc.getAttribute(element, "name"));
    if (initialValue != null) {
      formElement.setValue(initialValue);
      formElement.setDefaultValue(initialValue);
    }
    return formElement;
  }
View Full Code Here

Examples of com.google.wave.api.FormElement

  public void testLocateElement() {
    Document document = BasicFactories.documentProvider().parse(
        LineContainers.debugContainerWrap("01234567890123456789"));
    ApiView api = new ApiView(document, mock(Wavelet.class));
    api.insert(3, new FormElement(ElementType.BUTTON, "buttonName"));
    FormElement button1 = new FormElement(ElementType.BUTTON, "buttonName");
    assertEquals(3, api.locateElement(button1));

    FormElement button2 = new FormElement(ElementType.BUTTON, "notInDocument");
    assertEquals(-1, api.locateElement(button2));

    api.insert(4, new Gadget("http://test.com"));
    Gadget gadget1 = new Gadget("http://test.com");
    assertEquals(4, api.locateElement(gadget1));
View Full Code Here

Examples of com.google.wave.api.FormElement

    convertBackAndForth("<radio name=\"radio\" group=\"group\"></radio>");
  }

  public void testCheckboxSerialization() {
    String xml = "<check name=\"include\" submit=\"true\" value=\"false\"></check>";
    FormElement element = (FormElement) createApiElementFromXml(xml);
    assertEquals("include", element.getName());
    assertEquals("false", element.getValue());
    assertEquals("true", element.getDefaultValue());
    assertEquals(xml, ElementSerializer.apiElementToXml(element).getXmlString());
  }
View Full Code Here

Examples of de.mhus.lib.form.annotations.FormElement

      else
      if (methodName.startsWith("get")) methodName = methodName.substring(3);
      else
      if (methodName.startsWith("is")) methodName = methodName.substring(2);

      FormElement element = method.getAnnotation(FormElement.class);
      FormSchemas form = method.getAnnotation(FormSchemas.class);
     
      if (form != null) {
        for (FormElement e : form.value()) {
          if (schema.equals(e.schema())) {
            element = e;
            break;
          }
           
        }
      }
     
      if (element != null) {
        if (element.type() == TYPE.INCLUDE) {
          String aspectName = null;
          if (!MString.isEmpty(element.aspect()))
              aspectName = prefix + element.aspect() + ".";
          else
            aspectName = prefix + methodName + ".";
         
          MForm innerTarget = (MForm) method.invoke(target);
          if (innerTarget != null) {
            ObjectList nextList = list;
            if (!MString.isEmpty(element.group())) {
              nextList = findGroupList(element, list);
              aspectName = "";
            }
            parseElements(aspectName, innerTarget, nextList);
          }       
        } else
        if (element.type() == TYPE.GROUP) {
         
          FGroup next = new FGroup();
          list.add(next);
          next.initialize(this);

          String aspectName = null;
          if (!MString.isEmpty(element.aspect()))
              aspectName = prefix + element.aspect() + ".";
          else
            aspectName = prefix + methodName + ".";
         
          next.setTargetFinder(new TargetFinderWithMethod(method));
          // next.setParent();
          MForm innerTarget = next.getTarget();
          if (innerTarget != null) {
            ObjectList nextList = next.getList();
            parseElements(aspectName, innerTarget, nextList);
          }       
        } else {
          FormSortId idx = method.getAnnotation(FormSortId.class);
          IConfig xmlElement = fillElement(prefix,method, toXmlString(element,methodName));
         
          ObjectList nextList = list;
          if (!MString.isEmpty(element.group())) {
            nextList = findGroupList(element, list);
          }
         
          FObject next = createModelObjectFromXml(xmlElement,target, nextList);
         
          if (next != null && element.sort() >= 0)
            next.setSortId(element.sort());
          else
          if (next != null && idx != null)
            next.setSortId(idx.value());
      }
      }
View Full Code Here

Examples of de.mhus.lib.form.annotations.FormElement

    return next;
  }
 
  private void parseClass() throws SAXException, IOException {
   
    FormElement element = getTarget().getClass().getAnnotation(FormElement.class);
   
    FormSchemas schemas = getTarget().getClass().getAnnotation(FormSchemas.class);
   
    if (schemas != null) {
      for (FormElement e : schemas.value()) {
        if (schema.equals(e.schema())) {
          element = e;
          break;
        }
       
      }
    }
       
    if (element != null) {
      ClassHandler handler = new ClassHandler();
      String xml = element.value();
      if (!MString.isEmpty(xml)) {
        if (!xml.startsWith("<"))
          xml = "<panel " + xml + "/>";
      } else {
        xml = "<panel name='"+ getTarget().getClass().getCanonicalName() + "' title='" + MXml.encode(element.title()) + "' nls='" + MXml.encode(element.nls())+ "' " + element.more() + "/>";
      }
      parser.parse(new ByteArrayInputStream(xml.getBytes()), handler);
     
    }
   
View Full Code Here

Examples of de.yaams.core.helper.gui.form.FormElement

          public void run() {

            // save all
            for (String key : headers.keySet()) {
              for (String keye : headers.get(key).getElements().keySet()) {
                FormElement e = headers.get(key).get(keye);
                if (e instanceof FormSaveElement) {
                  ((FormSaveElement) e).informListeners();
                }
              }
            }
View Full Code Here

Examples of de.yaams.maker.helper.gui.form.FormElement

          public void run() {

            // save all
            for (String key : headers.keySet()) {
              for (String keye : headers.get(key).getElements().keySet()) {
                FormElement e = headers.get(key).get(keye);
                if (e instanceof FormSaveElement) {
                  ((FormSaveElement) e).informListeners();
                }
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.