Minor cleanup for workspace size tracking code.
[simantics/platform.git] / bundles / org.simantics.ui.workspace.tracker / src / org / simantics / ui / workspace / tracker / internal / preferences / WorkspaceSizeTrackingPreferenceInitializer.java
1 package org.simantics.ui.workspace.tracker.internal.preferences;
2
3 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
4 import org.eclipse.core.runtime.preferences.DefaultScope;
5 import org.eclipse.core.runtime.preferences.IScopeContext;
6 import org.osgi.service.prefs.Preferences;
7 import org.simantics.ui.workspace.tracker.internal.contributions.IWorkspaceSizeTrackerConstants;
8
9 /**
10  * @author Tuukka Lehtonen
11  * @since 1.31.0
12  */
13 public class WorkspaceSizeTrackingPreferenceInitializer extends AbstractPreferenceInitializer {
14
15         public WorkspaceSizeTrackingPreferenceInitializer() {
16         }
17
18         @Override
19         public void initializeDefaultPreferences() {
20                 IScopeContext context = DefaultScope.INSTANCE;
21                 Preferences node = context.getNode(IWorkspaceSizeTrackerConstants.P_NODE);
22                 node.putBoolean(IWorkspaceSizeTrackerConstants.PREF_SHOW_MONITOR, IWorkspaceSizeTrackerConstants.DEFAULT_SHOW_MONITOR);
23                 node.putInt(IWorkspaceSizeTrackerConstants.PREF_UPDATE_INTERVAL, IWorkspaceSizeTrackerConstants.DEFAULT_UPDATE_INTERVAL);
24                 node.putBoolean(IWorkspaceSizeTrackerConstants.PREF_HIGHLIGHT_LOW_SPACE, IWorkspaceSizeTrackerConstants.DEFAULT_HIGHLIGHT_LOW_SPACE);
25                 node.putLong(IWorkspaceSizeTrackerConstants.PREF_LOW_SPACE_THRESHOLD, IWorkspaceSizeTrackerConstants.DEFAULT_LOW_SPACE_THRESHOLD);
26         }
27
28 }