Bug #1889

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

Ajouté par Matthieu Decorde il y a presque 10 ans. Mis à jour il y a plus de 6 ans.

Statut:New Début:30/09/2016
Priorité:Normal Echéance:
Assigné à:- % réalisé:

0%

Catégorie:UI Temps passé: -
Version cible:TXM 0.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;
    }
}

Historique

#1 Mis à jour par Matthieu Decorde il y a presque 8 ans

  • Version cible changé de 5 à TXM 0.8.0a (split/restructuration)

#2 Mis à jour par Sebastien Jacquot il y a plus de 7 ans

  • Version cible changé de TXM 0.8.0a (split/restructuration) à TXM 0.8.0

#3 Mis à jour par Matthieu Decorde il y a plus de 6 ans

  • Version cible changé de TXM 0.8.0 à TXM 0.X.X

Formats disponibles : Atom PDF