use of org.eclipse.draw2d.DefaultRangeModel in project archi by archimatetool.
the class RulerComposite method disposeRulerViewer.
private void disposeRulerViewer(GraphicalViewer viewer) {
if (viewer == null)
return;
/*
* There's a tie from the editor's range model to the RulerViewport (via
* a listener) to the RulerRootEditPart to the RulerViewer. Break this
* tie so that the viewer doesn't leak and can be garbage collected.
*/
RangeModel rModel = new DefaultRangeModel();
Viewport port = ((FigureCanvas) viewer.getControl()).getViewport();
port.setHorizontalRangeModel(rModel);
port.setVerticalRangeModel(rModel);
rulerEditDomain.removeViewer(viewer);
viewer.getControl().dispose();
}
Aggregations