From 33aa1132d76c04441f145ba0d42b0f4ba0a85fc5 Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Mon, 14 Jan 2013 16:36:09 -0500 Subject: [PATCH] Clarify wording/naming of blank rows export option - fixes issue #651 - clarify that it refers to all non-null cells - rename variables without compatibility constraints to match actual function --- .../exporters/CustomizableTabularExporterUtilities.java | 8 ++++---- .../scripts/dialogs/custom-tabular-exporter-dialog.html | 4 ++-- .../scripts/dialogs/custom-tabular-exporter-dialog.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java b/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java index 3dd5d048a..08c31e356 100644 --- a/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java +++ b/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java @@ -83,7 +83,7 @@ abstract public class CustomizableTabularExporterUtilities { final boolean outputColumnHeaders = options == null ? true : JSONUtilities.getBoolean(options, "outputColumnHeaders", true); - final boolean outputBlankRows = options == null ? false : + final boolean outputEmptyRows = options == null ? false : JSONUtilities.getBoolean(options, "outputBlankRows", true); final int limit = options == null ? -1 : JSONUtilities.getInt(options, "limit", -1); @@ -137,7 +137,7 @@ abstract public class CustomizableTabularExporterUtilities { @Override public boolean visit(Project project, int rowIndex, Row row) { List cells = new ArrayList(columnNames.size()); - int nonBlankCount = 0; + int nonNullCount = 0; for (String columnName : columnNames) { Column column = project.columnModel.getColumnByName(columnName); @@ -149,11 +149,11 @@ abstract public class CustomizableTabularExporterUtilities { cells.add(cellData); if (cellData != null) { - nonBlankCount++; + nonNullCount++; } } - if (nonBlankCount > 0 || outputBlankRows) { + if (nonNullCount > 0 || outputEmptyRows) { serializer.addRow(cells, false); rowCount++; } diff --git a/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.html b/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.html index f7578d4ea..3cd5271bb 100644 --- a/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.html +++ b/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.html @@ -82,8 +82,8 @@ - - + + diff --git a/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.js b/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.js index 81273ac2f..f4beb2c64 100644 --- a/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.js @@ -209,7 +209,7 @@ CustomTabularExporterDialog.prototype._configureUIFromOptionCode = function(opti this._elmts.lineSeparatorInput[0].value = escapeJavascriptString(options.lineSeparator || '\n'); this._elmts.encodingInput[0].value = options.encoding; this._elmts.outputColumnHeadersCheckbox.attr('checked', (options.outputColumnHeaders) ? 'checked' : ''); - this._elmts.outputBlankRowsCheckbox.attr('checked', (options.outputBlankRows) ? 'checked' : ''); + this._elmts.outputEmptyRowsCheckbox.attr('checked', (options.outputBlankRows) ? 'checked' : ''); if (options.columns !== null) { var self = this; @@ -356,7 +356,7 @@ CustomTabularExporterDialog.prototype._getOptionCode = function() { options.encoding = this._elmts.encodingInput.val(); } options.outputColumnHeaders = this._elmts.outputColumnHeadersCheckbox[0].checked; - options.outputBlankRows = this._elmts.outputBlankRowsCheckbox[0].checked; + options.outputBlankRows = this._elmts.outputEmptyRowsCheckbox[0].checked; options.columns = [];