diff options
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences')
4 files changed, 0 insertions, 531 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatColorsPage.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatColorsPage.java deleted file mode 100644 index 675a51c24..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatColorsPage.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.ide.eclipse.ddms.preferences; - -import com.android.ddmuilib.logcat.LogCatPanel; -import com.android.ide.eclipse.ddms.DdmsPlugin; - -import org.eclipse.jface.preference.ColorFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -public class LogCatColorsPage extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage { - public LogCatColorsPage() { - super(GRID); - setPreferenceStore(DdmsPlugin.getDefault().getPreferenceStore()); - } - - @Override - public void init(IWorkbench workbench) { - } - - @Override - protected void createFieldEditors() { - // colors preference for different log levels - ColorFieldEditor cfe = new ColorFieldEditor(LogCatPanel.VERBOSE_COLOR_PREFKEY, - "Verbose Log Message Color", getFieldEditorParent()); - addField(cfe); - - cfe = new ColorFieldEditor(LogCatPanel.DEBUG_COLOR_PREFKEY, "Debug Log Message Color", - getFieldEditorParent()); - addField(cfe); - - cfe = new ColorFieldEditor(LogCatPanel.INFO_COLOR_PREFKEY, "Info Log Message Color", - getFieldEditorParent()); - addField(cfe); - - cfe = new ColorFieldEditor(LogCatPanel.WARN_COLOR_PREFKEY, "Warning Log Message Color", - getFieldEditorParent()); - addField(cfe); - - cfe = new ColorFieldEditor(LogCatPanel.ERROR_COLOR_PREFKEY, "Error Log Message Color", - getFieldEditorParent()); - addField(cfe); - - cfe = new ColorFieldEditor(LogCatPanel.ASSERT_COLOR_PREFKEY, "Assert Log Message Color", - getFieldEditorParent()); - addField(cfe); - } -} diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java deleted file mode 100644 index aa88eecb7..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.ide.eclipse.ddms.preferences; - -import com.android.ddmlib.Log.LogLevel; -import com.android.ddmuilib.logcat.LogCatMessageList; -import com.android.ddmuilib.logcat.LogCatPanel; -import com.android.ide.eclipse.base.InstallDetails; -import com.android.ide.eclipse.ddms.DdmsPlugin; -import com.android.ide.eclipse.ddms.LogCatMonitor; -import com.android.ide.eclipse.ddms.i18n.Messages; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.ComboFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.FontFieldEditor; -import org.eclipse.jface.preference.IntegerFieldEditor; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IPerspectiveDescriptor; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.PlatformUI; - -/** - * Preference Pane for LogCat. - */ -public class LogCatPreferencePage extends FieldEditorPreferencePage implements - IWorkbenchPreferencePage { - private BooleanFieldEditor mSwitchPerspective; - private ComboFieldEditor mWhichPerspective; - private IntegerFieldEditor mMaxMessages; - private BooleanFieldEditor mAutoMonitorLogcat; - private ComboFieldEditor mAutoMonitorLogcatLevel; - private BooleanFieldEditor mAutoScrollLock; - - public LogCatPreferencePage() { - super(GRID); - setPreferenceStore(DdmsPlugin.getDefault().getPreferenceStore()); - } - - @Override - protected void createFieldEditors() { - FontFieldEditor ffe = new FontFieldEditor(LogCatPanel.LOGCAT_VIEW_FONT_PREFKEY, - Messages.LogCatPreferencePage_Display_Font, getFieldEditorParent()); - addField(ffe); - - mMaxMessages = new IntegerFieldEditor( - LogCatMessageList.MAX_MESSAGES_PREFKEY, - Messages.LogCatPreferencePage_MaxMessages, getFieldEditorParent()); - addField(mMaxMessages); - - mAutoScrollLock = new BooleanFieldEditor(LogCatPanel.AUTO_SCROLL_LOCK_PREFKEY, - "Automatically enable/disable scroll lock based on the scrollbar position", - getFieldEditorParent()); - addField(mAutoScrollLock); - - createHorizontalSeparator(); - - if (InstallDetails.isAdtInstalled()) { - createAdtSpecificFieldEditors(); - } - } - - private void createHorizontalSeparator() { - Label l = new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 3; - l.setLayoutData(gd); - } - - private void createAdtSpecificFieldEditors() { - mSwitchPerspective = new BooleanFieldEditor(PreferenceInitializer.ATTR_SWITCH_PERSPECTIVE, - Messages.LogCatPreferencePage_Switch_Perspective, getFieldEditorParent()); - addField(mSwitchPerspective); - IPerspectiveDescriptor[] perspectiveDescriptors = - PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives(); - String[][] perspectives = new String[0][0]; - if (perspectiveDescriptors.length > 0) { - perspectives = new String[perspectiveDescriptors.length][2]; - for (int i = 0; i < perspectiveDescriptors.length; i++) { - IPerspectiveDescriptor perspective = perspectiveDescriptors[i]; - perspectives[i][0] = perspective.getLabel(); - perspectives[i][1] = perspective.getId(); - } - } - mWhichPerspective = new ComboFieldEditor(PreferenceInitializer.ATTR_PERSPECTIVE_ID, - Messages.LogCatPreferencePage_Switch_To, perspectives, getFieldEditorParent()); - mWhichPerspective.setEnabled(getPreferenceStore() - .getBoolean(PreferenceInitializer.ATTR_SWITCH_PERSPECTIVE), getFieldEditorParent()); - addField(mWhichPerspective); - - createHorizontalSeparator(); - - mAutoMonitorLogcat = new BooleanFieldEditor(LogCatMonitor.AUTO_MONITOR_PREFKEY, - Messages.LogCatPreferencePage_AutoMonitorLogcat, - getFieldEditorParent()); - addField(mAutoMonitorLogcat); - - mAutoMonitorLogcatLevel = new ComboFieldEditor(LogCatMonitor.AUTO_MONITOR_LOGLEVEL, - Messages.LogCatPreferencePage_SessionFilterLogLevel, - new String[][] { - { LogLevel.VERBOSE.toString(), LogLevel.VERBOSE.getStringValue() }, - { LogLevel.DEBUG.toString(), LogLevel.DEBUG.getStringValue() }, - { LogLevel.INFO.toString(), LogLevel.INFO.getStringValue() }, - { LogLevel.WARN.toString(), LogLevel.WARN.getStringValue() }, - { LogLevel.ERROR.toString(), LogLevel.ERROR.getStringValue() }, - { LogLevel.ASSERT.toString(), LogLevel.ASSERT.getStringValue() }, - }, - getFieldEditorParent()); - mAutoMonitorLogcatLevel.setEnabled( - getPreferenceStore().getBoolean(LogCatMonitor.AUTO_MONITOR_PREFKEY), - getFieldEditorParent()); - addField(mAutoMonitorLogcatLevel); - } - - @Override - public void init(IWorkbench workbench) { - } - - @Override - public void propertyChange(PropertyChangeEvent event) { - if (event.getSource().equals(mSwitchPerspective)) { - mWhichPerspective.setEnabled(mSwitchPerspective.getBooleanValue(), - getFieldEditorParent()); - } else if (event.getSource().equals(mAutoMonitorLogcat)) { - mAutoMonitorLogcatLevel.setEnabled(mAutoMonitorLogcat.getBooleanValue(), - getFieldEditorParent()); - } - } - - @Override - protected void performDefaults() { - super.performDefaults(); - mWhichPerspective.setEnabled(mSwitchPerspective.getBooleanValue(), getFieldEditorParent()); - - mMaxMessages.setStringValue( - Integer.toString(LogCatMessageList.MAX_MESSAGES_DEFAULT)); - - mAutoMonitorLogcatLevel.setEnabled(mAutoMonitorLogcat.getBooleanValue(), - getFieldEditorParent()); - } -} diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java deleted file mode 100644 index 254b2c58a..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.ide.eclipse.ddms.preferences; - -import com.android.ddmlib.DdmPreferences; -import com.android.ddmlib.Log.LogLevel; -import com.android.ddmuilib.DdmUiPreferences; -import com.android.ide.eclipse.ddms.DdmsPlugin; -import com.android.ide.eclipse.ddms.LogCatMonitor; -import com.android.ide.eclipse.ddms.views.DeviceView.HProfHandler; -import com.android.ide.eclipse.ddms.views.LogCatView; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.content.IContentType; -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.FontData; - -/** - * Class used to initialize default preference values. - */ -public class PreferenceInitializer extends AbstractPreferenceInitializer { - - public final static String ATTR_LOG_LEVEL = - DdmsPlugin.PLUGIN_ID + ".logLevel"; //$NON-NLS-1$ - - public final static String ATTR_DEBUG_PORT_BASE = - DdmsPlugin.PLUGIN_ID + ".adbDebugBasePort"; //$NON-NLS-1$ - - public final static String ATTR_SELECTED_DEBUG_PORT = - DdmsPlugin.PLUGIN_ID + ".debugSelectedPort"; //$NON-NLS-1$ - - public final static String ATTR_DEFAULT_THREAD_UPDATE = - DdmsPlugin.PLUGIN_ID + ".defaultThreadUpdateEnabled"; //$NON-NLS-1$ - - public final static String ATTR_DEFAULT_HEAP_UPDATE = - DdmsPlugin.PLUGIN_ID + ".defaultHeapUpdateEnabled"; //$NON-NLS-1$ - - public final static String ATTR_THREAD_INTERVAL = - DdmsPlugin.PLUGIN_ID + ".threadStatusInterval"; //$NON-NLS-1$ - - public final static String ATTR_IMAGE_SAVE_DIR = - DdmsPlugin.PLUGIN_ID + ".imageSaveDir"; //$NON-NLS-1$ - - public final static String ATTR_LAST_IMAGE_SAVE_DIR = - DdmsPlugin.PLUGIN_ID + ".lastImageSaveDir"; //$NON-NLS-1$ - - public final static String ATTR_LOGCAT_FONT = - DdmsPlugin.PLUGIN_ID + ".logcatFont"; //$NON-NLS-1$ - - public final static String ATTR_HPROF_ACTION = - DdmsPlugin.PLUGIN_ID + ".hprofAction"; //$NON-NLS-1$ - - public final static String ATTR_TIME_OUT = - DdmsPlugin.PLUGIN_ID + ".timeOut"; //$NON-NLS-1$ - - public final static String ATTR_USE_ADBHOST = - DdmsPlugin.PLUGIN_ID + ".useAdbHost"; //$NON-NLS-1$ - - public final static String ATTR_ADBHOST_VALUE = - DdmsPlugin.PLUGIN_ID + ".adbHostValue"; //$NON-NLS-1$ - - public final static String ATTR_SWITCH_PERSPECTIVE = - DdmsPlugin.PLUGIN_ID + ".switchPerspective"; //$NON-NLS-1$ - - public final static String ATTR_PERSPECTIVE_ID = - DdmsPlugin.PLUGIN_ID + ".perspectiveId"; //$NON-NLS-1$ - - public static final String ATTR_PROFILER_BUFSIZE_MB = - DdmsPlugin.PLUGIN_ID + ".profilerBufferSizeMb"; //$NON-NLS-1$ - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer - * #initializeDefaultPreferences() - */ - @Override - public void 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_PROFILER_BUFSIZE_MB, DdmPreferences.DEFAULT_PROFILER_BUFFER_SIZE_MB); - - 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$ - - // When obtaining hprof files from the device, default to opening the file - // only if there is a registered content type for the hprof extension. - store.setDefault(ATTR_HPROF_ACTION, HProfHandler.ACTION_SAVE); - for (IContentType contentType: Platform.getContentTypeManager().getAllContentTypes()) { - if (contentType.isAssociatedWith(HProfHandler.DOT_HPROF)) { - store.setDefault(ATTR_HPROF_ACTION, HProfHandler.ACTION_OPEN); - break; - } - } - - store.setDefault(ATTR_TIME_OUT, DdmPreferences.DEFAULT_TIMEOUT); - - store.setDefault(ATTR_USE_ADBHOST, DdmPreferences.DEFAULT_USE_ADBHOST); - store.setDefault(ATTR_ADBHOST_VALUE, DdmPreferences.DEFAULT_ADBHOST_VALUE); - store.setDefault(ATTR_SWITCH_PERSPECTIVE, LogCatView.DEFAULT_SWITCH_PERSPECTIVE); - store.setDefault(ATTR_PERSPECTIVE_ID, LogCatView.DEFAULT_PERSPECTIVE_ID); - - store.setDefault(LogCatMonitor.AUTO_MONITOR_PREFKEY, true); - store.setDefault(LogCatMonitor.AUTO_MONITOR_LOGLEVEL, LogLevel.VERBOSE.getStringValue()); - } - - /** - * Initializes the preferences of ddmlib and ddmuilib with values from the eclipse store. - */ - public synchronized static void setupPreferences() { - 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)); - DdmPreferences.setProfilerBufferSizeMb(store.getInt(ATTR_PROFILER_BUFSIZE_MB)); - DdmUiPreferences.setThreadRefreshInterval(store.getInt(ATTR_THREAD_INTERVAL)); - DdmPreferences.setTimeOut(store.getInt(ATTR_TIME_OUT)); - DdmPreferences.setUseAdbHost(store.getBoolean(ATTR_USE_ADBHOST)); - DdmPreferences.setAdbHostValue(store.getString(ATTR_ADBHOST_VALUE)); - } -} diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java deleted file mode 100644 index 56af601e5..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.ide.eclipse.ddms.preferences; - -import com.android.ddmlib.DdmPreferences; -import com.android.ddmlib.Log.LogLevel; -import com.android.ide.eclipse.base.InstallDetails; -import com.android.ide.eclipse.ddms.DdmsPlugin; -import com.android.ide.eclipse.ddms.i18n.Messages; -import com.android.ide.eclipse.ddms.views.DeviceView.HProfHandler; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.ComboFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IntegerFieldEditor; -import org.eclipse.jface.preference.RadioGroupFieldEditor; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -public class PreferencePage extends FieldEditorPreferencePage implements - IWorkbenchPreferencePage { - - private BooleanFieldEditor mUseAdbHost; - private StringFieldEditor mAdbHostValue; - private IntegerFieldEditor mProfilerBufsize; - - public PreferencePage() { - super(GRID); - setPreferenceStore(DdmsPlugin.getDefault().getPreferenceStore()); - } - - /** - * Creates the field editors. Field editors are abstractions of the common - * GUI blocks needed to manipulate various types of preferences. Each field - * editor knows how to save and restore itself. - */ - @Override - public void createFieldEditors() { - IntegerFieldEditor ife; - - ife = new IntegerFieldEditor(PreferenceInitializer.ATTR_DEBUG_PORT_BASE, - Messages.PreferencePage_Base_Local_Debugger_Port, getFieldEditorParent()); - ife.setValidRange(1024, 32767); - addField(ife); - - BooleanFieldEditor bfe; - - bfe = new BooleanFieldEditor(PreferenceInitializer.ATTR_DEFAULT_THREAD_UPDATE, - Messages.PreferencePage_Thread_Updates_Enabled_By_Default, getFieldEditorParent()); - addField(bfe); - - bfe = new BooleanFieldEditor(PreferenceInitializer.ATTR_DEFAULT_HEAP_UPDATE, - Messages.PreferencePage_Heap_Updates_Enabled_Default, getFieldEditorParent()); - addField(bfe); - - ife = new IntegerFieldEditor(PreferenceInitializer.ATTR_THREAD_INTERVAL, - Messages.PreferencePage_Thread_Status_Refresh_Interval, getFieldEditorParent()); - ife.setValidRange(1, 60); - addField(ife); - - if (InstallDetails.isAdtInstalled()) { - ComboFieldEditor cfe = new ComboFieldEditor(PreferenceInitializer.ATTR_HPROF_ACTION, - Messages.PreferencePage_HPROF_Action, new String[][] { - { - Messages.PreferencePage_Save_Disk, HProfHandler.ACTION_SAVE - }, - { - Messages.PreferencePage_Open_Eclipse, HProfHandler.ACTION_OPEN - }, - }, getFieldEditorParent()); - addField(cfe); - } - - mProfilerBufsize = new IntegerFieldEditor(PreferenceInitializer.ATTR_PROFILER_BUFSIZE_MB, - "Method Profiler buffer size (MB):", - getFieldEditorParent()); - addField(mProfilerBufsize); - - ife = new IntegerFieldEditor(PreferenceInitializer.ATTR_TIME_OUT, - Messages.PreferencePage_ADB_Connection_Time_Out, getFieldEditorParent()); - addField(ife); - - RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor( - PreferenceInitializer.ATTR_LOG_LEVEL, - Messages.PreferencePage_Logging_Level, 1, new String[][] { - { - Messages.PreferencePage_Verbose, LogLevel.VERBOSE.getStringValue() - }, - { - Messages.PreferencePage_Debug, LogLevel.DEBUG.getStringValue() - }, - { - Messages.PreferencePage_Info, LogLevel.INFO.getStringValue() - }, - { - Messages.PreferencePage_Warning, LogLevel.WARN.getStringValue() - }, - { - Messages.PreferencePage_Error, LogLevel.ERROR.getStringValue() - }, - { - Messages.PreferencePage_Assert, LogLevel.ASSERT.getStringValue() - } - }, - getFieldEditorParent(), true); - addField(rgfe); - mUseAdbHost = new BooleanFieldEditor(PreferenceInitializer.ATTR_USE_ADBHOST, - Messages.PreferencePage_Use_Adbhost, getFieldEditorParent()); - addField(mUseAdbHost); - mAdbHostValue = new StringFieldEditor(PreferenceInitializer.ATTR_ADBHOST_VALUE, - Messages.PreferencePage_Adbhost_value, getFieldEditorParent()); - mAdbHostValue.setEnabled(getPreferenceStore() - .getBoolean(PreferenceInitializer.ATTR_USE_ADBHOST), getFieldEditorParent()); - addField(mAdbHostValue); - } - - @Override - public void init(IWorkbench workbench) { - } - - @Override - public void propertyChange(PropertyChangeEvent event) { - if (event.getSource().equals(mUseAdbHost)) { - mAdbHostValue.setEnabled(mUseAdbHost.getBooleanValue(), getFieldEditorParent()); - } else if (event.getSource().equals(mProfilerBufsize)) { - DdmPreferences.setProfilerBufferSizeMb(mProfilerBufsize.getIntValue()); - } - super.propertyChange(event); - } - - @Override - protected void performDefaults() { - super.performDefaults(); - mAdbHostValue.setEnabled(mUseAdbHost.getBooleanValue(), getFieldEditorParent()); - } -} |