Bug #1889

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

Added by Matthieu Decorde about 7 years ago. Updated over 4 years 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 almost 6 years ago

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

#2 Updated by Sebastien Jacquot over 5 years ago

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

#3 Updated by Matthieu Decorde over 4 years ago

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

Also available in: Atom PDF