예제 #1
0
        public int outHtml(ref StreamWriter pdbDoc, TableHTML table)
        {
            pdbDoc.WriteLine("<tr class=\"field\"><td width=\"35%\">");
            pdbDoc.WriteLine("<a name=\"" + sName + "\">");
            pdbDoc.WriteLine("<b><a href='../index.html?table=" + table.getName() + "&group=" + table.getGroup() + "#" + sName + "' target='_top'>" + sName + "</b></a>");
            pdbDoc.WriteLine("<div style=\"margin-left: 20px;\">" + sType);

            if (typeParam.Count > 0) {
                pdbDoc.Write(" (");
                bool first = true;
                foreach (string it in typeParam) {
                    if (!first) pdbDoc.Write(", ");
                    first = false;
                    pdbDoc.Write(it);
                }
                pdbDoc.WriteLine(")");
            }
            if (sDefault.Length > 0) {
                pdbDoc.WriteLine(" <font class=\"DefaultFieldValue\">default: " + sDefault + "</font>");
            }

            if (sCheck.Length > 0) {
                pdbDoc.WriteLine(" <font class=\"CheckField\">CHECK (" + sCheck + ")</font>");
            }

            if (sConstraint.Length > 0) {
                pdbDoc.WriteLine(" <font class=\"FieldConstraints\">"+ sConstraint + "</font>");
            }

            pdbDoc.Write("</div></td><td>");
            if ( sComment != "") {
                pdbDoc.WriteLine(sComment);
            }
            pdbDoc.Write("</td><td>");

            List<Constraint> constraints = table.getConstraints();
            int count =0;
            foreach (Constraint it in constraints) {

                if (it.getType() == eType.eForeignKey
                    && (it.isInLocalAttr(sName)) != -1) {
                    if (count > 0) {
                        pdbDoc.Write(", ");
                    }
                    count++;
                    string remoteTable = it.getRemoteTableName();
                    string strRemoteFields = it.getRemoteAttributesString();
                    pdbDoc.Write(getHRef( remoteTable, false, "table-info", " onMouseOver=\"popup( '" + strRemoteFields + "');\" onMouseOut=\"popout()\"",
                        (strRemoteFields.Length>0)?strRemoteFields:"top")
                        + remoteTable + "</a>");

                }
            }
            pdbDoc.WriteLine("</td></tr>");
            return 0;
        }
예제 #2
0
        public void prepareDisplay(string module, bool repeatedRun)
        {
            m_module = module;
            tables.Clear();
            foreach ( Table it in allTables) {
                tables.Add(it);
            }

            Table.resetColumn(tables.Count);
            foreach ( Table it in tables) {
                TableHTML tab = new TableHTML(it);
                tab.prepareDisplay(this, m_module, repeatedRun);
            }

            // merge Positions of associations
            foreach ( PosAssociation at in posAssociations) {
                Table src = getFromId(at.connections[0]);
                if (src.getName().Length != 0) {
                    src.setPositionConstraint( at.connectionPoints[0],
                        getFromId(at.connections[1]),
                        at.obj_pos, at.obj_bb, at.orth_orient, at.orth_points);
                }
            }

            tables.Sort ();
        }