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

LogCatPreferencePage

public class LogCatPreferencePage extends org.eclipse.jface.preference.FieldEditorPreferencePage implements org.eclipse.ui.IWorkbenchPreferencePage
Preference Pane for LogCat.

Fields Summary
Constructors Summary
public LogCatPreferencePage()

        super(GRID);
        setPreferenceStore(DdmsPlugin.getDefault().getPreferenceStore());
    
Methods Summary
protected voidcreateFieldEditors()

        FontFieldEditor ffe = new FontFieldEditor(PreferenceInitializer.ATTR_LOGCAT_FONT,
                "Display Font:", getFieldEditorParent());
        addField(ffe);

        Preferences prefs = DdmsPlugin.getDefault().getPluginPreferences();
        prefs.addPropertyChangeListener(new IPropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent event) {
                // get the name of the property that changed.
                String property = event.getProperty();

                if (PreferenceInitializer.ATTR_LOGCAT_FONT.equals(property)) {
                    try {
                        FontData fdat = new FontData((String)event.getNewValue());
                        LogCatView.setFont(new Font(getFieldEditorParent().getDisplay(), fdat));
                    } catch (IllegalArgumentException e) {
                        // Looks like the data from the store is not valid.
                        // We do nothing (default font will be used).
                    } catch (SWTError e2) {
                        // Looks like the Font() constructor failed.
                        // We do nothing in this case, the logcat view will use the default font.
                    }
                }
            }
        });
    
public voidinit(org.eclipse.ui.IWorkbench workbench)