Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 245918 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rse/internal/connectorservice/dstore/Activator.java (-24 / +46 lines)
Lines 7-16 Link Here
7
 *
7
 *
8
 * Initial Contributors:
8
 * Initial Contributors:
9
 * The following IBM employees contributed to the Remote System Explorer
9
 * The following IBM employees contributed to the Remote System Explorer
10
 * component that contains this file: David McKnight, Kushal Munir, 
10
 * component that contains this file: David McKnight, Kushal Munir,
11
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
11
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
13
 * 
13
 *
14
 * Contributors:
14
 * Contributors:
15
 * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
15
 * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
16
 * David McKnight   (IBM)        - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
16
 * David McKnight   (IBM)        - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
Lines 18-32 Link Here
18
 * David McKnight   (IBM)        - [227406] [dstore] DStoreFileService must listen to buffer size preference changes
18
 * David McKnight   (IBM)        - [227406] [dstore] DStoreFileService must listen to buffer size preference changes
19
 * David McKnight   (IBM)        - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
19
 * David McKnight   (IBM)        - [228334][api][breaking][dstore] Default DataStore connection timeout is too short
20
 * David McKnight   (IBM)        - [233160] [dstore] SSL/non-SSL alert are not appropriate
20
 * David McKnight   (IBM)        - [233160] [dstore] SSL/non-SSL alert are not appropriate
21
 * Martin Oberhuber (Wind River) - [245918] Allow customization of DStore Preferences
21
 *******************************************************************************/
22
 *******************************************************************************/
22
23
23
package org.eclipse.rse.internal.connectorservice.dstore;
24
package org.eclipse.rse.internal.connectorservice.dstore;
24
25
26
import org.eclipse.core.runtime.preferences.DefaultScope;
25
import org.eclipse.jface.preference.IPreferenceStore;
27
import org.eclipse.jface.preference.IPreferenceStore;
26
import org.eclipse.rse.connectorservice.dstore.IUniversalDStoreConstants;
28
import org.eclipse.rse.connectorservice.dstore.IUniversalDStoreConstants;
27
import org.eclipse.rse.ui.ISystemPreferencesConstants;
29
import org.eclipse.rse.ui.ISystemPreferencesConstants;
28
import org.eclipse.rse.ui.RSEUIPlugin;
30
import org.eclipse.rse.ui.RSEUIPlugin;
29
import org.eclipse.rse.ui.SystemBasePlugin;
31
import org.eclipse.rse.ui.SystemBasePlugin;
32
import org.eclipse.ui.preferences.ScopedPreferenceStore;
30
import org.osgi.framework.BundleContext;
33
import org.osgi.framework.BundleContext;
31
34
32
/**
35
/**
Lines 36-44 Link Here
36
39
37
	//The shared instance.
40
	//The shared instance.
38
	private static Activator plugin;
41
	private static Activator plugin;
39
	
42
40
	public final static String PLUGIN_ID = "org.eclipse.rse.connectorservice.dstore"; //$NON-NLS-1$
43
	public final static String PLUGIN_ID = "org.eclipse.rse.connectorservice.dstore"; //$NON-NLS-1$
41
	
44
42
	/**
45
	/**
43
	 * The constructor.
46
	 * The constructor.
44
	 */
47
	 */
Lines 49-86 Link Here
49
	/**
52
	/**
50
	 * This method is called upon plug-in activation
53
	 * This method is called upon plug-in activation
51
	 */
54
	 */
52
	public void start(BundleContext context) throws Exception 
55
	public void start(BundleContext context) throws Exception
53
	{
56
	{
54
		super.start(context);
57
		super.start(context);
55
58
56
		initializeDefaultPreferences();
59
		initializeDefaultPreferences();
57
	}
60
	}
58
	
61
59
	
60
	public void initializeDefaultPreferences() {
62
	public void initializeDefaultPreferences() {
61
		IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
63
64
		// [245918] Since our Preferences are stored in RSEUIPlugin, we cannot
65
		// use the core.runtime.preferences extension in order to do
66
		// initialization in the correct order (allow overriding by
67
		// plugin_customization.ini). We therefore explicitly check each
68
		// Preference slot, and only set a there isn't one set already.
69
		// This requires explicit access to the DefaultScope().
70
		// TODO move Preferences to our own PreferenceStore to simplify this
71
		IPreferenceStore store = new ScopedPreferenceStore(new DefaultScope(), RSEUIPlugin.getDefault().getBundle().getSymbolicName());
72
		//IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
62
		//Preferences store = RSECorePlugin.getDefault().getPluginPreferences();
73
		//Preferences store = RSECorePlugin.getDefault().getPluginPreferences();
63
74
64
		store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_TIMEOUT);	
75
		//In DefaultScope, isDefault() means: no value specified in defaultScope, fallback to default-default
65
		
76
		//In this case (no default specified yet), we may specify our default
77
		if (store.isDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT))
78
			store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_TIMEOUT);
79
66
		// do keepalive
80
		// do keepalive
67
		store.setDefault(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_DO_KEEPALIVE);
81
		if (store.isDefault(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE))
68
		
82
			store.setDefault(IUniversalDStoreConstants.RESID_PREF_DO_KEEPALIVE, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_DO_KEEPALIVE);
69
		// socket read timeout 
83
70
		store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT,  IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_READ_TIMEOUT);
84
		// socket read timeout
71
		
85
		if (store.isDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT))
86
			store.setDefault(IUniversalDStoreConstants.RESID_PREF_SOCKET_READ_TIMEOUT, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_SOCKET_READ_TIMEOUT);
87
72
		// keepalive response timeout
88
		// keepalive response timeout
73
		store.setDefault(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT,  IDStoreDefaultPreferenceConstants.DEFAULT_PREF_KEEPALIVE_RESPONSE_TIMEOUT);		
89
		if (store.isDefault(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT))
74
		
90
			store.setDefault(IUniversalDStoreConstants.RESID_PREF_KEEPALIVE_RESPONSE_TIMEOUT,
91
					IDStoreDefaultPreferenceConstants.DEFAULT_PREF_KEEPALIVE_RESPONSE_TIMEOUT);
92
75
		// show mismatched server warning
93
		// show mismatched server warning
76
		store.setDefault(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER, IDStoreDefaultPreferenceConstants.DEFAULT_ALERT_MISMATCHED_SERVER);
94
		if (store.isDefault(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER))
95
			store.setDefault(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER, IDStoreDefaultPreferenceConstants.DEFAULT_ALERT_MISMATCHED_SERVER);
77
96
78
		// cache remote classes
97
		// cache remote classes
79
		store.setDefault(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_CACHE_REMOTE_CLASSES);			
98
		if (store.isDefault(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES))
80
		
99
			store.setDefault(IUniversalDStoreConstants.RESID_PREF_CACHE_REMOTE_CLASSES, IDStoreDefaultPreferenceConstants.DEFAULT_PREF_CACHE_REMOTE_CLASSES);
100
81
		// alert defaults
101
		// alert defaults
82
		store.setDefault(ISystemPreferencesConstants.ALERT_SSL, ISystemPreferencesConstants.DEFAULT_ALERT_SSL);		
102
		if (store.isDefault(ISystemPreferencesConstants.ALERT_SSL))
83
		store.setDefault(ISystemPreferencesConstants.ALERT_NONSSL, ISystemPreferencesConstants.DEFAULT_ALERT_NON_SSL);
103
			store.setDefault(ISystemPreferencesConstants.ALERT_SSL, ISystemPreferencesConstants.DEFAULT_ALERT_SSL);
104
		if (store.isDefault(ISystemPreferencesConstants.ALERT_NONSSL))
105
			store.setDefault(ISystemPreferencesConstants.ALERT_NONSSL, ISystemPreferencesConstants.DEFAULT_ALERT_NON_SSL);
84
	}
106
	}
85
107
86
	/**
108
	/**
Lines 103-108 Link Here
103
	protected void initializeImageRegistry()
125
	protected void initializeImageRegistry()
104
	{
126
	{
105
		// TODO Auto-generated method stub
127
		// TODO Auto-generated method stub
106
		
128
107
	}
129
	}
108
}
130
}

Return to bug 245918