Search in sources :

Example 1 with DefaultRangeModel

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();
}
Also used : FigureCanvas(org.eclipse.draw2d.FigureCanvas) Viewport(org.eclipse.draw2d.Viewport) DefaultRangeModel(org.eclipse.draw2d.DefaultRangeModel) DefaultRangeModel(org.eclipse.draw2d.DefaultRangeModel) RangeModel(org.eclipse.draw2d.RangeModel)

Aggregations

DefaultRangeModel (org.eclipse.draw2d.DefaultRangeModel)1 FigureCanvas (org.eclipse.draw2d.FigureCanvas)1 RangeModel (org.eclipse.draw2d.RangeModel)1 Viewport (org.eclipse.draw2d.Viewport)1