Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -270,36 +270,41 @@ public SpreadsheetViewport setNavigations(final SpreadsheetViewportNavigationLis

@Override
public void printTree(final IndentingPrinter printer) {
printer.println("rectangle:");

printer.println(this.getClass().getSimpleName());
printer.indent();
{
this.rectangle()
.printTree(printer);
}
printer.outdent();
printer.println("rectangle:");

if (this.includeFrozenColumnsRows) {
printer.println("includeFrozenColumnsRows: true");
}
printer.indent();
{
this.rectangle()
.printTree(printer);
}
printer.outdent();

final Optional<AnchoredSpreadsheetSelection> anchoredSelection = this.anchoredSelection;
if (anchoredSelection.isPresent()) {
printer.print("anchoredSelection: ");
if (this.includeFrozenColumnsRows) {
printer.println("includeFrozenColumnsRows: true");
}

anchoredSelection.get()
.printTree(printer);
}
final Optional<AnchoredSpreadsheetSelection> anchoredSelection = this.anchoredSelection;
if (anchoredSelection.isPresent()) {
printer.print("anchoredSelection:");

final SpreadsheetViewportNavigationList navigations = this.navigations();
if (navigations.isNotEmpty()) {
printer.println("navigations:");
printer.indent();
anchoredSelection.get()
.printTree(printer);
}

final SpreadsheetViewportNavigationList navigations = this.navigations();
if (navigations.isNotEmpty()) {
printer.println("navigations:");
printer.indent();

for (final SpreadsheetViewportNavigation navigation : navigations) {
printer.println(navigation.text());
for (final SpreadsheetViewportNavigation navigation : navigations) {
printer.println(navigation.text());
}
}
}
printer.outdent();
}

// HasUrlFragment...................................................................................................
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,12 @@ public void testPrintTreeViewport() {
),
"SpreadsheetDelta\n" +
" viewport:\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 40.0\n" +
" anchoredSelection: cell-range A1:B2 BOTTOM_RIGHT\n"
" SpreadsheetViewport\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 40.0\n" +
" anchoredSelection:cell-range A1:B2 BOTTOM_RIGHT\n"
);
}

Expand Down Expand Up @@ -1567,11 +1568,12 @@ public void testPrintTreeNothingEmpty() {
),
"SpreadsheetDelta\n" +
" viewport:\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 40.0\n" +
" anchoredSelection: cell-range A1:B2 BOTTOM_RIGHT\n" +
" SpreadsheetViewport\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 40.0\n" +
" anchoredSelection:cell-range A1:B2 BOTTOM_RIGHT\n" +
" cells:\n" +
" Cell A1\n" +
" Formula\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,12 @@ public void testPrintTreeOnlyViewport() {
),
"SpreadsheetDelta\n" +
" viewport:\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 40.0\n" +
" anchoredSelection: cell-range A1:B2 BOTTOM_RIGHT\n" +
" SpreadsheetViewport\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 40.0\n" +
" anchoredSelection:cell-range A1:B2 BOTTOM_RIGHT\n" +
" window:\n" +
" A1:E5\n"
);
Expand Down Expand Up @@ -1238,11 +1239,12 @@ public void testPrintTreeNothingEmpty() {
),
"SpreadsheetDelta\n" +
" viewport:\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 40.0\n" +
" anchoredSelection: cell-range A1:B2 BOTTOM_RIGHT\n" +
" SpreadsheetViewport\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 40.0\n" +
" anchoredSelection:cell-range A1:B2 BOTTOM_RIGHT\n" +
" cells:\n" +
" Cell A1\n" +
" Formula\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2850,11 +2850,12 @@ public void testTreePrint() {
"frozenColumns: column-range A:C\n" +
"frozenRows: row-range 1:3\n" +
"spreadsheetName: Untitled\n" +
"viewport: rectangle:\n" +
" home: D4\n" +
" width: 100.0\n" +
" height: 50.0\n" +
"anchoredSelection: cell E5\n"
"viewport: SpreadsheetViewport\n" +
" rectangle:\n" +
" home: D4\n" +
" width: 100.0\n" +
" height: 50.0\n" +
" anchoredSelection:cell E5\n"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,23 +355,24 @@ public void testTreePrintWithAnchor() {
}

@Test
public void testTreePrintRectangle() {
public void testTreePrintWithRectangle() {
this.treePrintAndCheck(
SpreadsheetViewport.with(
RECTANGLE,
INCLUDE_FROZEN_COLUMNS_ROWS,
SpreadsheetViewport.NO_ANCHORED_SELECTION,
SpreadsheetViewport.NO_NAVIGATION
),
"rectangle:" + EOL +
" home: A1" + EOL +
" width: 100.0" + EOL +
" height: 50.0" + EOL
"SpreadsheetViewport\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 50.0\n"
);
}

@Test
public void testTreePrintRectangleAndNavigations() {
public void testTreePrintWithRectangleAndNavigations() {
this.treePrintAndCheck(
SpreadsheetViewport.with(
RECTANGLE,
Expand All @@ -384,18 +385,19 @@ public void testTreePrintRectangleAndNavigations() {
)
)
),
"rectangle:" + EOL +
" home: A1" + EOL +
" width: 100.0" + EOL +
" height: 50.0" + EOL +
"navigations:" + EOL +
" left column" + EOL +
" up row" + EOL
"SpreadsheetViewport\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 50.0\n" +
" navigations:\n" +
" left column\n" +
" up row\n"
);
}

@Test
public void testTreePrintRectangleAnchoredSelectionRowRangeNavigations() {
public void testTreePrintWithRectangleAnchoredSelectionRowRangeNavigations() {
this.treePrintAndCheck(
SpreadsheetViewport.with(
RECTANGLE,
Expand All @@ -412,13 +414,14 @@ public void testTreePrintRectangleAnchoredSelectionRowRangeNavigations() {
)
)
),
"rectangle:" + EOL +
" home: A1" + EOL +
" width: 100.0" + EOL +
" height: 50.0" + EOL +
"anchoredSelection: row-range 12:34 TOP" + EOL +
"navigations:" + EOL +
" left column" + EOL
"SpreadsheetViewport\n" +
" rectangle:\n" +
" home: A1\n" +
" width: 100.0\n" +
" height: 50.0\n" +
" anchoredSelection:row-range 12:34 TOP\n" +
" navigations:\n" +
" left column\n"
);
}

Expand Down
Loading