兑现GEF RulerComposite

实现GEF RulerComposite模型部分:/** * 配置标尺 */private void configureRuler() {GraphicalViewer view

实现GEF RulerComposite
模型部分:

/** * 配置标尺 */private void configureRuler() {GraphicalViewer viewer = getGraphicalViewer();viewer.setProperty(RulerProvider.PROPERTY_VERTICAL_RULER,new EditorRulerProvider(new Ruler(false)));viewer.setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER,new EditorRulerProvider(new Ruler(true)));viewer.setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY, true);IAction action = new ToggleRulerVisibilityAction(getGraphicalViewer());getActionRegistry().registerAction(action);}


最后在configureGraphicalViewer方法中调用configureRuler即可