提交 35a425ed 编写于 作者: S serge-rider

Results ordering: context menu actions

上级 19c18ebb
......@@ -2057,7 +2057,10 @@ public class ResultSetViewer extends Viewer
}
}
filtersMenu.add(new Separator());
filtersMenu.add(new OrderByAttributeAction(attribute, true));
filtersMenu.add(new OrderByAttributeAction(attribute, false));
filtersMenu.add(ActionUtils.makeCommandContribution(site, ResultSetCommandHandler.CMD_TOGGLE_ORDER));
filtersMenu.add(new Separator());
filtersMenu.add(new ToggleServerSideOrderingAction());
filtersMenu.add(new ShowFiltersAction(true));
}
......@@ -3422,6 +3425,23 @@ public class ResultSetViewer extends Viewer
}
}
private class OrderByAttributeAction extends Action {
private final DBDAttributeBinding attribute;
private final boolean ascending;
public OrderByAttributeAction(DBDAttributeBinding attribute, boolean ascending) {
super("Order by " + attribute.getName() + " " + (ascending ? "ASC" : "DESC"));
this.attribute = attribute;
this.ascending = ascending;
}
@Override
public void run()
{
toggleSortOrder(attribute, ascending, !ascending);
}
}
private class TransformComplexTypesToggleAction extends Action {
TransformComplexTypesToggleAction()
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册