FileDocCategorySizeDatePackage
PreferenceInitializer.javaAPI DocAndroid 1.5 API4183Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.ddms.preferences

PreferenceInitializer

public class PreferenceInitializer extends org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer
Class used to initialize default preference values.

Fields Summary
public static final String
ATTR_LOG_LEVEL
public static final String
ATTR_DEBUG_PORT_BASE
public static final String
ATTR_SELECTED_DEBUG_PORT
public static final String
ATTR_DEFAULT_THREAD_UPDATE
public static final String
ATTR_DEFAULT_HEAP_UPDATE
public static final String
ATTR_THREAD_INTERVAL
public static final String
ATTR_IMAGE_SAVE_DIR
public static final String
ATTR_LAST_IMAGE_SAVE_DIR
public static final String
ATTR_LOGCAT_FONT
Constructors Summary
Methods Summary
public voidinitializeDefaultPreferences()

 //$NON-NLS-1$
    
    /*
     * (non-Javadoc)
     *
     * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer
     * #initializeDefaultPreferences()
     */
    
       
        IPreferenceStore store = DdmsPlugin.getDefault().getPreferenceStore();

        store.setDefault(ATTR_DEBUG_PORT_BASE, DdmPreferences.DEFAULT_DEBUG_PORT_BASE);

        store.setDefault(ATTR_SELECTED_DEBUG_PORT, DdmPreferences.DEFAULT_SELECTED_DEBUG_PORT);

        store.setDefault(ATTR_DEFAULT_THREAD_UPDATE, DdmPreferences.DEFAULT_INITIAL_THREAD_UPDATE);
        store.setDefault(ATTR_DEFAULT_HEAP_UPDATE,
                DdmPreferences.DEFAULT_INITIAL_HEAP_UPDATE);

        store.setDefault(ATTR_THREAD_INTERVAL, DdmUiPreferences.DEFAULT_THREAD_REFRESH_INTERVAL);

        String homeDir = System.getProperty("user.home"); //$NON-NLS-1$
        store.setDefault(ATTR_IMAGE_SAVE_DIR, homeDir);

        store.setDefault(ATTR_LOG_LEVEL, DdmPreferences.DEFAULT_LOG_LEVEL.getStringValue());

        store.setDefault(ATTR_LOGCAT_FONT,
                new FontData("Courier", 10, SWT.NORMAL).toString()); //$NON-NLS-1$
    
public static synchronized voidsetupPreferences()
Initializes the preferences of ddmlib and ddmuilib with values from the eclipse store.

        IPreferenceStore store = DdmsPlugin.getDefault().getPreferenceStore();
        
        DdmPreferences.setDebugPortBase(store.getInt(ATTR_DEBUG_PORT_BASE));
        DdmPreferences.setSelectedDebugPort(store.getInt(ATTR_SELECTED_DEBUG_PORT));
        DdmPreferences.setLogLevel(store.getString(ATTR_LOG_LEVEL));
        DdmPreferences.setInitialThreadUpdate(store.getBoolean(ATTR_DEFAULT_THREAD_UPDATE));
        DdmPreferences.setInitialHeapUpdate(store.getBoolean(ATTR_DEFAULT_HEAP_UPDATE));
        DdmUiPreferences.setThreadRefreshInterval(store.getInt(ATTR_THREAD_INTERVAL));