Re-organized popup menus for row operations. Added filter row.starred.
Disabled rendering of key column and column groups for now. git-svn-id: http://google-refine.googlecode.com/svn/trunk@216 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
fe78fb8e30
commit
589b9cd936
@ -26,7 +26,7 @@ public class ExpressionNominalRowGrouper implements RowVisitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean visit(Project project, int rowIndex, Row row, boolean contextual) {
|
public boolean visit(Project project, int rowIndex, Row row, boolean contextual) {
|
||||||
Cell cell = row.getCell(_cellIndex);
|
Cell cell = _cellIndex < 0 ? null : row.getCell(_cellIndex);
|
||||||
|
|
||||||
Properties bindings = ExpressionUtils.createBindings(project);
|
Properties bindings = ExpressionUtils.createBindings(project);
|
||||||
ExpressionUtils.bind(bindings, row, rowIndex, cell);
|
ExpressionUtils.bind(bindings, row, rowIndex, cell);
|
||||||
|
@ -72,7 +72,12 @@ public class ListFacet implements Facet {
|
|||||||
_name = o.getString("name");
|
_name = o.getString("name");
|
||||||
_expression = o.getString("expression");
|
_expression = o.getString("expression");
|
||||||
_columnName = o.getString("columnName");
|
_columnName = o.getString("columnName");
|
||||||
_cellIndex = project.columnModel.getColumnByName(_columnName).getCellIndex();
|
|
||||||
|
if (_columnName.length() > 0) {
|
||||||
|
_cellIndex = project.columnModel.getColumnByName(_columnName).getCellIndex();
|
||||||
|
} else {
|
||||||
|
_cellIndex = -1;
|
||||||
|
}
|
||||||
|
|
||||||
_eval = MetaParser.parse(_expression);
|
_eval = MetaParser.parse(_expression);
|
||||||
_selection.clear();
|
_selection.clear();
|
||||||
|
@ -9,9 +9,9 @@ import com.metaweb.gridworks.model.Project;
|
|||||||
import com.metaweb.gridworks.model.Row;
|
import com.metaweb.gridworks.model.Row;
|
||||||
|
|
||||||
public class ExpressionEqualRowFilter implements RowFilter {
|
public class ExpressionEqualRowFilter implements RowFilter {
|
||||||
final protected Evaluable _evaluable;
|
final protected Evaluable _evaluable;
|
||||||
final protected int _cellIndex;
|
final protected int _cellIndex;
|
||||||
final protected Object[] _matches;
|
final protected Object[] _matches;
|
||||||
final protected boolean _selectBlank;
|
final protected boolean _selectBlank;
|
||||||
final protected boolean _selectError;
|
final protected boolean _selectError;
|
||||||
|
|
||||||
@ -24,7 +24,8 @@ public class ExpressionEqualRowFilter implements RowFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean filterRow(Project project, int rowIndex, Row row) {
|
public boolean filterRow(Project project, int rowIndex, Row row) {
|
||||||
Cell cell = row.getCell(_cellIndex);
|
Cell cell = _cellIndex < 0 ? null : row.getCell(_cellIndex);
|
||||||
|
|
||||||
Properties bindings = ExpressionUtils.createBindings(project);
|
Properties bindings = ExpressionUtils.createBindings(project);
|
||||||
ExpressionUtils.bind(bindings, row, rowIndex, cell);
|
ExpressionUtils.bind(bindings, row, rowIndex, cell);
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ Gridworks.createUpdateFunction = function(options, onFinallyDone) {
|
|||||||
if (options["everythingChanged"] || options["modelsChanged"] || options["columnStatsChanged"]) {
|
if (options["everythingChanged"] || options["modelsChanged"] || options["columnStatsChanged"]) {
|
||||||
pushFunction(Gridworks.reinitializeProjectData);
|
pushFunction(Gridworks.reinitializeProjectData);
|
||||||
}
|
}
|
||||||
if (options["everythingChanged"] || options["modelsChanged"] || options["rowsChanged"] || options["cellsChanged"] || options["engineChanged"]) {
|
if (options["everythingChanged"] || options["modelsChanged"] || options["rowsChanged"] || options["rowMetadataChanged"] || options["cellsChanged"] || options["engineChanged"]) {
|
||||||
pushFunction(function(onDone) {
|
pushFunction(function(onDone) {
|
||||||
ui.dataTableView.update(onDone);
|
ui.dataTableView.update(onDone);
|
||||||
});
|
});
|
||||||
|
@ -154,10 +154,12 @@ DataTableView.prototype.render = function() {
|
|||||||
renderColumnGroups(nextLayer, []);
|
renderColumnGroups(nextLayer, []);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
renderColumnGroups(
|
renderColumnGroups(
|
||||||
columnGroups,
|
columnGroups,
|
||||||
[ theProject.columnModel.keyCellIndex ]
|
[ theProject.columnModel.keyCellIndex ]
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
/*------------------------------------------------------------
|
/*------------------------------------------------------------
|
||||||
* Column Headers with Menus
|
* Column Headers with Menus
|
||||||
@ -294,38 +296,65 @@ DataTableView.prototype._onClickLastPage = function(elmt, evt) {
|
|||||||
DataTableView.prototype._createMenuForAllColumns = function(elmt) {
|
DataTableView.prototype._createMenuForAllColumns = function(elmt) {
|
||||||
self = this;
|
self = this;
|
||||||
MenuSystem.createAndShowStandardMenu([
|
MenuSystem.createAndShowStandardMenu([
|
||||||
{
|
{ label: "Edit",
|
||||||
label: "Collapse All Columns",
|
submenu: [
|
||||||
click: function() {
|
{
|
||||||
for (var i = 0; i < theProject.columnModel.columns.length; i++) {
|
label: "Star Rows",
|
||||||
theProject.columnModel.columns[i].collapsed = true;
|
click: function() {
|
||||||
|
Gridworks.postProcess("annotate-rows", { "starred" : "true" }, null, { rowMetadataChanged: true });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Unstar Rows",
|
||||||
|
click: function() {
|
||||||
|
Gridworks.postProcess("annotate-rows", { "starred" : "false" }, null, { rowMetadataChanged: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.render();
|
]
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{ label: "Filter",
|
||||||
label: "Expand All Columns",
|
submenu: [
|
||||||
click: function() {
|
{
|
||||||
for (var i = 0; i < theProject.columnModel.columns.length; i++) {
|
label: "By Star",
|
||||||
theProject.columnModel.columns[i].collapsed = false;
|
click: function() {
|
||||||
|
ui.browsingEngine.addFacet(
|
||||||
|
"list",
|
||||||
|
{
|
||||||
|
"name" : "Starred Rows",
|
||||||
|
"columnName" : "",
|
||||||
|
"expression" : "row.starred"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"scroll" : false
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.render();
|
]
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{},
|
{ label: "View",
|
||||||
{
|
submenu: [
|
||||||
label: "Star Rows",
|
{
|
||||||
click: function() {
|
label: "Collapse All Columns",
|
||||||
Gridworks.postProcess("annotate-rows", { "starred" : "true" }, null, { rowMetadataChanged: true });
|
click: function() {
|
||||||
}
|
for (var i = 0; i < theProject.columnModel.columns.length; i++) {
|
||||||
},
|
theProject.columnModel.columns[i].collapsed = true;
|
||||||
{
|
}
|
||||||
label: "Unstar Rows",
|
self.render();
|
||||||
click: function() {
|
}
|
||||||
Gridworks.postProcess("annotate-rows", { "starred" : "false" }, null, { rowMetadataChanged: true });
|
},
|
||||||
}
|
{
|
||||||
|
label: "Expand All Columns",
|
||||||
|
click: function() {
|
||||||
|
for (var i = 0; i < theProject.columnModel.columns.length; i++) {
|
||||||
|
theProject.columnModel.columns[i].collapsed = false;
|
||||||
|
}
|
||||||
|
self.render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
], elmt);
|
], elmt, { width: "80px", horizontal: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
DataTableView.sampleVisibleRows = function(column) {
|
DataTableView.sampleVisibleRows = function(column) {
|
||||||
|
Loading…
Reference in New Issue
Block a user