提交 4012db34 编写于 作者: J jurgen

Quick filters fix & RSV context menu fix & grid fix (change focus column even if grid is empty)

上级 6f38eceb
......@@ -3207,6 +3207,9 @@ public class LightGrid extends Canvas {
showColumn(col);
redraw();
} else {
// Change focus column anyway
focusColumn = getColumn(new Point(e.x, e.y));
}
if (selectionEvent != null) {
......
......@@ -56,10 +56,10 @@ public class ResultSetPropertyTester extends PropertyTester
return rsv.getRowsCount() > 0;
} else if (PROP_CAN_COPY.equals(property)) {
final GridPos currentPosition = rsv.getCurrentPosition();
return currentPosition != null && currentPosition.isValid();
return rsv.isValidCell(currentPosition);
} else if (PROP_CAN_PASTE.equals(property) || PROP_CAN_CUT.equals(property)) {
final GridPos currentPosition = rsv.getCurrentPosition();
return currentPosition != null && !rsv.isColumnReadOnly(currentPosition);
return rsv.isValidCell(currentPosition) && !rsv.isColumnReadOnly(currentPosition);
} else if (PROP_CAN_MOVE.equals(property)) {
int currentRow = rsv.getCurrentRow();
if ("back".equals(expectedValue)) {
......
......@@ -1034,18 +1034,22 @@ public class ResultSetViewer extends Viewer implements IDataSourceProvider, ISpr
private void fillFiltersMenu(IMenuManager filtersMenu)
{
GridPos currentPosition = getCurrentPosition();
if (supportsDataFilter() && isValidCell(currentPosition)) {
int columnIndex = translateGridPos(currentPosition).col;
int columnIndex = translateGridPos(currentPosition).col;
if (supportsDataFilter() && columnIndex >= 0) {
DBDAttributeBinding column = metaColumns[columnIndex];
if (column.getTableColumn() == null) {
return;
}
DBSDataKind dataKind = DBUtils.getDataKind(column.getAttribute());
if (!column.getAttribute().isRequired()) {
filtersMenu.add(new FilterByColumnAction("IS NULL", FilterByColumnType.VALUE, column));
filtersMenu.add(new FilterByColumnAction("IS NOT NULL", FilterByColumnType.VALUE, column));
filtersMenu.add(new FilterByColumnAction("IS NULL", FilterByColumnType.NONE, column));
filtersMenu.add(new FilterByColumnAction("IS NOT NULL", FilterByColumnType.NONE, column));
}
for (FilterByColumnType type : FilterByColumnType.values()) {
if (type == FilterByColumnType.NONE || (type == FilterByColumnType.VALUE && !isValidCell(currentPosition))) {
// Value filters are available only if certain cell is selected
continue;
}
filtersMenu.add(new Separator());
if (type.getValue(this, column, true) == null) {
continue;
......@@ -2904,6 +2908,13 @@ public class ResultSetViewer extends Viewer implements IDataSourceProvider, ISpr
column.getAttribute(),
viewer.getSpreadsheet().getClipboard());
}
},
NONE(DBIcon.FILTER_VALUE.getImageDescriptor()) {
@Override
Object getValue(ResultSetViewer viewer, DBDAttributeBinding column, boolean useDefault)
{
return "";
}
};
final ImageDescriptor icon;
......
......@@ -206,7 +206,7 @@ public class Spreadsheet extends Composite implements Listener {
public GridPos getCursorPosition()
{
if (grid.isDisposed() || grid.getItemCount() <= 0 || grid.getColumnCount() <= 0) {
if (grid.isDisposed()) {
return new GridPos(-1, -1);
}
return grid.getFocusCell();
......
......@@ -62,6 +62,7 @@
- SQL scripts creation fix
- Metadata editors UI and undo/redo fixes
- Metadata property names localization
- Minor UI fixes
</release-notes>
</version>
......
......@@ -45,8 +45,8 @@
<Program_Info>
<Program_Name>DBeaver</Program_Name>
<Program_Version>1.6.4</Program_Version>
<Program_Release_Month>09</Program_Release_Month>
<Program_Release_Day>16</Program_Release_Day>
<Program_Release_Month>10</Program_Release_Month>
<Program_Release_Day>04</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>
<Program_Cost_Dollars>0</Program_Cost_Dollars>
<Program_Type>Freeware</Program_Type>
......@@ -65,6 +65,7 @@
- SQL scripts creation fix
- Metadata editors UI and undo/redo fixes
- Metadata property names localization
- Minor UI fixes
</Program_Change_Info>
<Program_System_Requirements>Java 1.6 or higher</Program_System_Requirements>
<Program_Category_Class>Development::Other</Program_Category_Class>
......@@ -79,22 +80,12 @@
</File_Info>
<Expire_Info>
<Has_Expire_Info>N</Has_Expire_Info>
<Expire_Based_On>Days</Expire_Based_On>
<Expire_Count></Expire_Count>
<Expire_Other_Info></Expire_Other_Info>
<Expire_Month></Expire_Month>
<Expire_Day></Expire_Day>
<Expire_Year></Expire_Year>
</Expire_Info>
<Program_Categories>SQL Client,Databases,Other,Development</Program_Categories>
<Limitations>none</Limitations>
<Program_Cost_Other_Code></Program_Cost_Other_Code>
<Program_Cost_Other></Program_Cost_Other>
<Awards></Awards>
<Program_Specific_Category></Program_Specific_Category>
<Includes_JAVA_VM></Includes_JAVA_VM>
<Includes_VB_Runtime></Includes_VB_Runtime>
<Includes_DirectX></Includes_DirectX>
</Program_Info>
<Web_Info>
<Application_URLs>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册