Search in sources :

Example 1 with LoadingJob

use of org.jkiss.dbeaver.ui.LoadingJob in project dbeaver by dbeaver.

the class SQLToolTaskWizardPageStatus method createControl.

@Override
public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.BORDER);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setLayout(new FillLayout());
    SashForm partDivider = new SashForm(composite, SWT.VERTICAL);
    partDivider.setSashWidth(5);
    statusTable = new ObjectListControl<SQLToolStatistics>(partDivider, SWT.SHEET, new ListContentProvider()) {

        @NotNull
        @Override
        protected String getListConfigId(List<Class<?>> classList) {
            return "SQLToolStatus." + getWizard().getTaskType().getId();
        }

        @Override
        protected DBPImage getObjectImage(SQLToolStatistics item) {
            return DBValueFormatting.getObjectImage(item.getObject());
        }

        @Override
        protected LoadingJob<Collection<SQLToolStatistics>> createLoadService() {
            return LoadingJob.createService(new DummyLoadService(), new ObjectsLoadVisualizer());
        }
    };
    console = new MessageConsole(TasksSQLUIMessages.sql_tool_task_wizard_page_status_message_console_name_tool_log, null);
    LogConsoleViewer consoleViewer = new LogConsoleViewer(partDivider);
    console.setWaterMarks(1024 * 1024 * 3, 1024 * 1024 * 4);
    try {
        writer = new PrintStream(console.newMessageStream(), true, StandardCharsets.UTF_8.name());
    } catch (UnsupportedEncodingException e) {
        writer = new PrintStream(console.newMessageStream(), true);
    }
    setControl(composite);
}
Also used : PrintStream(java.io.PrintStream) MessageConsole(org.eclipse.ui.console.MessageConsole) Composite(org.eclipse.swt.widgets.Composite) LoadingJob(org.jkiss.dbeaver.ui.LoadingJob) UnsupportedEncodingException(java.io.UnsupportedEncodingException) FillLayout(org.eclipse.swt.layout.FillLayout) SQLToolStatistics(org.jkiss.dbeaver.model.sql.task.SQLToolStatistics) NotNull(org.jkiss.code.NotNull) DBPImage(org.jkiss.dbeaver.model.DBPImage) SashForm(org.eclipse.swt.custom.SashForm) ListContentProvider(org.jkiss.dbeaver.ui.controls.ListContentProvider) GridData(org.eclipse.swt.layout.GridData)

Example 2 with LoadingJob

use of org.jkiss.dbeaver.ui.LoadingJob in project dbeaver by serge-rider.

the class SQLToolTaskWizardPageStatus method createControl.

@Override
public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.BORDER);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setLayout(new FillLayout());
    SashForm partDivider = new SashForm(composite, SWT.VERTICAL);
    partDivider.setSashWidth(5);
    statusTable = new ObjectListControl<SQLToolStatistics>(partDivider, SWT.SHEET, new ListContentProvider()) {

        @NotNull
        @Override
        protected String getListConfigId(List<Class<?>> classList) {
            return "SQLToolStatus." + getWizard().getTaskType().getId();
        }

        @Override
        protected DBPImage getObjectImage(SQLToolStatistics item) {
            return DBValueFormatting.getObjectImage(item.getObject());
        }

        @Override
        protected LoadingJob<Collection<SQLToolStatistics>> createLoadService() {
            return LoadingJob.createService(new DummyLoadService(), new ObjectsLoadVisualizer());
        }
    };
    console = new MessageConsole(TasksSQLUIMessages.sql_tool_task_wizard_page_status_message_console_name_tool_log, null);
    LogConsoleViewer consoleViewer = new LogConsoleViewer(partDivider);
    console.setWaterMarks(1024 * 1024 * 3, 1024 * 1024 * 4);
    try {
        writer = new PrintStream(console.newMessageStream(), true, StandardCharsets.UTF_8.name());
    } catch (UnsupportedEncodingException e) {
        writer = new PrintStream(console.newMessageStream(), true);
    }
    setControl(composite);
}
Also used : PrintStream(java.io.PrintStream) MessageConsole(org.eclipse.ui.console.MessageConsole) Composite(org.eclipse.swt.widgets.Composite) LoadingJob(org.jkiss.dbeaver.ui.LoadingJob) UnsupportedEncodingException(java.io.UnsupportedEncodingException) FillLayout(org.eclipse.swt.layout.FillLayout) SQLToolStatistics(org.jkiss.dbeaver.model.sql.task.SQLToolStatistics) NotNull(org.jkiss.code.NotNull) DBPImage(org.jkiss.dbeaver.model.DBPImage) SashForm(org.eclipse.swt.custom.SashForm) ListContentProvider(org.jkiss.dbeaver.ui.controls.ListContentProvider) GridData(org.eclipse.swt.layout.GridData)

Aggregations

PrintStream (java.io.PrintStream)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 SashForm (org.eclipse.swt.custom.SashForm)2 FillLayout (org.eclipse.swt.layout.FillLayout)2 GridData (org.eclipse.swt.layout.GridData)2 Composite (org.eclipse.swt.widgets.Composite)2 MessageConsole (org.eclipse.ui.console.MessageConsole)2 NotNull (org.jkiss.code.NotNull)2 DBPImage (org.jkiss.dbeaver.model.DBPImage)2 SQLToolStatistics (org.jkiss.dbeaver.model.sql.task.SQLToolStatistics)2 LoadingJob (org.jkiss.dbeaver.ui.LoadingJob)2 ListContentProvider (org.jkiss.dbeaver.ui.controls.ListContentProvider)2