use of org.jkiss.dbeaver.ui.controls.resultset.valuefilter.FilterValueEditPopup in project dbeaver by serge-rider.
the class ResultSetViewer method showFiltersDistinctMenu.
public void showFiltersDistinctMenu(DBDAttributeBinding curAttribute, boolean atKeyboardCursor) {
Collection<ResultSetRow> selectedRows = getSelection().getSelectedRows();
ResultSetRow[] rows = selectedRows.toArray(new ResultSetRow[0]);
FilterValueEditPopup popup = new FilterValueEditPopup(getSite().getShell(), ResultSetViewer.this, curAttribute, rows);
Point location;
if (atKeyboardCursor) {
location = getKeyboardCursorLocation();
} else {
location = getSite().getWorkbenchWindow().getWorkbench().getDisplay().getCursorLocation();
}
if (location != null) {
popup.setLocation(location);
}
popup.setModeless(true);
if (popup.open() == IDialogConstants.OK_ID) {
Object value = popup.getValue();
DBDDataFilter filter = new DBDDataFilter(model.getDataFilter());
DBDAttributeConstraint constraint = filter.getConstraint(curAttribute);
if (constraint != null) {
constraint.setOperator(DBCLogicalOperator.IN);
constraint.setValue(value);
setDataFilter(filter, true);
}
}
}
use of org.jkiss.dbeaver.ui.controls.resultset.valuefilter.FilterValueEditPopup in project dbeaver by dbeaver.
the class ResultSetViewer method showFiltersDistinctMenu.
public void showFiltersDistinctMenu(DBDAttributeBinding curAttribute, boolean atKeyboardCursor) {
Collection<ResultSetRow> selectedRows = getSelection().getSelectedRows();
ResultSetRow[] rows = selectedRows.toArray(new ResultSetRow[0]);
FilterValueEditPopup popup = new FilterValueEditPopup(getSite().getShell(), ResultSetViewer.this, curAttribute, rows);
Point location;
if (atKeyboardCursor) {
location = getKeyboardCursorLocation();
} else {
location = getSite().getWorkbenchWindow().getWorkbench().getDisplay().getCursorLocation();
}
if (location != null) {
popup.setLocation(location);
}
popup.setModeless(true);
if (popup.open() == IDialogConstants.OK_ID) {
Object value = popup.getValue();
DBDDataFilter filter = new DBDDataFilter(model.getDataFilter());
DBDAttributeConstraint constraint = filter.getConstraint(curAttribute);
if (constraint != null) {
constraint.setOperator(DBCLogicalOperator.IN);
constraint.setValue(value);
setDataFilter(filter, true);
}
}
}
Aggregations