use of org.jkiss.dbeaver.model.navigator.DBNDatabaseItem in project dbeaver by serge-rider.
the class NavigatorHandlerFilterConfig method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final ISelection selection = HandlerUtil.getCurrentSelection(event);
DBNNode node = NavigatorUtils.getSelectedNode(selection);
if (node instanceof DBNDatabaseItem) {
node = node.getParentNode();
}
if (node instanceof DBNDatabaseFolder) {
configureFilters(HandlerUtil.getActiveShell(event), node);
}
return null;
}
use of org.jkiss.dbeaver.model.navigator.DBNDatabaseItem in project dbeaver by dbeaver.
the class NavigatorHandlerFilterClear method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final ISelection selection = HandlerUtil.getCurrentSelection(event);
DBNNode node = NavigatorUtils.getSelectedNode(selection);
if (node instanceof DBNDatabaseItem) {
node = node.getParentNode();
}
if (node instanceof DBNDatabaseFolder) {
final DBNDatabaseFolder folder = (DBNDatabaseFolder) node;
DBXTreeItem itemsMeta = folder.getItemsMeta();
if (itemsMeta != null) {
folder.setNodeFilter(itemsMeta, new DBSObjectFilter());
NavigatorHandlerRefresh.refreshNavigator(Collections.singleton(folder));
}
}
return null;
}
use of org.jkiss.dbeaver.model.navigator.DBNDatabaseItem in project dbeaver by dbeaver.
the class NavigatorHandlerFilterConfig method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final ISelection selection = HandlerUtil.getCurrentSelection(event);
DBNNode node = NavigatorUtils.getSelectedNode(selection);
if (node instanceof DBNDatabaseItem) {
node = node.getParentNode();
}
if (node instanceof DBNDatabaseFolder) {
configureFilters(HandlerUtil.getActiveShell(event), node);
}
return null;
}
use of org.jkiss.dbeaver.model.navigator.DBNDatabaseItem in project dbeaver by serge-rider.
the class NavigatorHandlerFilterConfig method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final ISelection selection = HandlerUtil.getCurrentSelection(event);
DBNNode node = NavigatorUtils.getSelectedNode(selection);
if (node instanceof DBNDatabaseItem) {
node = node.getParentNode();
}
if (node instanceof DBNDatabaseFolder) {
configureFilters(HandlerUtil.getActiveShell(event), node);
}
return null;
}
use of org.jkiss.dbeaver.model.navigator.DBNDatabaseItem in project dbeaver by serge-rider.
the class NavigatorHandlerFilterToggle method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final ISelection selection = HandlerUtil.getCurrentSelection(event);
DBNNode node = NavigatorUtils.getSelectedNode(selection);
if (node instanceof DBNDatabaseItem) {
node = node.getParentNode();
}
if (node instanceof DBNDatabaseFolder) {
final DBNDatabaseFolder folder = (DBNDatabaseFolder) node;
DBXTreeItem itemsMeta = folder.getItemsMeta();
if (itemsMeta != null) {
final DBSObjectFilter nodeFilter = folder.getNodeFilter(itemsMeta, true);
if (nodeFilter != null) {
nodeFilter.setEnabled(!nodeFilter.isEnabled());
NavigatorHandlerRefresh.refreshNavigator(Collections.singleton(folder));
}
}
}
return null;
}
Aggregations