| package org.eclipse.dltk.python.internal.debug.ui.preferences; |
| |
| import org.eclipse.core.resources.IProject; |
| import org.eclipse.dltk.debug.core.DLTKDebugPreferenceConstants; |
| import org.eclipse.dltk.debug.ui.preferences.AbstractDebuggingOptionsBlock; |
| import org.eclipse.dltk.python.core.PythonNature; |
| import org.eclipse.dltk.python.internal.debug.PythonDebugPlugin; |
| import org.eclipse.dltk.ui.PreferencesAdapter; |
| import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPropertyAndPreferencePage; |
| import org.eclipse.dltk.ui.preferences.AbstractOptionsBlock; |
| import org.eclipse.dltk.ui.preferences.PreferenceKey; |
| import org.eclipse.dltk.ui.util.IStatusChangeListener; |
| import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; |
| |
| /** |
| * Python debug preference page |
| */ |
| public class PythonDebugPreferencePage extends |
| AbstractConfigurationBlockPropertyAndPreferencePage { |
| |
| private static PreferenceKey BREAK_ON_FIRST_LINE = new PreferenceKey( |
| PythonDebugPlugin.PLUGIN_ID, |
| DLTKDebugPreferenceConstants.PREF_DBGP_BREAK_ON_FIRST_LINE); |
| |
| private static PreferenceKey ENABLE_DBGP_LOGGING = new PreferenceKey( |
| PythonDebugPlugin.PLUGIN_ID, |
| DLTKDebugPreferenceConstants.PREF_DBGP_ENABLE_LOGGING); |
| |
| private static final String PREFERENCE_PAGE_ID = "org.eclipse.dltk.python.preferences.debug"; |
| private static final String PROPERTY_PAGE_ID = "org.eclipse.dltk.python.propertyPage.debug"; |
| |
| /* |
| * @see org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPropertyAndPreferencePage#createOptionsBlock(org.eclipse.dltk.ui.util.IStatusChangeListener, |
| * org.eclipse.core.resources.IProject, |
| * org.eclipse.ui.preferences.IWorkbenchPreferenceContainer) |
| */ |
| protected AbstractOptionsBlock createOptionsBlock( |
| IStatusChangeListener newStatusChangedListener, IProject project, |
| IWorkbenchPreferenceContainer container) { |
| return new AbstractDebuggingOptionsBlock(newStatusChangedListener, project, |
| getKeys(), container) { |
| |
| protected PreferenceKey getBreakOnFirstLineKey() { |
| return BREAK_ON_FIRST_LINE; |
| } |
| |
| protected PreferenceKey getDbgpLoggingEnabledKey() { |
| return ENABLE_DBGP_LOGGING; |
| } |
| }; |
| } |
| |
| protected PreferenceKey[] getKeys() { |
| return new PreferenceKey[] { BREAK_ON_FIRST_LINE, ENABLE_DBGP_LOGGING }; |
| } |
| |
| /* |
| * @see org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPropertyAndPreferencePage#getHelpId() |
| */ |
| protected String getHelpId() { |
| // TODO Auto-generated method stub |
| return null; |
| } |
| |
| protected String getNatureId() { |
| return PythonNature.NATURE_ID; |
| } |
| |
| /* |
| * @see org.eclipse.dltk.internal.ui.preferences.PropertyAndPreferencePage#getPreferencePageId() |
| */ |
| protected String getPreferencePageId() { |
| return PREFERENCE_PAGE_ID; |
| } |
| |
| /* |
| * @see org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPropertyAndPreferencePage#getProjectHelpId() |
| */ |
| protected String getProjectHelpId() { |
| // TODO Auto-generated method stub |
| return null; |
| } |
| |
| /* |
| * @see org.eclipse.dltk.internal.ui.preferences.PropertyAndPreferencePage#getPropertyPageId() |
| */ |
| protected String getPropertyPageId() { |
| return PROPERTY_PAGE_ID; |
| } |
| |
| /* |
| * @see org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPropertyAndPreferencePage#setDescription() |
| */ |
| protected void setDescription() { |
| setDescription(PythonDebugPreferencesMessages.PythonDebugPreferencePage_description); |
| } |
| |
| /* |
| * @see org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPropertyAndPreferencePage#setPreferenceStore() |
| */ |
| protected void setPreferenceStore() { |
| setPreferenceStore(new PreferencesAdapter(PythonDebugPlugin |
| .getDefault().getPluginPreferences())); |
| } |
| } |