Package org.dbwiki.web.ui.layout

Examples of org.dbwiki.web.ui.layout.SchemaLayout


   */
  public HtmlPage getLinesForNodeList(SchemaNodeList list, RequestParameterVersion versionParameter) throws org.dbwiki.exception.WikiException {
    HtmlLinePrinter content = new HtmlLinePrinter();
    boolean hasContent = false;
   
    SchemaLayout layout = _layouter.get(list.schema());

    // Dispatching based on layout style for this node's type
    if ((layout.getDisplayStyle().isGroupStyle()) || ((layout.getDisplayStyle().isTableStyle()) && (list.schema().isAttribute()))) {
      hasContent = printNodesInGroupStyle(list, versionParameter, layout, content);
    } else if (layout.getDisplayStyle().isListStyle()) {
      hasContent = printNodesInListStyle(list, versionParameter, layout, content);
    } else if (layout.getDisplayStyle().isTableStyle()) {
      hasContent = printNodesInTableStyle(list, versionParameter, layout, content);
    }
   
    if (hasContent) {
      return content.lines();
View Full Code Here


      return new HtmlPage();
    }
  }

  public void printAttributeNode(DatabaseAttributeNode node, RequestParameterVersion versionParameter, HtmlLinePrinter body) throws org.dbwiki.exception.WikiException {
    SchemaLayout layout = _layouter.get(node.schema());
   
    boolean active = node.getTimestamp().isCurrent();

    if (active) {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrameActive));
    } else {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrameInactive));
    }
   
    body.openTR();
   
    if (active) {
      body.openTD(layout.getCSS(CSS.CSSObjectLabelActive));
    } else {
      body.openTD(layout.getCSS(CSS.CSSObjectLabelInactive));
    }
    body.text(layout.getName());
    body.closeTD();
   
    if (active) {
      body.openTD(layout.getCSS(CSS.CSSObjectValueActive));
    } else {
      body.openTD(layout.getCSS(CSS.CSSObjectValueInactive));
    }
   
    printAttributeValue(node, versionParameter, layout, body);
   
    body.closeTD();
View Full Code Here

   
    body.closeTABLE();
  }

  public void printGroupNode(DatabaseGroupNode node, RequestParameterVersion versionParameter, HtmlLinePrinter body) throws org.dbwiki.exception.WikiException {
    SchemaLayout layout = _layouter.get(node.schema());
   
    body.openTABLE(layout.getCSS(CSS.CSSObjectFrame));
    SchemaNodeListIndex children = new SchemaNodeListIndex(node, _layouter);
    for (int i = 0; i < children.size(); i++) {
      // filtering of versions handled in getLinesForNodeList
      HtmlPage lines = getLinesForNodeList(children.get(i), versionParameter);
      if (lines.size() > 0) {
        body.openTR();
        body.openTD(layout.getCSS(CSS.CSSObjectListing));
        body.add(lines);
        body.closeTD();
        body.closeTR();
      }
    }
View Full Code Here

    body.closeTABLE();
   
  }

  public void printTextNode(DatabaseTextNode node, HtmlLinePrinter body) {
    SchemaLayout layout = _layouter.get(node.parent().schema());
   
    boolean active = node.getTimestamp().isCurrent();
    if (active) {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrameActive));
    } else {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrameInactive));
    }
    body.openTR();
    if (active) {
      body.openTD(layout.getCSS(CSS.CSSObjectValueActive));
    } else {
      body.openTD(layout.getCSS(CSS.CSSObjectValueInactive));
    }
    body.text(node.value());
    if (node.hasAnnotation()) {
      addAnnotationIndicator(body);
    }
View Full Code Here

    content.openTR();
    for (int iColumn = 0; iColumn < schemaNode.children().size(); iColumn++) {
      SchemaNode columnSchemaNode = schemaNode.children().get(iColumn);
      // only display columns for entities that have not been deleted
      if (versionParameter.matches(columnSchemaNode)) {
        SchemaLayout schemaLayout = _layouter.get(columnSchemaNode);
        if (active) {
          content.openTH(layout.getCSS(CSS.CSSContentCellActive));
        } else {
          content.openTH(layout.getCSS(CSS.CSSContentCellInactive));
        }
        content.text(schemaLayout.getName());
        content.closeTH();
      }
    }
    content.closeTR();
   
View Full Code Here

    body.closePARAGRAPH();
    body.closeFORM();
  }
 
  public void printInsertLines(SchemaNode schema, HtmlLinePrinter body) {
    SchemaLayout layout = _layouter.get(schema);

    if (schema.isAttribute()) {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrameActive));
      this.printInsertLine(schema, body);
      body.closeTABLE();
    } else {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrame));
      GroupSchemaNode groupSchemaNode = (GroupSchemaNode)schema;
      for (int iChild = 0; iChild < groupSchemaNode.children().size(); iChild++) {
        SchemaNode child = groupSchemaNode.children().get(iChild);
        // skip deleted entities
        if (!child.getTimestamp().isCurrent())
          continue;
        if (child.isAttribute()) {
          body.openTR();
          body.openTD(layout.getCSS(CSS.CSSObjectListing));
          body.openTABLE(layout.getCSS(CSS.CSSObjectFrameActive));
          this.printInsertLine(child, body);
          body.closeTABLE();
          body.closeTD();
          body.closeTR();
        } else if (_layouter.get(child).getEditWithParent()) {
          GroupSchemaNode groupChild = (GroupSchemaNode)child;
          body.openTR();
          body.openTD(layout.getCSS(CSS.CSSObjectListing));
          body.openTABLE(layout.getCSS(CSS.CSSContentFrameActive));
          body.openTR();
          body.openTD(layout.getCSS(CSS.CSSContentTopLabelActive));
          body.text(_layouter.get(groupChild).getName());
          body.closeTD();
          body.closeTR();
          body.openTR();
          body.openTD(CSS.CSSObjectListing);
View Full Code Here

      body.closeTABLE();
    }
  }

  public void printInsertLine(SchemaNode schema, HtmlLinePrinter body) {
    SchemaLayout layout = _layouter.get(schema);
   
    body.openTR();
    body.openTD(layout.getCSS(CSS.CSSObjectLabelActive));
    body.text(layout.getName());
    body.closeTD();
    body.openTD(layout.getCSS(CSS.CSSObjectValueActive));
    body.text(this.getTextareaLine(schema, layout.getTextHeight()));   
    body.closeTD();
    body.closeTR();
  }
View Full Code Here

    }

    if (node.isElement()) {
      this.printUpdateLines((DatabaseElementNode)node, body);
    } else {
      SchemaLayout layout = _layouter.get(node.parent().schema());
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrameActive));
      body.openTR();
      body.openTD(layout.getCSS(CSS.CSSObjectValueActive));
      this.printUpdateTextArea((DatabaseTextNode)node, body);
      body.closeTD();
      body.closeTR();
      body.closeTABLE();
    }
View Full Code Here

    body.closePARAGRAPH();
    body.closeFORM();
  }

  public void printUpdateLines(DatabaseElementNode element, HtmlLinePrinter body) throws org.dbwiki.exception.WikiException {
    SchemaLayout layout = _layouter.get(element.schema());
    if (element.isAttribute()) {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrameActive));
      this.printUpdateLine((DatabaseAttributeNode)element, body);
      body.closeTABLE();
    } else {
      body.openTABLE(layout.getCSS(CSS.CSSObjectFrame));
      DatabaseGroupNode group = (DatabaseGroupNode)element;
      for (int iChild = 0; iChild < group.children().size(); iChild++) {
        DatabaseElementNode child = group.children().get(iChild);
        if (child.getTimestamp().isCurrent()) {
          if (child.isAttribute()) {
            body.openTR();
            body.openTD(layout.getCSS(CSS.CSSObjectListing));
            body.openTABLE(layout.getCSS(CSS.CSSObjectFrameActive));
            this.printUpdateLine((DatabaseAttributeNode)child, body);
            body.closeTABLE();
            body.closeTD();
            body.closeTR();
          } else if (_layouter.get(child.schema()).getEditWithParent()) {
            DatabaseGroupNode groupChild = (DatabaseGroupNode)child;
            body.openTR();
            body.openTD(layout.getCSS(CSS.CSSObjectListing));
            body.openTABLE(layout.getCSS(CSS.CSSContentFrameActive));
            body.openTR();
            body.openTD(layout.getCSS(CSS.CSSContentTopLabelActive));
            body.text(_layouter.get(groupChild.schema()).getName());
            body.closeTD();
            body.closeTR();
            body.openTR();
            body.openTD(CSS.CSSObjectListing);
View Full Code Here

      body.closeTABLE();
    }

  }
  public void printUpdateLine(DatabaseAttributeNode attribute, HtmlLinePrinter body) {
    SchemaLayout layout = _layouter.get(attribute.schema());
   
    DatabaseTextNode value = attribute.value().getCurrent();
    if (value != null) {
      body.openTR();
      body.openTD(layout.getCSS(CSS.CSSObjectLabelActive));
      body.text(layout.getName());
      body.closeTD();
      body.openTD(layout.getCSS(CSS.CSSObjectValueActive));
      this.printUpdateTextArea(value, body);   
      body.closeTD();
      body.closeTR();
    }
  }
View Full Code Here

TOP

Related Classes of org.dbwiki.web.ui.layout.SchemaLayout

Copyright © 2018 www.massapicom. 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.