final DefaultTreeTable table = new DefaultTreeTable(NAME, VALUE_AS_TEXT); final TreeTable.Node root = table.getRoot(); root.setValue(NAME, resources.getString(Vocabulary.Keys.LocalConfiguration)); table.setRoot(root); section = root.newChild(); section.setValue(NAME, resources.getString(newSection.resourceKey)); newSection = null; final TreeTable.Node node = section.newChild(); node.setValue(NAME, name); if (children != null) { for (int j=0; j<children.length; j+=2) { final String c = children[j+1]; if (c != null) { final TreeTable.Node child = node.newChild(); child.setValue(NAME, children[j]); child.setValue(VALUE_AS_TEXT, c); node.setValue(VALUE_AS_TEXT, value.toString()); continue; directory = node.newChild(); directory.setValue(NAME, parenthesis(resources.getString(homeKey))); TreeTables.nodeForPath(directory, NAME, file).setValue(VALUE_AS_TEXT, title); it.remove();
if ((values[i] = node.getValue(columns[i])) != null) { n = i; boolean needLineSeparator = multiLineCells; final String lineSeparator = needLineSeparator ? getLineSeparator() : null; final Iterator<? extends TreeTable.Node> it = node.getChildren().iterator(); TreeTable.Node next = next(it); while (next != null) {
Errors.Keys.NodeHasNoParent_1, new Object[] {node}, indexOfLineStart); lastNode = lastNode.getParent(); final TreeTable.Node parent = lastNode.getParent(); if (parent == null) { pos.setErrorIndex(indexOfLineStart); Errors.Keys.NodeHasNoParent_1, new Object[] {node}, indexOfLineStart); parent.getChildren().add(node); } else if (i > p) { lastNode.getChildren().add(node); if (++indentationLevel == indentations.length) { indentations = Arrays.copyOf(indentations, indentationLevel*2);
final DefaultTreeTable table = new DefaultTreeTable(NAME, VALUE_AS_TEXT); final TreeTable.Node root = table.getRoot(); root.setValue(NAME, resources.getString(Vocabulary.Keys.LocalConfiguration)); table.setRoot(root); section = root.newChild(); section.setValue(NAME, resources.getString(newSection.resourceKey)); newSection = null; final TreeTable.Node node = section.newChild(); node.setValue(NAME, name); if (children != null) { for (int j=0; j<children.length; j+=2) { final String c = children[j+1]; if (c != null) { final TreeTable.Node child = node.newChild(); child.setValue(NAME, children[j]); child.setValue(VALUE_AS_TEXT, c); node.setValue(VALUE_AS_TEXT, value.toString()); continue; directory = node.newChild(); directory.setValue(NAME, parenthesis(resources.getString(homeKey))); TreeTables.nodeForPath(directory, NAME, file).setValue(VALUE_AS_TEXT, title); it.remove();
Errors.Keys.NodeHasNoParent_1, new Object[] {node}, indexOfLineStart); lastNode = lastNode.getParent(); final TreeTable.Node parent = lastNode.getParent(); if (parent == null) { pos.setErrorIndex(indexOfLineStart); Errors.Keys.NodeHasNoParent_1, new Object[] {node}, indexOfLineStart); parent.getChildren().add(node); } else if (i > p) { lastNode.getChildren().add(node); if (++indentationLevel == indentations.length) { indentations = Arrays.copyOf(indentations, indentationLevel*2);
table.getRoot().setValue(TableColumn.NAME, Vocabulary.getResources(locale).getString(Vocabulary.Keys.RemoteConfiguration)); configuration = table.toString();
if ((values[i] = node.getValue(columns[i])) != null) { n = i; final Iterator<? extends TreeTable.Node> it = node.getChildren().iterator(); boolean hasNext = it.hasNext(); while (hasNext) {
final TreeTable table = Column.createTable(); final TreeTable.Node root = table.getRoot(); root.setValue(Column.TARGET, getClass()); synchronized (converters) { for (final Map.Entry<ClassPair<?,?>, ObjectConverter<?,?>> entry : converters.entrySet()) { addTo = addTo.newChild(); addTo.setValue(Column.SOURCE, key.sourceClass); addTo.setValue(Column.TARGET, key.targetClass); ((FallbackConverter<?,?>) converter).toTree(addTo.newChild(), true); } else { Column.toTree(converter, addTo);
final TreeTable tree = new DefaultTreeTable(column); final TreeTable.Node root = tree.getRoot(); root.setValue(column, Classes.getShortClassName(this)); TreeTable.Node section = root.newChild(); section.setValue(column, "Target range"); final StringBuilder buffer = new StringBuilder(256); getTargetExtent().appendTo(buffer, Vocabulary.getResources(locale)); String text = line.toString().trim(); if (!text.isEmpty()) { section.newChild().setValue(column, text); buffer.append(s); section = root.newChild(); section.setValue(column, "Target strides"); section.newChild().setValue(column, buffer.append('}').toString()); buffer.setLength(0); section.newChild().setValue(column, buffer.append("Global ≈ ").append((float) getGlobalScale()).toString()); return tree;
final TreeTable table = Column.createTable(); final TreeTable.Node root = table.getRoot(); root.setValue(Column.TARGET, getClass()); synchronized (converters) { for (final Map.Entry<ClassPair<?,?>, ObjectConverter<?,?>> entry : converters.entrySet()) { addTo = addTo.newChild(); addTo.setValue(Column.SOURCE, key.sourceClass); addTo.setValue(Column.TARGET, key.targetClass); ((FallbackConverter<?,?>) converter).toTree(addTo.newChild(), true); } else { Column.toTree(converter, addTo);
final DefaultTreeTable table = new DefaultTreeTable(NAME, valueA, valueB); final TreeTable.Node root = new DefaultTreeTable.Node(table); root.setValue(NAME, "Node #1"); root.setValue(valueA, 10); root.setValue(valueB, "Value #1B"); final TreeTable.Node branch1 = new DefaultTreeTable.Node(table); branch1.setValue(NAME, "Node #2"); branch1.setValue(valueA, 20); root.getChildren().add(branch1); final TreeTable.Node branch2 = new DefaultTreeTable.Node(table); branch2.setValue(NAME, "Node #3"); branch2.setValue(valueB, "Value #3B"); root.getChildren().add(branch2); final TreeTable.Node leaf = new DefaultTreeTable.Node(table); leaf.setValue(NAME, "Node #4"); leaf.setValue(valueA, 40); leaf.setValue(valueB, "val #4\twith tab\nand a new line"); branch1.getChildren().add(leaf); table.setRoot(root);
root.setValue(NAME, "Root"); child = root.newChild(); child.setValue(NAME, "CodeList"); child.setValue(VALUE, Role.POINT_OF_CONTACT); child = root.newChild(); child.setValue(NAME, "Enum"); child.setValue(VALUE, RoundingMode.HALF_DOWN); child = root.newChild(); child.setValue(NAME, "i18n"); child.setValue(VALUE, i18n);
for (final TreeTable.Node child : from.getChildren()) { if (name.equals(child.getValue(column))) { return child; from = from.newChild(); from.setValue(column, name); return from;
pkTableName); fkNode = getOrCreateNode(ttable.getRoot(), pkTable, tablePath).newChild(); fkNode.setValue(pkColumn, foreignKeys.getString(4)); fkNode.setValue(fkColumn, foreignKeys.getString(8)); fkNode.setValue(fkName, foreignKeys.getString(12)); fkNode.setValue(pkName, foreignKeys.getString(13)); for (final TreeTable.Node tableNode : ttable.getRoot().getChildren()) { tablePath = tableNode.getValue(pkTable); h4 = appendChild(doc, body, "h4"); h4.appendChild(doc.createTextNode(BUNDLE.getString(importedFrom) + " ")); for (final TreeTable.Node colNode : tableNode.getChildren()) { appendChild(doc, list, "li", colNode.getValue(fkColumn) +" " + BUNDLE.getString(refers) + " " + pkTableName +"."+colNode.getValue(pkColumn));
for (final TreeTable.Node child : from.getChildren()) { if (name.equals(child.getValue(column))) { return child; from = from.newChild(); from.setValue(column, name); return from;
child.setValue(TableColumn.IDENTIFIER, "title"); try { child.setValue(TableColumn.VALUE, "A new title"); fail("Attemps to overwrite an existing value shall fail."); } catch (IllegalStateException e) { child.setValue(TableColumn.IDENTIFIER, "title"); child.setValue(TableColumn.VALUE, "A new title"); assertTitleEquals("citation", "A new title", citation); assertSame(citation.getTitle(), child.getValue(TableColumn.VALUE)); child.setValue(TableColumn.IDENTIFIER, "alternateTitle"); child.setValue(TableColumn.VALUE, "Third alternate title"); assertEquals(3, citation.getAlternateTitles().size()); assertEquals("Third alternate title", child.getValue(TableColumn.VALUE).toString());
for (final TreeTable.Node child : node.getChildren()) { changes += replaceCharSequences(child, columns, locale, pool); final Object value = node.getValue(column); if (value != null) { String text; node.setValue(column, text); changes++;
final Node parent = node.getParent(); if (parent instanceof TreeNode && Citation.class.isAssignableFrom(((TreeNode) parent).baseType)) { Object value = null; value = node.getUserObject();
for (final TreeTable.Node child : node.getChildren()) { changes += replaceCharSequences(child, columns, locale, pool); final Object value = node.getValue(column); if (value != null) { String text; node.setValue(column, text); changes++;
final List<TreeTable.Node> children = (List<TreeTable.Node>) node.getChildren(); final int size = children.size(); for (int i=0; i<size; i++) { if (node.getValue(VALUE_AS_TEXT) == null) { final TreeTable.Node child = children.remove(0); final StringBuilder name = new StringBuilder(node.getValue(NAME)); if (!File.separator.contentEquals(name)) { name.append(File.separatorChar); child.setValue(NAME, name.append(child.getValue(NAME))); return child;