Search code examples
javafileeclipse-rcpworkbenchrevision-history

Eclipse RCP 4.10 Workbench local file History


the local History provided by Eclipse RCP in my workbench application works amazingly well, but once my Module increases it's size over 1MB the History shows only the timestamp of the last saved instance of the file.

Does the limitation on the file size in my case Module is of *.xml extension come from Eclipse and how can i guarantee a History for the user even for files exceeding 1MB is there any workaround?


Solution

  • Local History limits are configured in the Preferences in 'General > Workspace > Local History'

    The settings are stored in org.eclipse.core.resources.IWorkspaceDescription

    IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription();
    
    description.setFileStateLongevity(...);
    description.setMaxFileStates(...);
    description.setMaxFileStateSize(...);
    description.setApplyFileStatePolicy(...);
    
    ResourcesPlugin.getWorkspace().setDescription(description);