Made recon use cells from context rows.

Fixed bug in menu left-right positioning.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@271 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-03-10 08:32:20 +00:00
parent 432e88a23b
commit b1fca11342
3 changed files with 17 additions and 6 deletions

View File

@ -151,9 +151,20 @@ public class HeuristicReconConfig extends ReconConfig {
jsonWriter.key("/type/object/type"); jsonWriter.value(typeID);
for (ColumnDetail c : columnDetails) {
int cellIndex = project.columnModel.getColumnByName(c.columnName).getCellIndex();
int detailCellIndex = project.columnModel.getColumnByName(c.columnName).getCellIndex();
Cell cell2 = row.getCell(cellIndex);
Cell cell2 = row.getCell(detailCellIndex);
if (cell2 == null || !ExpressionUtils.isNonBlankData(cell2.value)) {
int cellIndex = project.columnModel.getColumnByName(columnName).getCellIndex();
if (cellIndex < row.contextRowSlots.length) {
int contextRowIndex = row.contextRowSlots[cellIndex];
if (contextRowIndex >= 0 && contextRowIndex < project.rows.size()) {
Row row2 = project.rows.get(contextRowIndex);
cell2 = row2.getCell(detailCellIndex);
}
}
}
if (cell2 != null && ExpressionUtils.isNonBlankData(cell2.value)) {
jsonWriter.key(c.property.id);
@ -293,7 +304,7 @@ public class HeuristicReconConfig extends ReconConfig {
recon.setFeature(Recon.Feature_typeMatch, false);
for (String typeID : candidate.typeIDs) {
if (typeID.equals(typeID)) {
if (this.typeID.equals(typeID)) {
recon.setFeature(Recon.Feature_typeMatch, true);
if (autoMatch && score >= 100) {
recon.match = candidate;
@ -392,7 +403,7 @@ public class HeuristicReconConfig extends ReconConfig {
recon.setFeature(Recon.Feature_typeMatch, false);
for (String typeID : candidate.typeIDs) {
if (typeID.equals(typeID)) {
if (this.typeID.equals(typeID)) {
recon.setFeature(Recon.Feature_typeMatch, true);
if (autoMatch &&
(score > 0.6 ||

View File

@ -33,7 +33,7 @@ abstract public class ReconConfig implements Jsonizable {
Project project,
int rowIndex,
Row row,
String columnName,
String columnName,
Cell cell
);

View File

@ -79,7 +79,7 @@ MenuSystem.positionMenuLeftRight = function(menu, elmt) {
}
if (offset.left + elmt.outerWidth() - document.body.scrollLeft + menu.outerWidth() > windowWidth - 10) {
menu.css("left", (offset.left - menu.outerWidth()) + "px");
menu.css("left", Math.max(10, offset.left - menu.outerWidth()) + "px");
} else {
menu.css("left", (offset.left + elmt.outerWidth()) + "px");
}