Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a PreferenceInitializer to set the default time out

And use the net.bioclipse.balloon.business.Activator's
PreferenceStore ( not the net.bioclipse.ui.Activator)

Solves bug 3061
  • Loading branch information...
commit 74e13aeb56b4c31ee32f6b51f4326ada43a82271 1 parent 6b86a49
@goglepox goglepox authored
View
6 plugins/net.bioclipse.balloon.business/plugin.xml
@@ -128,5 +128,11 @@
primary="true">
</toc>
</extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="net.bioclipse.balloon.ui.BalloonPreferenceInitializer">
+ </initializer>
+ </extension>
</plugin>
View
11 plugins/net.bioclipse.balloon.business/src/net/bioclipse/balloon/business/Activator.java
@@ -65,8 +65,6 @@ public void start(BundleContext context) throws Exception {
null );
javaFinderTracker.open();
- getPreferenceStore().setDefault(BALLOON_TIMEOUT, DEFAULT_BALLOON_TIMEOUT);
-
}
/*
@@ -130,13 +128,4 @@ public IBalloonManager getJavaScriptBalloonManager() {
return manager;
}
- /**
- * Initializes a preference store with default preference values
- * for this plug-in.
- */
- protected void initializeDefaultPreferences(IPreferenceStore store) {
- store.setDefault(BALLOON_TIMEOUT, DEFAULT_BALLOON_TIMEOUT);
- logger.debug( "Default balloon preferences set timeout: "
- + DEFAULT_BALLOON_TIMEOUT );
- }
}
View
8 ...ins/net.bioclipse.balloon.business/src/net/bioclipse/balloon/business/BalloonManager.java
@@ -352,10 +352,10 @@ public String generate3Dconformations( String inputfile,
try {
//Read timeout from prefs
- int timeout
- = Activator.getDefault().getPreferenceStore()
- .getInt( net.bioclipse.balloon.business
- .Activator.BALLOON_TIMEOUT );
+ int timeout = net.bioclipse.balloon.business.Activator
+ .getDefault().getPreferenceStore()
+ .getInt( net.bioclipse.balloon.business.Activator
+ .BALLOON_TIMEOUT );
//Just to be sure...
if (timeout<=0)
View
34 ...bioclipse.balloon.business/src/net/bioclipse/balloon/ui/BalloonPreferenceInitializer.java
@@ -0,0 +1,34 @@
+/* *****************************************************************************
+ * Copyright (c) 2002 Arvid Berg.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Arvid Berg - initial implementation
+ ******************************************************************************/
+package net.bioclipse.balloon.ui;
+
+import net.bioclipse.balloon.business.Activator;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.osgi.service.prefs.Preferences;
+
+/**
+ * @author arvid
+ *
+ */
+public class BalloonPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ Preferences node = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID);
+ node.put(Activator.BALLOON_TIMEOUT,Integer.toString(Activator.DEFAULT_BALLOON_TIMEOUT));
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.