Search in sources :

Example 1 with IResultSetPanel

use of org.jkiss.dbeaver.ui.controls.resultset.IResultSetPanel in project dbeaver by serge-rider.

the class ValueViewCommandHandler method execute.

@Nullable
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    final ResultSetViewer rsv = (ResultSetViewer) ResultSetCommandHandler.getActiveResultSet(HandlerUtil.getActivePart(event));
    if (rsv == null) {
        return null;
    }
    String actionId = event.getCommand().getId();
    IResultSetPanel visiblePanel = rsv.getVisiblePanel();
    if (visiblePanel instanceof ViewValuePanel) {
        switch(actionId) {
            case ITextEditorActionDefinitionIds.SMART_ENTER:
            case CoreCommands.CMD_EXECUTE_STATEMENT:
            case CMD_SAVE_VALUE:
                ((ViewValuePanel) visiblePanel).saveValue();
                break;
        }
    }
    return null;
}
Also used : IResultSetPanel(org.jkiss.dbeaver.ui.controls.resultset.IResultSetPanel) ResultSetViewer(org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer) Nullable(org.jkiss.code.Nullable)

Example 2 with IResultSetPanel

use of org.jkiss.dbeaver.ui.controls.resultset.IResultSetPanel in project dbeaver by serge-rider.

the class ValueViewCommandHandler method execute.

@Nullable
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    final ResultSetViewer rsv = (ResultSetViewer) ResultSetHandlerMain.getActiveResultSet(HandlerUtil.getActivePart(event));
    if (rsv == null) {
        return null;
    }
    String actionId = event.getCommand().getId();
    IResultSetPanel visiblePanel = rsv.getVisiblePanel();
    if (visiblePanel instanceof ValueViewerPanel) {
        switch(actionId) {
            case ITextEditorActionDefinitionIds.SMART_ENTER:
            // case CoreCommands.CMD_EXECUTE_STATEMENT:
            case CMD_SAVE_VALUE:
                ((ValueViewerPanel) visiblePanel).saveValue();
                break;
        }
    }
    return null;
}
Also used : IResultSetPanel(org.jkiss.dbeaver.ui.controls.resultset.IResultSetPanel) ResultSetViewer(org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer) Nullable(org.jkiss.code.Nullable)

Example 3 with IResultSetPanel

use of org.jkiss.dbeaver.ui.controls.resultset.IResultSetPanel in project dbeaver by dbeaver.

the class ValueViewCommandHandler method execute.

@Nullable
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    final ResultSetViewer rsv = (ResultSetViewer) ResultSetCommandHandler.getActiveResultSet(HandlerUtil.getActivePart(event));
    if (rsv == null) {
        return null;
    }
    String actionId = event.getCommand().getId();
    IResultSetPanel visiblePanel = rsv.getVisiblePanel();
    if (visiblePanel instanceof ViewValuePanel) {
        switch(actionId) {
            case ITextEditorActionDefinitionIds.SMART_ENTER:
            case CoreCommands.CMD_EXECUTE_STATEMENT:
            case CMD_SAVE_VALUE:
                ((ViewValuePanel) visiblePanel).saveValue();
                break;
        }
    }
    return null;
}
Also used : IResultSetPanel(org.jkiss.dbeaver.ui.controls.resultset.IResultSetPanel) ResultSetViewer(org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer) Nullable(org.jkiss.code.Nullable)

Aggregations

Nullable (org.jkiss.code.Nullable)3 IResultSetPanel (org.jkiss.dbeaver.ui.controls.resultset.IResultSetPanel)3 ResultSetViewer (org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer)3