Search in sources :

Example 1 with BrokerLogParserDialog

use of com.cubrid.common.ui.common.dialog.BrokerLogParserDialog in project cubrid-manager by CUBRID.

the class BrokerLogParserAction method run.

public void run() {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window == null) {
        return;
    }
    BrokerLogParserDialog dialog = new BrokerLogParserDialog(window.getShell());
    dialog.open();
    if (dialog.getReturnCode() != IDialogConstants.OK_ID) {
        return;
    }
    String sql = dialog.getResultSql();
    try {
        QueryUnit input = new QueryUnit();
        QueryEditorPart editor = (QueryEditorPart) window.getActivePage().openEditor(input, QueryEditorPart.ID);
        editor.setQuery(sql, false, false, false);
    } catch (PartInitException e) {
        LOGGER.debug("Failed sql is {}.", sql);
        LOGGER.error("Can not parse broker sql log.", e);
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) BrokerLogParserDialog(com.cubrid.common.ui.common.dialog.BrokerLogParserDialog) QueryEditorPart(com.cubrid.common.ui.query.editor.QueryEditorPart) QueryUnit(com.cubrid.common.ui.query.editor.QueryUnit) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

BrokerLogParserDialog (com.cubrid.common.ui.common.dialog.BrokerLogParserDialog)1 QueryEditorPart (com.cubrid.common.ui.query.editor.QueryEditorPart)1 QueryUnit (com.cubrid.common.ui.query.editor.QueryUnit)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1