here's a fix to the problem that preferences of the Eclipse-plugin only got initialized to their default values when the preference page was actually opened.
solution: there's an API for such stuff, use it ;-)
-chris
Index: Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusPlugin.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusPlugin.java,v
retrieving revision 1.5
diff -u -r1.5 CactusPlugin.java
--- CactusPlugin.java 19 Oct 2002 18:51:17 -0000 1.5
+++ CactusPlugin.java 22 Oct 2002 13:15:13 -0000
@@ -59,6 +59,7 @@
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
@@ -152,6 +153,19 @@
display = Display.getDefault();
}
return display;
+ }
+
+ /**
+ * Initializes all preferences to their default values.
+ *
+ * @param theStore the preference store
+ */
+ protected void initializeDefaultPreferences(IPreferenceStore theStore)
+ {
+ theStore.setDefault(CactusPreferences.CONTEXT_URL_SCHEME, "http");
+ theStore.setDefault(CactusPreferences.CONTEXT_URL_HOST, "localhost");
+ theStore.setDefault(CactusPreferences.CONTEXT_URL_PORT, 8080);
+ theStore.setDefault(CactusPreferences.CONTEXT_URL_PATH, "test");
}
}
Index: Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusPreferencePage.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/ui/CactusPreferencePage.java,v
retrieving revision 1.2
diff -u -r1.2 CactusPreferencePage.java
--- CactusPreferencePage.java 22 Oct 2002 09:33:08 -0000 1.2
+++ CactusPreferencePage.java 22 Oct 2002 13:15:13 -0000
@@ -96,19 +96,6 @@
// TODO: externalize
setDescription("Preferences of the Apache Cactus plug-in "
+ "for in-container unit testing");
- initializeDefaults();
- }
-
- /**
- * Sets the default values of the preferences.
- */
- private void initializeDefaults()
- {
- IPreferenceStore store = getPreferenceStore();
- store.setDefault(CactusPreferences.CONTEXT_URL_SCHEME, "http");
- store.setDefault(CactusPreferences.CONTEXT_URL_HOST, "localhost");
- store.setDefault(CactusPreferences.CONTEXT_URL_PORT, 8080);
- store.setDefault(CactusPreferences.CONTEXT_URL_PATH, "test");
}
/**-- To unsubscribe, e-mail: <mailto:cactus-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:cactus-dev-help@;jakarta.apache.org>
