Skip to content

Commit

Permalink
Fixes #680 glitch in editor corrupts the view
Browse files Browse the repository at this point in the history
  • Loading branch information
javierfernandes committed Jul 8, 2016
1 parent fb4fa95 commit c61109b
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ import org.uqbar.project.wollok.wollokDsl.WollokDslPackage

import static extension org.uqbar.project.wollok.model.WMethodContainerExtensions.*
import org.uqbar.project.wollok.ui.diagrams.classes.parts.InheritanceConnectionEditPart
import org.eclipse.ui.PlatformUI
import org.eclipse.core.runtime.Platform
import org.eclipse.ui.internal.UISynchronizer
import org.eclipse.core.runtime.jobs.Job
import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.core.runtime.IStatus
import org.eclipse.core.runtime.Status
import org.eclipse.ui.progress.UIJob

/**
*
Expand Down Expand Up @@ -336,16 +344,24 @@ class ClassDiagramView extends ViewPart implements ISelectionListener, ISourceVi
refresh()
}
}
val refreshJob = new UIJob("Updating diagram view") {
override def runInUIThread(IProgressMonitor monitor) {
diagram = createDiagramModel
initializeGraphicalViewer
Status.OK_STATUS
}
}

def refresh() {
diagram = createDiagramModel
initializeGraphicalViewer
refreshJob.schedule
}

// IDocumentListener

override documentAboutToBeChanged(DocumentEvent event) { }
override documentChanged(DocumentEvent event) { refresh }
override documentChanged(DocumentEvent event) {
refresh
}

// ****************************
// ** Palette
Expand Down

0 comments on commit c61109b

Please sign in to comment.