Bug #1889

RCP: X.X, Ensure all potentially long operations are executed in a Job

Added by Matthieu Decorde about 3 years ago. Updated 9 months ago.

Status:New Start date:09/30/2016
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:UI Spent time: -
Target version:TXM X.X

Description

If executed in the UI thread, a long operation can freeze the UI.

Are concerned:
  • network operations
  • database operations
  • file operations
  • etc.

Solution

If possible run operations within a JobHandler class (not in the UI thread)

JobHandler = new JobHandler("title") {
    @Override
    protected IStatus run(IProgressMonitor monitor) {

        // do something
        ...

        // do something in the UI thread
        this.syncExec(new Runnable() {
            @Override
            public void run() {
                ...
            }
        });

        return Status.OK_STATUS;
    }
}

History

#1 Updated by Matthieu Decorde about 2 years ago

  • Target version changed from 5 to TXM 0.8.0a (split/restructuration)

#2 Updated by Sebastien Jacquot over 1 year ago

  • Target version changed from TXM 0.8.0a (split/restructuration) to TXM 0.8.0

#3 Updated by Matthieu Decorde 9 months ago

  • Target version changed from TXM 0.8.0 to TXM X.X

Also available in: Atom PDF