Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364441

Summary: enable preference controlled grid settings
Product: [Modeling] Graphiti Reporter: Henrik Rentz-Reichert <hrr>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P4 CC: michael.wenz
Version: 0.8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Henrik Rentz-Reichert CLA 2011-11-22 02:42:52 EST
I refer to the discussion in the newsgroup thread "grid settings should be controlled by preferences rather than being diagram properties".

It seems to be clear that the diagram is not the right place to store grid settings like horizontal and vertical units and 'snap to grid' in the diagram itself. Rather, a change should be reflected immediately in open editors and should also apply to diagrams opened after the settings changed without changing the graphical model.

To cover the different needs expressed in the newsgroup thread I would propose to add the grid settings to the diagram provider and add API in an appropriate place that lets the framework update the settings for a given diagram type.

The AbstractDiagramTypeProvider could be extended by methods (supplying current defaults):

public boolean isGridVisible() {
    return true;
}
public boolean isSnapToGrid() {
    return false;
}
public int getHorizontalGridUnits() {
    return 10;
}
public int getVerticalGridUnits() {
    return 10;
}

I don't see which service should receive the update method. But the interface could be extended by
public void updateGridSettings(String diagramTypeId)

This method would consult the corresponding diagram type provider and use the new settings in the open and new editors for this diagram type.


Having the proposed API at hand the framework user can easily implement its own preferences as appropriate for him.

This enhancement is also related to bug 361300.
Comment 1 Michael Wenz CLA 2012-08-21 09:44:42 EDT
Due to limited team capacity this is out of scope for Kepler, unless there are contributions