Пример #1
0
  public Element getLookupElement() {
    Element e = new Element("lookup");
    if (saveErrors.size() != 0) {
      saveErrors.clear();
    }
    ObjEntityView view = objEntityViewField.getObjEntityView();
    DataView dataView = view.getDataView();
    String fieldPath =
        "<b>"
            + dataView.getName()
            + "."
            + view.getName()
            + "."
            + objEntityViewField.getName()
            + "</b><br>";
    if (lookupObjEntityView != null) {
      e.setAttribute(new Attribute("obj-entity-view-name", lookupObjEntityView.getName()));
    } else {
      e.setAttribute(new Attribute("obj-entity-view-name", ""));
      saveErrors.add(fieldPath + "lookup hasn't attribute \"obj-entity-view-name\"<br><br>");
    }
    if (lookupField != null) {
      e.setAttribute(new Attribute("field-name", lookupField.getName()));
    } else {
      e.setAttribute(new Attribute("field-name", ""));
      saveErrors.add(fieldPath + "lookup hasn't attribute \"field-name\"<br><br>");
    }
    e.addContent("");

    return e;
  }
Пример #2
0
  public String toString() {
    String resultString = "";
    if (lookupObjEntityView != null) {
      resultString += lookupObjEntityView.getName();
    }

    if (lookupField != null) {
      resultString += "." + lookupField.getName();
    } else {
      resultString += "";
    }
    return resultString;
  }