[Buix-commits] r198 - trunk/jaxx/src/main/java/jaxx/tags/swing
Author: tchemit Date: 2008-02-12 13:39:31 +0000 (Tue, 12 Feb 2008) New Revision: 198 Modified: trunk/jaxx/src/main/java/jaxx/tags/swing/RowHandler.java trunk/jaxx/src/main/java/jaxx/tags/swing/TableHandler.java Log: ajout trace Modified: trunk/jaxx/src/main/java/jaxx/tags/swing/RowHandler.java =================================================================== --- trunk/jaxx/src/main/java/jaxx/tags/swing/RowHandler.java 2008-02-12 13:39:09 UTC (rev 197) +++ trunk/jaxx/src/main/java/jaxx/tags/swing/RowHandler.java 2008-02-12 13:39:31 UTC (rev 198) @@ -42,14 +42,16 @@ int nodeType = node.getNodeType(); if (nodeType == Node.ELEMENT_NODE) { Element child = (Element) node; - if (!child.getLocalName().equals("cell")) + if (!child.getLocalName().equals("cell")) { compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children"); + } compileChildTagFirstPass(child, compiler); } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { String text = ((Text) node).getData().trim(); - if (text.length() > 0) + if (text.length() > 0) { compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } } } } @@ -61,14 +63,16 @@ int nodeType = node.getNodeType(); if (nodeType == Node.ELEMENT_NODE) { Element child = (Element) node; - if (!child.getLocalName().equals("cell")) + if (!child.getLocalName().equals("cell")) { compiler.reportError("tag '" + tag.getLocalName() + "' may only contain cell tags as children"); + } compileChildTagSecondPass(child, compiler); } else if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) { String text = ((Text) node).getData().trim(); - if (text.length() > 0) + if (text.length() > 0) { compiler.reportError("tag '" + tag.getLocalName() + "' may not contain text ('" + ((Text) node).getData().trim() + "')"); + } } } } Modified: trunk/jaxx/src/main/java/jaxx/tags/swing/TableHandler.java =================================================================== --- trunk/jaxx/src/main/java/jaxx/tags/swing/TableHandler.java 2008-02-12 13:39:09 UTC (rev 197) +++ trunk/jaxx/src/main/java/jaxx/tags/swing/TableHandler.java 2008-02-12 13:39:31 UTC (rev 198) @@ -30,10 +30,12 @@ @Override public void setAttribute(CompiledObject object, String propertyName, String stringValue, boolean inline, JAXXCompiler compiler) throws CompilerException { try { - if (object instanceof CompiledTable) + if (object instanceof CompiledTable) { CellHandler.setAttribute(((CompiledTable) object).getTableConstraints(), propertyName, stringValue); - else + } + else { super.setAttribute(object, propertyName, stringValue, inline, compiler); + } } catch (UnsupportedAttributeException e) { super.setAttribute(object, propertyName, stringValue, inline, compiler); @@ -58,19 +60,23 @@ @Override public void addChild(CompiledObject child, String constraints, JAXXCompiler compiler) throws CompilerException { - if (constraints != null) + if (constraints != null) { compiler.reportError("Table does not accept constraints"); + } GridBagConstraints c = getCellConstraints(); if (c == null) { compiler.reportError("Table tag may only contain row tags"); return; } - if (!emptyCell) + if (!emptyCell) { compiler.reportError("Table cells may only have one child component"); - while (rowSpans.size() < c.gridx + c.gridwidth) + } + while (rowSpans.size() < c.gridx + c.gridwidth) { rowSpans.add(null); - for (int x = c.gridx; x < c.gridx + c.gridwidth; x++) + } + for (int x = c.gridx; x < c.gridx + c.gridwidth; x++) { rowSpans.set(x, c.gridheight); + } super.addChild(child, TypeManager.getJavaCode(c), compiler);
participants (1)
-
tchemit@users.labs.libre-entreprise.org