Search in sources :

Example 6 with LogContentInfo

use of com.cubrid.cubridmanager.core.logs.model.LogContentInfo in project cubrid-manager by CUBRID.

the class CasRunnerResultViewDialog method connect.

/**
	 * each page of log connect
	 *
	 */
public void connect() {
    final GetLogListTask task = new GetLogListTask(selection.getServer().getServerInfo());
    task.setPath(path + "." + String.valueOf(currentResultFileIndex - 1));
    task.setDbName(dbName);
    task.setStart(Long.toString(lineStart));
    task.setEnd(Long.toString(lineEnd));
    task.execute();
    TaskExecutor taskExecutor = new CommonTaskExec(Messages.loadLogTaskName);
    taskExecutor.addTask(task);
    new ExecTaskWithProgress(taskExecutor).exec();
    if (taskExecutor.isSuccess()) {
        LogContentInfo logContentInfo = (LogContentInfo) task.getLogContent();
        this.setinfo(logContentInfo, selection);
    }
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) LogContentInfo(com.cubrid.cubridmanager.core.logs.model.LogContentInfo) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) GetLogListTask(com.cubrid.cubridmanager.core.logs.task.GetLogListTask)

Example 7 with LogContentInfo

use of com.cubrid.cubridmanager.core.logs.model.LogContentInfo in project cubrid-manager by CUBRID.

the class ResetAdminLogAction method refreshLogEditor.

/**
	 *
	 * Refresh the log editor
	 *
	 * @param node ICubridNode
	 */
private void refreshLogEditor(ICubridNode node) {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IWorkbenchPage activePage = window.getActivePage();
    IEditorPart editor = activePage.findEditor(node);
    if (null != editor) {
        LogInfo logInfo = (LogInfo) node.getAdapter(LogInfo.class);
        TaskExecutor taskExecutor = new CommonTaskExec(Messages.viewLogJobName);
        GetLogListTask task = new GetLogListTask(node.getServer().getServerInfo());
        task.setPath(logInfo.getPath());
        task.setStart("1");
        task.setEnd("100");
        taskExecutor.addTask(task);
        new ExecTaskWithProgress(taskExecutor).busyCursorWhile();
        LogContentInfo logContentInfo = (LogContentInfo) task.getLogContent();
        try {
            editor = window.getActivePage().openEditor(node, LogEditorPart.ID);
            ((LogEditorPart) editor).setTableInfo(logContentInfo, true);
        } catch (PartInitException e) {
            LOGGER.error(e.getMessage(), e);
        }
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) LogInfo(com.cubrid.cubridmanager.core.logs.model.LogInfo) LogContentInfo(com.cubrid.cubridmanager.core.logs.model.LogContentInfo) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) GetLogListTask(com.cubrid.cubridmanager.core.logs.task.GetLogListTask) IEditorPart(org.eclipse.ui.IEditorPart) PartInitException(org.eclipse.ui.PartInitException) LogEditorPart(com.cubrid.cubridmanager.ui.logs.editor.LogEditorPart)

Example 8 with LogContentInfo

use of com.cubrid.cubridmanager.core.logs.model.LogContentInfo in project cubrid-manager by CUBRID.

the class TimeSetAction method run.

/**
	 * Open dialog
	 */
public void run() {
    TimeSetDialog timeSetDialog = new TimeSetDialog(getShell());
    timeSetDialog.create();
    timeSetDialog.getShell().setSize(580, 275);
    if (timeSetDialog.open() == Dialog.OK) {
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        if (window == null) {
            return;
        }
        Object[] obj = this.getSelectedObj();
        if (!isSupported(obj[0])) {
            setEnabled(false);
            return;
        }
        ICubridNode node = (ICubridNode) obj[0];
        LogInfo logInfo = (LogInfo) node.getAdapter(LogInfo.class);
        GetLogListTask task = new GetLogListTask(node.getServer().getServerInfo());
        task.setPath(logInfo.getPath());
        task.setStart("1");
        task.setEnd("100");
        TaskExecutor taskExcutor = new CommonTaskExec(Messages.loadLogTaskName);
        taskExcutor.addTask(task);
        new ExecTaskWithProgress(taskExcutor).exec();
        if (!taskExcutor.isSuccess()) {
            return;
        }
        LogContentInfo logContentInfo = (LogContentInfo) task.getLogContent();
        IEditorPart editor;
        try {
            editor = window.getActivePage().openEditor(node, LogEditorPart.ID);
            ((LogEditorPart) editor).setTableInfo(logContentInfo, true);
        } catch (PartInitException e) {
            LOGGER.error(e.getMessage(), e);
        }
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) LogInfo(com.cubrid.cubridmanager.core.logs.model.LogInfo) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) IEditorPart(org.eclipse.ui.IEditorPart) TimeSetDialog(com.cubrid.cubridmanager.ui.logs.dialog.TimeSetDialog) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) LogContentInfo(com.cubrid.cubridmanager.core.logs.model.LogContentInfo) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) GetLogListTask(com.cubrid.cubridmanager.core.logs.task.GetLogListTask) PartInitException(org.eclipse.ui.PartInitException) LogEditorPart(com.cubrid.cubridmanager.ui.logs.editor.LogEditorPart)

Example 9 with LogContentInfo

use of com.cubrid.cubridmanager.core.logs.model.LogContentInfo in project cubrid-manager by CUBRID.

the class LogsModelTest method testModelLogContentInfo.

public void testModelLogContentInfo() {
    LogContentInfo bean = new LogContentInfo();
    bean.setPath("path");
    assertEquals(bean.getPath(), "path");
    bean.setStart("start");
    assertEquals(bean.getStart(), "start");
    bean.setEnd("end");
    assertEquals(bean.getEnd(), "end");
    bean.setTotal("total");
    assertEquals(bean.getTotal(), "total");
    bean.getTaskName();
    bean.getLine();
    bean.addLine("");
}
Also used : LogContentInfo(com.cubrid.cubridmanager.core.logs.model.LogContentInfo)

Example 10 with LogContentInfo

use of com.cubrid.cubridmanager.core.logs.model.LogContentInfo in project cubrid-manager by CUBRID.

the class LogsModelTest method testModelLogContentInfo.

public void testModelLogContentInfo() {
    LogContentInfo bean = new LogContentInfo();
    bean.setPath("path");
    assertEquals(bean.getPath(), "path");
    bean.setStart("start");
    assertEquals(bean.getStart(), "start");
    bean.setEnd("end");
    assertEquals(bean.getEnd(), "end");
    bean.setTotal("total");
    assertEquals(bean.getTotal(), "total");
    bean.getTaskName();
    bean.getLine();
    bean.addLine("");
}
Also used : LogContentInfo(com.cubrid.cubridmanager.core.logs.model.LogContentInfo)

Aggregations

LogContentInfo (com.cubrid.cubridmanager.core.logs.model.LogContentInfo)12 GetLogListTask (com.cubrid.cubridmanager.core.logs.task.GetLogListTask)8 IEditorPart (org.eclipse.ui.IEditorPart)5 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)5 PartInitException (org.eclipse.ui.PartInitException)5 ITask (com.cubrid.common.core.task.ITask)4 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)4 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)4 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)4 TaskJobExecutor (com.cubrid.common.ui.spi.progress.TaskJobExecutor)4 LogInfo (com.cubrid.cubridmanager.core.logs.model.LogInfo)4 LogEditorPart (com.cubrid.cubridmanager.ui.logs.editor.LogEditorPart)4 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)4 IStatus (org.eclipse.core.runtime.IStatus)4 Status (org.eclipse.core.runtime.Status)4 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)2 CheckFileTask (com.cubrid.cubridmanager.core.cubrid.database.task.CheckFileTask)2 DefaultCubridNode (com.cubrid.common.ui.spi.model.DefaultCubridNode)1 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)1 TreeNode (com.cubrid.cubridmanager.core.common.socket.TreeNode)1