Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Workspace Size Monitoring Service
+Bundle-Name: Simantics File System Services
Bundle-SymbolicName: org.simantics.filesystem.services
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.simantics.filesystem.services.internal.Activator
*/
public interface IWorkspaceSizeTrackerConstants {
- String P_NODE = "org.simantics.ui.workspace.tracker";
+ String P_NODE = "org.simantics.ui.workspace.tracker"; //$NON-NLS-1$
/**
* Boolean preference key for whether or not to show the status bar workspace
*/
String PREF_LOW_SPACE_THRESHOLD = "WorkspaceSizeTracker.lowSpaceThreshold"; //$NON-NLS-1$
+ boolean DEFAULT_SHOW_MONITOR = true;
+ int DEFAULT_UPDATE_INTERVAL = 1000;
+ boolean DEFAULT_HIGHLIGHT_LOW_SPACE = true;
+ long DEFAULT_LOW_SPACE_THRESHOLD = 500L;
+
}
private SizeTracker sizeTracker;
private IPreferenceStore prefStore;
+ /**
+ * How many MB of free disk space means we are low on disk space?
+ */
+ private long lowSpaceThreshold = IWorkspaceSizeTrackerConstants.DEFAULT_LOW_SPACE_THRESHOLD;
+ private boolean highlightLowSpace = IWorkspaceSizeTrackerConstants.DEFAULT_HIGHLIGHT_LOW_SPACE;
+ private int updateInterval = IWorkspaceSizeTrackerConstants.DEFAULT_UPDATE_INTERVAL;
+
private Color bgCol, usedSpaceCol, lowSpaceCol, topLeftCol, bottomRightCol, sepCol, textCol;
@SuppressWarnings("unused")
private Color markCol;
- private int updateInterval;
-
private String storeName;
private long totalSpace;
private long availableSpace;
private boolean hasChanged;
private long mark = -1;
- /**
- * How many MB of free disk space means we are low on disk space?
- */
- private long lowSpaceThreshold = 500;
- private boolean highlightLowSpace = true;
-
private boolean updateTooltip = false;
private final Runnable timer = new Runnable() {
prefStore.addPropertyChangeListener(prefListener);
setUpdateIntervalInMS(prefStore.getInt(IWorkspaceSizeTrackerConstants.PREF_UPDATE_INTERVAL));
+ highlightLowSpace = prefStore.getBoolean(IWorkspaceSizeTrackerConstants.PREF_HIGHLIGHT_LOW_SPACE);
+ lowSpaceThreshold = prefStore.getLong(IWorkspaceSizeTrackerConstants.PREF_LOW_SPACE_THRESHOLD);
Display display = getDisplay();
usedSpaceCol = display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
public void initializeDefaultPreferences() {
IScopeContext context = DefaultScope.INSTANCE;
Preferences node = context.getNode(IWorkspaceSizeTrackerConstants.P_NODE);
- node.putBoolean(IWorkspaceSizeTrackerConstants.PREF_SHOW_MONITOR, true);
- node.putInt(IWorkspaceSizeTrackerConstants.PREF_UPDATE_INTERVAL, 1000);
- node.putBoolean(IWorkspaceSizeTrackerConstants.PREF_HIGHLIGHT_LOW_SPACE, true);
- node.putLong(IWorkspaceSizeTrackerConstants.PREF_LOW_SPACE_THRESHOLD, 500);
+ node.putBoolean(IWorkspaceSizeTrackerConstants.PREF_SHOW_MONITOR, IWorkspaceSizeTrackerConstants.DEFAULT_SHOW_MONITOR);
+ node.putInt(IWorkspaceSizeTrackerConstants.PREF_UPDATE_INTERVAL, IWorkspaceSizeTrackerConstants.DEFAULT_UPDATE_INTERVAL);
+ node.putBoolean(IWorkspaceSizeTrackerConstants.PREF_HIGHLIGHT_LOW_SPACE, IWorkspaceSizeTrackerConstants.DEFAULT_HIGHLIGHT_LOW_SPACE);
+ node.putLong(IWorkspaceSizeTrackerConstants.PREF_LOW_SPACE_THRESHOLD, IWorkspaceSizeTrackerConstants.DEFAULT_LOW_SPACE_THRESHOLD);
}
}
fHighlightLowSpace = new BooleanFieldEditor(IWorkspaceSizeTrackerConstants.PREF_HIGHLIGHT_LOW_SPACE, Messages.WorkspaceSizeTrackingPreferencePage_Highlight_Low_Space, SWT.NONE, getFieldEditorParent());
addField(fHighlightLowSpace);
fLowSpaceThreshold = new IntegerFieldEditor(IWorkspaceSizeTrackerConstants.PREF_LOW_SPACE_THRESHOLD, Messages.WorkspaceSizeTrackingPreferencePage_Low_Space_Threshold, getFieldEditorParent());
- fLowSpaceThreshold.setValidRange(100, 500000);
+ fLowSpaceThreshold.setValidRange(100, 100000000);
addField(fLowSpaceThreshold);
}